[#31] refs: Use ContainerID message in all services

Change the type of all fields for the container identifier to refs.ContainerID.
This will allow to follow a single format and not duplicate its description.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-05 18:07:56 +03:00 committed by Stanislav Bogatyrev
parent 2f5f6f8fde
commit fccd753a5d
7 changed files with 26 additions and 24 deletions

View file

@ -3,6 +3,7 @@ package acl;
option go_package = "github.com/nspcc-dev/neofs-api-go/acl"; option go_package = "github.com/nspcc-dev/neofs-api-go/acl";
option csharp_namespace = "NeoFS.API.Acl"; option csharp_namespace = "NeoFS.API.Acl";
import "refs/types.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true; option (gogoproto.stable_marshaler_all) = true;
@ -101,8 +102,8 @@ message EACLRecord {
// EACLRecord carries the information about extended ACL rules. // EACLRecord carries the information about extended ACL rules.
message EACLTable { message EACLTable {
// ContainerID of the container that should use given access control rules. // Carries identifier of the container that should use given access control rules.
bytes ContainerID = 1 [json_name="ContainerID"]; refs.ContainerID ContainerID = 1 [json_name="ContainerID"];
// Records carries list of extended ACL rule records. // Records carries list of extended ACL rule records.
repeated EACLRecord Records = 2 [json_name="Records"]; repeated EACLRecord Records = 2 [json_name="Records"];
} }

View file

@ -5,6 +5,7 @@ option csharp_namespace = "NeoFS.API.Container";
import "acl/types.proto"; import "acl/types.proto";
import "container/types.proto"; import "container/types.proto";
import "refs/types.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true; option (gogoproto.stable_marshaler_all) = true;
@ -52,13 +53,13 @@ message PutRequest {
} }
message PutResponse { message PutResponse {
// ContainerID of the new container. // ContainerID carries identifier of the new container.
bytes ContainerID = 1; refs.ContainerID ContainerID = 1;
} }
message DeleteRequest { message DeleteRequest {
// ContainerID of container to delete from NeoFS. // ContainerID carries identifier of the container to delete from NeoFS.
bytes ContainerID = 1; refs.ContainerID ContainerID = 1;
// Signature of container id according to RFC-6979. // Signature of container id according to RFC-6979.
bytes Signature = 2; bytes Signature = 2;
} }
@ -69,8 +70,8 @@ message DeleteResponse { }
message GetRequest { message GetRequest {
// ContainerID of the container to get. // ContainerID carries identifier of the container to get.
bytes ContainerID = 1; refs.ContainerID ContainerID = 1;
} }
message GetResponse { message GetResponse {
@ -84,8 +85,8 @@ message ListRequest {
} }
message ListResponse { message ListResponse {
// ContainerIDs of containers that belong to the owner. // ContainerIDs carries list of identifiers of the containers that belong to the owner.
repeated bytes ContainerIDs = 1; repeated refs.ContainerID ContainerIDs = 1;
} }
message SetExtendedACLRequest { message SetExtendedACLRequest {
@ -98,8 +99,8 @@ message SetExtendedACLRequest {
message SetExtendedACLResponse {} message SetExtendedACLResponse {}
message GetExtendedACLRequest { message GetExtendedACLRequest {
// ContainerID of the container that has Extended ACL. // ContainerID carries identifier of the container that has Extended ACL.
bytes ContainerID = 1; refs.ContainerID ContainerID = 1;
} }
message GetExtendedACLResponse { message GetExtendedACLResponse {

View file

@ -138,8 +138,8 @@ message HeadResponse {
} }
message SearchRequest { message SearchRequest {
// ContainerID for searching the object // ContainerID carries search container identifier.
bytes ContainerID = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "CID"]; refs.ContainerID ContainerID = 1;
// Query in the binary serialized format // Query in the binary serialized format
bytes Query = 2; bytes Query = 2;
// QueryVersion is a version of search query format // QueryVersion is a version of search query format

View file

@ -120,7 +120,7 @@ smart-contract storage.
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ContainerID | [bytes](#bytes) | | ContainerID of container to delete from NeoFS. | | ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the container to delete from NeoFS. |
| Signature | [bytes](#bytes) | | Signature of container id according to RFC-6979. | | Signature | [bytes](#bytes) | | Signature of container id according to RFC-6979. |
@ -140,7 +140,7 @@ via consensus in inner ring nodes
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ContainerID | [bytes](#bytes) | | ContainerID of the container that has Extended ACL. | | ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the container that has Extended ACL. |
<a name="container.GetExtendedACLResponse"></a> <a name="container.GetExtendedACLResponse"></a>
@ -163,7 +163,7 @@ via consensus in inner ring nodes
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ContainerID | [bytes](#bytes) | | ContainerID of the container to get. | | ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the container to get. |
<a name="container.GetResponse"></a> <a name="container.GetResponse"></a>
@ -196,7 +196,7 @@ via consensus in inner ring nodes
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ContainerIDs | [bytes](#bytes) | repeated | ContainerIDs of containers that belong to the owner. | | ContainerIDs | [refs.ContainerID](#refs.ContainerID) | repeated | ContainerIDs carries list of identifiers of the containers that belong to the owner. |
<a name="container.PutRequest"></a> <a name="container.PutRequest"></a>
@ -220,7 +220,7 @@ via consensus in inner ring nodes
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ContainerID | [bytes](#bytes) | | ContainerID of the new container. | | ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the new container. |
<a name="container.SetExtendedACLRequest"></a> <a name="container.SetExtendedACLRequest"></a>

View file

@ -327,7 +327,7 @@ in distributed system.
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ContainerID | [bytes](#bytes) | | ContainerID for searching the object | | ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries search container identifier. |
| Query | [bytes](#bytes) | | Query in the binary serialized format | | Query | [bytes](#bytes) | | Query in the binary serialized format |
| QueryVersion | [uint32](#uint32) | | QueryVersion is a version of search query format | | QueryVersion | [uint32](#uint32) | | QueryVersion is a version of search query format |
| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) |

View file

@ -33,7 +33,7 @@ Address of object (container id + object id)
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ObjectID | [ObjectID](#refs.ObjectID) | | ObjectID carries object identifier. | | ObjectID | [ObjectID](#refs.ObjectID) | | ObjectID carries object identifier. |
| CID | [bytes](#bytes) | | CID is container identifier | | ContainerID | [ContainerID](#refs.ContainerID) | | ContainerID carries container identifier. |
<a name="refs.ContainerID"></a> <a name="refs.ContainerID"></a>

View file

@ -14,8 +14,8 @@ option (gogoproto.goproto_stringer_all) = false;
message Address { message Address {
// ObjectID carries object identifier. // ObjectID carries object identifier.
ObjectID ObjectID = 1; ObjectID ObjectID = 1;
// CID is container identifier // ContainerID carries container identifier.
bytes CID = 2[(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; ContainerID ContainerID = 2;
} }
// ObjectID groups information about the NeoFS object identifier. // ObjectID groups information about the NeoFS object identifier.