[#26] All: Remove V2 from naming
Rename project, namespaces and class names Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
c406df1a78
commit
766f61a5f7
219 changed files with 219 additions and 974 deletions
22
src/FrostFS.SDK.Client/Services/Shared/SessionProvider.cs
Normal file
22
src/FrostFS.SDK.Client/Services/Shared/SessionProvider.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace FrostFS.SDK.Client;
|
||||
|
||||
internal interface ISessionProvider
|
||||
{
|
||||
ValueTask<Session.SessionToken> GetOrCreateSession(ISessionToken args, CallContext ctx);
|
||||
}
|
||||
|
||||
internal sealed class SessionProvider(ClientContext envCtx)
|
||||
{
|
||||
public async ValueTask<Session.SessionToken> GetOrCreateSession(ISessionToken args, CallContext ctx)
|
||||
{
|
||||
if (args.SessionToken is null)
|
||||
{
|
||||
return await envCtx.Client.CreateSessionInternalAsync(new PrmSessionCreate(uint.MaxValue, ctx))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return new Session.SessionToken().Deserialize(args.SessionToken.Token);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue