Initial SDK structure #1
4 changed files with 6 additions and 6 deletions
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@ public partial class Client
|
|||
{
|
||||
Body = new CreateRequest.Types.Body
|
||||
{
|
||||
OwnerId = _owner.ToGrpcMessage(),
|
||||
OwnerId = OwnerId.ToGrpcMessage(),
|
||||
Expiration = expiration,
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue