[#25] Client: Implement Patch and Range methods
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
bff8d67867
commit
003b7fdfdd
51 changed files with 1338 additions and 137 deletions
24
src/FrostFS.SDK.ClientV2/Pool/SessionCache.cs
Normal file
24
src/FrostFS.SDK.ClientV2/Pool/SessionCache.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace FrostFS.SDK.ClientV2;
|
||||
|
||||
internal struct SessionCache(ulong sessionExpirationDuration)
|
||||
{
|
||||
internal Hashtable Cache { get; } = [];
|
||||
|
||||
internal ulong CurrentEpoch { get; set; }
|
||||
|
||||
internal ulong TokenDuration { get; set; } = sessionExpirationDuration;
|
||||
|
||||
internal void DeleteByPrefix(string prefix)
|
||||
{
|
||||
foreach (var key in Cache.Keys)
|
||||
{
|
||||
if (((string)key).StartsWith(prefix, StringComparison.Ordinal))
|
||||
{
|
||||
Cache.Remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue