[#1] Add presentation layer
Signed-off-by: Ivan Pchelintsev <i.pchelintsev@yadro.com>
This commit is contained in:
parent
2800fff041
commit
bb6e187b61
22 changed files with 778 additions and 79 deletions
26
sdk/src/FrostFS.SDK.ClientV2/Mappers/GRPC/Container.cs
Normal file
26
sdk/src/FrostFS.SDK.ClientV2/Mappers/GRPC/Container.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using FrostFS.SDK.ClientV2.Mappers.GRPC.Netmap;
|
||||
using FrostFS.SDK.Cryptography;
|
||||
using Google.Protobuf;
|
||||
|
||||
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
|
||||
|
||||
public static class ContainerMapper
|
||||
{
|
||||
public static Container.Container ToGrpcMessage(this ModelsV2.Container container)
|
||||
{
|
||||
return new Container.Container
|
||||
{
|
||||
PlacementPolicy = container.PlacementPolicy.ToGrpcMessage(),
|
||||
Nonce = ByteString.CopyFrom(container.Nonce.ToBytes())
|
||||
};
|
||||
}
|
||||
|
||||
public static ModelsV2.Container ToModel(this Container.Container container)
|
||||
{
|
||||
return new ModelsV2.Container(container.PlacementPolicy.ToModel())
|
||||
{
|
||||
Nonce = container.Nonce.ToUuid(),
|
||||
Version = container.Version.ToModel()
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue