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

View file

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

View file

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

View file

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