[#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 csharp_namespace = "NeoFS.API.Acl";
import "refs/types.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true;
@ -101,8 +102,8 @@ message EACLRecord {
// EACLRecord carries the information about extended ACL rules.
message EACLTable {
// ContainerID of the container that should use given access control rules.
bytes ContainerID = 1 [json_name="ContainerID"];
// Carries identifier of the container that should use given access control rules.
refs.ContainerID ContainerID = 1 [json_name="ContainerID"];
// Records carries list of extended ACL rule 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 "container/types.proto";
import "refs/types.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true;
@ -52,13 +53,13 @@ message PutRequest {
}
message PutResponse {
// ContainerID of the new container.
bytes ContainerID = 1;
// ContainerID carries identifier of the new container.
refs.ContainerID ContainerID = 1;
}
message DeleteRequest {
// ContainerID of container to delete from NeoFS.
bytes ContainerID = 1;
// ContainerID carries identifier of the container to delete from NeoFS.
refs.ContainerID ContainerID = 1;
// Signature of container id according to RFC-6979.
bytes Signature = 2;
}
@ -69,8 +70,8 @@ message DeleteResponse { }
message GetRequest {
// ContainerID of the container to get.
bytes ContainerID = 1;
// ContainerID carries identifier of the container to get.
refs.ContainerID ContainerID = 1;
}
message GetResponse {
@ -84,8 +85,8 @@ message ListRequest {
}
message ListResponse {
// ContainerIDs of containers that belong to the owner.
repeated bytes ContainerIDs = 1;
// ContainerIDs carries list of identifiers of the containers that belong to the owner.
repeated refs.ContainerID ContainerIDs = 1;
}
message SetExtendedACLRequest {
@ -98,8 +99,8 @@ message SetExtendedACLRequest {
message SetExtendedACLResponse {}
message GetExtendedACLRequest {
// ContainerID of the container that has Extended ACL.
bytes ContainerID = 1;
// ContainerID carries identifier of the container that has Extended ACL.
refs.ContainerID ContainerID = 1;
}
message GetExtendedACLResponse {

View file

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

View file

@ -120,7 +120,7 @@ smart-contract storage.
| 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. |
@ -140,7 +140,7 @@ via consensus in inner ring nodes
| 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>
@ -163,7 +163,7 @@ via consensus in inner ring nodes
| 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>
@ -196,7 +196,7 @@ via consensus in inner ring nodes
| 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>
@ -220,7 +220,7 @@ via consensus in inner ring nodes
| 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>

View file

@ -327,7 +327,7 @@ in distributed system.
| 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 |
| 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) |

View file

@ -33,7 +33,7 @@ Address of object (container id + object id)
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| 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>

View file

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