[#11] Add Network Snapshot
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
b69d22966f
commit
c988ff3c76
84 changed files with 2238 additions and 933 deletions
25
src/FrostFS.SDK.ClientV2/Mappers/Session/Session.cs
Normal file
25
src/FrostFS.SDK.ClientV2/Mappers/Session/Session.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
using System;
|
||||
using Google.Protobuf;
|
||||
|
||||
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
|
||||
|
||||
public static class SessionMapper
|
||||
{
|
||||
internal static string SerializeSessionToken(this Session.SessionToken token)
|
||||
{
|
||||
byte[] bytes = new byte[token.CalculateSize()];
|
||||
CodedOutputStream stream = new(bytes);
|
||||
token.WriteTo(stream);
|
||||
|
||||
return Convert.ToBase64String(bytes);
|
||||
}
|
||||
|
||||
internal static Session.SessionToken DeserializeSessionToken(this byte[] bytes)
|
||||
{
|
||||
Session.SessionToken token = new();
|
||||
token.MergeFrom(bytes);
|
||||
|
||||
return token;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue