Initial SDK structure #1

Merged
i.pchelintsev merged 18 commits from i.pchelintsev/frostfs-sdk-csharp:master into master 2024-09-04 19:51:24 +00:00
4 changed files with 6 additions and 6 deletions
Showing only changes of commit 63f91ac627 - Show all commits

View file

@ -16,7 +16,7 @@ public partial class Client: IFrostFSClient
{
private GrpcChannel _channel;
private readonly ECDsa _key;
private readonly OwnerId _owner;
public readonly OwnerId OwnerId;
public readonly Version Version = new (2, 13);
private ContainerService.ContainerServiceClient _containerServiceClient;
@ -28,7 +28,7 @@ public partial class Client: IFrostFSClient
{
// TODO: Развязать клиент и реализацию GRPC
_key = key.LoadWif();
_owner = OwnerId.FromKey(_key);
OwnerId = OwnerId.FromKey(_key);
InitGrpcChannel(host);
InitContainerClient();
InitNetmapClient();

View file

@ -27,7 +27,7 @@ public partial class Client
{
Body = new ListRequest.Types.Body
{
OwnerId = _owner.ToGrpcMessage()
OwnerId = OwnerId.ToGrpcMessage()
}
};
request.AddMetaHeader();
@ -41,7 +41,7 @@ public partial class Client
public async Task<ContainerId> CreateContainerAsync(ModelsV2.Container container)
{
var cntnr = container.ToGrpcMessage();
cntnr.OwnerId = _owner.ToGrpcMessage();
cntnr.OwnerId = OwnerId.ToGrpcMessage();
cntnr.Version = Version.ToGrpcMessage();
var request = new PutRequest
{

View file

@ -93,7 +93,7 @@ public partial class Client
{
var sessionToken = await CreateSessionAsync(uint.MaxValue);
var hdr = header.ToGrpcMessage();
hdr.OwnerId = _owner.ToGrpcMessage();
hdr.OwnerId = OwnerId.ToGrpcMessage();
hdr.Version = Version.ToGrpcMessage();
var oid = new ObjectID
{

View file

@ -11,7 +11,7 @@ public partial class Client
{
Body = new CreateRequest.Types.Body
{
OwnerId = _owner.ToGrpcMessage(),
OwnerId = OwnerId.ToGrpcMessage(),
Expiration = expiration,
}
};