[#45] Fix linter errors

- Changed package names adding version
- Added documentation descriptions (sometimes useless) for all fields
- Changed enum format
- Made SessionToken and BearerToken field names more clear

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
Stanislav Bogatyrev 2020-08-13 00:43:51 +03:00 committed by Alex Vanin
parent 35d1d34ee0
commit 42e35fefff
13 changed files with 393 additions and 224 deletions

View file

@ -1,9 +1,9 @@
syntax = "proto3";
package container;
package neo.fs.v2.container;
option go_package = "github.com/nspcc-dev/neofs-api-go/container";
option csharp_namespace = "NeoFS.API.Container";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container;container";
option csharp_namespace = "NeoFS.API.v2.Container";
import "acl/types.proto";
import "container/types.proto";
@ -11,9 +11,9 @@ import "refs/types.proto";
import "service/meta.proto";
import "service/verify.proto";
// Service provides API to access container smart-contract in morph chain
// ContainerService provides API to access container smart-contract in morph chain
// via NeoFS node.
service Service {
service ContainerService {
// Put invokes 'Put' method in container smart-contract and returns
// response immediately. After new block in morph chain, request is verified
// by inner ring nodes. After one more block in morph chain, container
@ -43,7 +43,9 @@ service Service {
rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse);
}
// New NeoFS Container creation request
message PutRequest {
// Request body
message Body {
// Container to create in NeoFS.
container.Container container = 1;
@ -55,138 +57,144 @@ message PutRequest {
// Signature of stable-marshalled container according to RFC-6979.
bytes signature = 3;
}
// Body of container put request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.RequestMetaHeader meta_header = 2;
neo.fs.v2.service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
// New NeoFS Container creation response
message PutResponse {
// Response body
message Body {
// container_id carries identifier of the new container.
refs.ContainerID container_id = 1;
neo.fs.v2.refs.ContainerID container_id = 1;
}
// Body of container put response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
neo.fs.v2.service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
// Container removal request
message DeleteRequest {
// Request body
message Body {
// container_id carries identifier of the container to delete
// from NeoFS.
refs.ContainerID container_id = 1;
neo.fs.v2.refs.ContainerID container_id = 1;
// Signature of container id according to RFC-6979.
bytes signature = 2;
}
// Body of container delete request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.RequestMetaHeader meta_header = 2;
neo.fs.v2.service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
// DeleteResponse is empty because delete operation is asynchronous and done
// via consensus in inner ring nodes
message DeleteResponse {
// Response body
message Body {}
// Body of container delete response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
neo.fs.v2.service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
// Get container structure
message GetRequest {
// Request body
message Body {
// container_id carries identifier of the container to get.
refs.ContainerID container_id = 1;
neo.fs.v2.refs.ContainerID container_id = 1;
}
// Body of container get request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.RequestMetaHeader meta_header = 2;
neo.fs.v2.service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
// Get container structure
message GetResponse {
// Response body
message Body {
// Container that has been requested.
container.Container container = 1;
Container container = 1;
}
// Body of container get response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
neo.fs.v2.service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
// List containers
message ListRequest {
// Request body
message Body {
// owner_id carries identifier of the container owner.
refs.OwnerID owner_id = 1;
neo.fs.v2.refs.OwnerID owner_id = 1;
}
// Body of list containers request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.RequestMetaHeader meta_header = 2;
neo.fs.v2.service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
// List containers
message ListResponse {
// Response body
message Body {
// ContainerIDs carries list of identifiers of the containers that belong to the owner.
repeated refs.ContainerID container_ids = 1;
@ -197,37 +205,40 @@ message ListResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
neo.fs.v2.service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
// Set Extended ACL
message SetExtendedACLRequest {
// Request body
message Body {
// Extended ACL to set for the container.
acl.EACLTable eacl = 1;
neo.fs.v2.acl.EACLTable eacl = 1;
// Signature of stable-marshalled Extended ACL according to RFC-6979.
bytes signature = 2;
}
// Body of set extended acl request message.
Body body = 1;
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.RequestMetaHeader meta_header = 2;
neo.fs.v2.service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
// Set Extended ACL
message SetExtendedACLResponse {
// Response body
message Body { }
// Body of set extended acl response message.
@ -235,18 +246,20 @@ message SetExtendedACLResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
neo.fs.v2.service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
// Get Extended ACL
message GetExtendedACLRequest {
// Request body
message Body {
// container_id carries identifier of the container that has Extended ACL.
refs.ContainerID container_id = 1;
neo.fs.v2.refs.ContainerID container_id = 1;
}
// Body of get extended acl request message.
@ -254,32 +267,33 @@ message GetExtendedACLRequest {
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.RequestMetaHeader meta_header = 2;
neo.fs.v2.service.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
// Get Extended ACL
message GetExtendedACLResponse {
// Response body
message Body {
// Extended ACL that has been requested if it was set up.
acl.EACLTable eacl = 1;
neo.fs.v2.acl.EACLTable eacl = 1;
// Signature of stable-marshalled Extended ACL according to RFC-6979.
bytes signature = 2;
}
// Body of get extended acl response message.
Body body = 1;
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.ResponseMetaHeader meta_header = 2;
neo.fs.v2.service.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness
// of transmission.
service.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}

View file

@ -1,9 +1,9 @@
syntax = "proto3";
package container;
package neo.fs.v2.container;
option go_package = "github.com/nspcc-dev/neofs-api-go/container";
option csharp_namespace = "NeoFS.API.Container";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container;container";
option csharp_namespace = "NeoFS.API.v2.Container";
import "netmap/types.proto";
import "refs/types.proto";
@ -14,7 +14,7 @@ import "refs/types.proto";
// SHA256 hash of stable-marshalled container message.
message Container {
// OwnerID carries identifier of the container owner.
refs.OwnerID owner_id = 1;
neo.fs.v2.refs.OwnerID owner_id = 1;
// Nonce is a 16 byte UUID, used to avoid collisions of container id.
bytes nonce = 2;
@ -31,10 +31,9 @@ message Container {
// Value of immutable container attribute.
string value = 2;
}
// Attributes define any immutable characteristics of container.
repeated Attribute attributes = 4;
// Rules define storage policy for the object inside the container.
netmap.PlacementRule rules = 5;
// Placement policy for the object inside the container.
neo.fs.v2.netmap.PlacementPolicy placement_policy = 5;
}