Move api-v2 files into v2 subdir

This subdir contains generated proto files
and small wrappers.
This commit is contained in:
Alex Vanin 2020-08-13 15:43:47 +03:00 committed by Stanislav Bogatyrev
parent 0ee1c3653d
commit 1f143e54bd
48 changed files with 213 additions and 255 deletions

View file

@ -1,21 +0,0 @@
package v2
func (m *RequestMetaHeader) StableMarshal(buf []byte) ([]byte, error) {
// fixme: implement stable
return m.Marshal()
}
func (m *RequestMetaHeader) StableSize() int {
// fixme: implement stable
return m.Size()
}
func (m *RequestVerificationHeader) StableMarshal(buf []byte) ([]byte, error) {
// fixme: implement stable
return m.Marshal()
}
func (m *RequestVerificationHeader) StableSize() int {
// fixme: implement stable
return m.Size()
}

View file

@ -1,17 +0,0 @@
package v2
func (m *RequestMetaHeader) ReadSignedData(buf []byte) ([]byte, error) {
return m.StableMarshal(buf)
}
func (m *RequestMetaHeader) SignedDataSize() int {
return m.StableSize()
}
func (m *RequestVerificationHeader) ReadSignedData(buf []byte) ([]byte, error) {
return m.StableMarshal(buf)
}
func (m *RequestVerificationHeader) SignedDataSize() int {
return m.StableSize()
}

View file

@ -1,8 +1,8 @@
package v2
package accounting
import (
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
service "github.com/nspcc-dev/neofs-api-go/service/v2"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
"github.com/nspcc-dev/neofs-api-go/v2/service"
)
// SetValue sets value of the decimal number.

View file

@ -1,13 +1,13 @@
syntax = "proto3";
package accounting.v2;
package neo.fs.v2.accounting;
option go_package = "github.com/nspcc-dev/neofs-api-go/accounting/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting";
option csharp_namespace = "NeoFS.API.Accounting";
import "refs/v2/types.proto";
import "service/v2/meta.proto";
import "service/v2/verify.proto";
import "v2/refs/types.proto";
import "v2/service/meta.proto";
import "v2/service/verify.proto";
// The service provides methods for obtaining information
// about the account balance in NeoFS system.
@ -27,7 +27,7 @@ message BalanceRequest {
message Body {
// Carries user identifier in NeoFS system for which the balance
// is requested.
refs.v2.OwnerID owner_id = 1;
neo.fs.v2.refs.OwnerID owner_id = 1;
}
// Body of the balance request message.
@ -35,12 +35,12 @@ message BalanceRequest {
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
// Decimal represents the decimal numbers.
@ -66,10 +66,10 @@ message BalanceResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}

View file

@ -1,7 +1,7 @@
package v2
package acl
import (
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
)
// SetContainerId sets container identifier of the eACL table.

View file

@ -1,18 +1,18 @@
syntax = "proto3";
package acl.v2;
package neo.fs.v2.acl;
option go_package = "github.com/nspcc-dev/neofs-api-go/acl/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/acl";
option csharp_namespace = "NeoFS.API.Acl";
import "refs/v2/types.proto";
import "v2/refs/types.proto";
// Target of the access control rule in access control list.
enum Target {
// Unknown target, default value.
UNKNOWN = 0;
// User target rule is applied if sender is the owner of the container.v2.
// User target rule is applied if sender is the owner of the container.
USER = 1;
// System target rule is applied if sender is the storage node within the
@ -85,7 +85,7 @@ message EACLRecord {
// TargetInfo groups information about extended ACL target.
message TargetInfo {
// target carries target of ACL rule.
acl.v2.Target target = 1 [json_name="Role"];
Target target = 1 [json_name="Role"];
// key_list carries public keys of ACL target.
repeated bytes key_list = 2 [json_name="Keys"];
@ -99,7 +99,7 @@ message EACLRecord {
message EACLTable {
// Carries identifier of the container that should use given
// access control rules.
refs.v2.ContainerID container_id = 1 [json_name="ContainerID"];
neo.fs.v2.refs.ContainerID container_id = 1 [json_name="ContainerID"];
// Records carries list of extended ACL rule records.
repeated EACLRecord records = 2 [json_name="Records"];

View file

@ -1,4 +1,4 @@
package v2
package container
import (
"encoding/binary"

View file

@ -1,10 +1,10 @@
package v2
package container
import (
"testing"
netmap "github.com/nspcc-dev/neofs-api-go/netmap/v2"
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
"github.com/nspcc-dev/neofs-api-go/v2/netmap"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
"github.com/stretchr/testify/require"
)

View file

@ -1,9 +1,9 @@
package v2
package container
import (
acl "github.com/nspcc-dev/neofs-api-go/acl/v2"
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
service "github.com/nspcc-dev/neofs-api-go/service/v2"
"github.com/nspcc-dev/neofs-api-go/v2/acl"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
"github.com/nspcc-dev/neofs-api-go/v2/service"
)
// SetContainer sets container of the request.

View file

@ -1,15 +1,15 @@
syntax = "proto3";
package container.v2;
package neo.fs.v2.container;
option go_package = "github.com/nspcc-dev/neofs-api-go/container/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container";
option csharp_namespace = "NeoFS.API.Container";
import "acl/v2/types.proto";
import "container/v2/types.proto";
import "refs/v2/types.proto";
import "service/v2/meta.proto";
import "service/v2/verify.proto";
import "v2/acl/types.proto";
import "v2/container/types.proto";
import "v2/refs/types.proto";
import "v2/service/meta.proto";
import "v2/service/verify.proto";
// Service provides API to access container smart-contract in morph chain
// via NeoFS node.
@ -46,7 +46,7 @@ service Service {
message PutRequest {
message Body {
// Container to create in NeoFS.
container.v2.Container container = 1;
neo.fs.v2.container.Container container = 1;
// Public Key of container owner. It can be public key of the owner
// or it can be public key that bound in neofs.id smart-contract.
@ -61,18 +61,18 @@ message PutRequest {
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message PutResponse {
message Body {
// container_id carries identifier of the new container.v2.
refs.v2.ContainerID container_id = 1;
// container_id carries identifier of the new container.
neo.fs.v2.refs.ContainerID container_id = 1;
}
// Body of container put response message.
@ -80,19 +80,19 @@ message PutResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
message DeleteRequest {
message Body {
// container_id carries identifier of the container to delete
// from NeoFS.
refs.v2.ContainerID container_id = 1;
neo.fs.v2.refs.ContainerID container_id = 1;
// Signature of container id according to RFC-6979.
bytes signature = 2;
@ -103,12 +103,12 @@ message DeleteRequest {
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
// DeleteResponse is empty because delete operation is asynchronous and done
@ -121,18 +121,18 @@ message DeleteResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
message GetRequest {
message Body {
// container_id carries identifier of the container to get.
refs.v2.ContainerID container_id = 1;
neo.fs.v2.refs.ContainerID container_id = 1;
}
// Body of container get request message.
@ -140,18 +140,18 @@ message GetRequest {
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message GetResponse {
message Body {
// Container that has been requested.
container.v2.Container container = 1;
neo.fs.v2.container.Container container = 1;
}
// Body of container get response message.
@ -159,18 +159,18 @@ message GetResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
message ListRequest {
message Body {
// owner_id carries identifier of the container owner.
refs.v2.OwnerID owner_id = 1;
neo.fs.v2.refs.OwnerID owner_id = 1;
}
// Body of list containers request message.
@ -178,18 +178,18 @@ message ListRequest {
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message ListResponse {
message Body {
// ContainerIDs carries list of identifiers of the containers that belong to the owner.
repeated refs.v2.ContainerID container_ids = 1;
repeated refs.ContainerID container_ids = 1;
}
// Body of list containers response message.
@ -197,18 +197,18 @@ message ListResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
message SetExtendedACLRequest {
message Body {
// Extended ACL to set for the container.v2.
acl.v2.EACLTable eacl = 1;
// Extended ACL to set for the container.
neo.fs.v2.acl.EACLTable eacl = 1;
// Signature of stable-marshalled Extended ACL according to RFC-6979.
bytes signature = 2;
@ -219,12 +219,12 @@ message SetExtendedACLRequest {
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message SetExtendedACLResponse {
@ -235,18 +235,18 @@ message SetExtendedACLResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
message GetExtendedACLRequest {
message Body {
// container_id carries identifier of the container that has Extended ACL.
refs.v2.ContainerID container_id = 1;
neo.fs.v2.refs.ContainerID container_id = 1;
}
// Body of get extended acl request message.
@ -254,18 +254,18 @@ message GetExtendedACLRequest {
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message GetExtendedACLResponse {
message Body {
// Extended ACL that has been requested if it was set up.
acl.v2.EACLTable eacl = 1;
neo.fs.v2.acl.EACLTable eacl = 1;
// Signature of stable-marshalled Extended ACL according to RFC-6979.
bytes signature = 2;
@ -276,10 +276,10 @@ message GetExtendedACLResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}

View file

@ -1,4 +1,4 @@
package v2
package container
func (m *Container) ReadSignedData(buf []byte) ([]byte, error) {
return m.StableMarshal(buf)

View file

@ -1,8 +1,8 @@
package v2
package container
import (
netmap "github.com/nspcc-dev/neofs-api-go/netmap/v2"
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
"github.com/nspcc-dev/neofs-api-go/v2/netmap"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
)
// SetKey sets key to the container attribute.

View file

@ -1,12 +1,12 @@
syntax = "proto3";
package container.v2;
package neo.fs.v2.container;
option go_package = "github.com/nspcc-dev/neofs-api-go/container/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container";
option csharp_namespace = "NeoFS.API.Container";
import "netmap/v2/types.proto";
import "refs/v2/types.proto";
import "v2/netmap/types.proto";
import "v2/refs/types.proto";
// Container is a structure that defines object placement behaviour. Objects
// can be stored only within containers. They define placement rule, attributes
@ -14,7 +14,7 @@ import "refs/v2/types.proto";
// SHA256 hash of stable-marshalled container message.
message Container {
// OwnerID carries identifier of the container owner.
refs.v2.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;
@ -32,9 +32,9 @@ message Container {
string value = 2;
}
// Attributes define any immutable characteristics of container.v2.
// Attributes define any immutable characteristics of container.
repeated Attribute attributes = 4;
// Rules define storage policy for the object inside the container.v2.
netmap.v2.PlacementRule rules = 5;
// Rules define storage policy for the object inside the container.
neo.fs.v2.netmap.PlacementRule rules = 5;
}

View file

@ -1,4 +1,4 @@
package v2
package netmap
import (
"encoding/binary"

View file

@ -1,4 +1,4 @@
package v2
package netmap
// SetOp sets operation of the simple filter.
func (m *PlacementRule_SFGroup_Filter_SimpleFilter) SetOp(v PlacementRule_SFGroup_Filter_SimpleFilter_Operation) {

View file

@ -1,8 +1,8 @@
syntax = "proto3";
package netmap.v2;
package neo.fs.v2.netmap;
option go_package = "github.com/nspcc-dev/neofs-api-go/netmap/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap";
option csharp_namespace = "NeoFS.API.Netmap";
message PlacementRule {

View file

@ -1,8 +1,8 @@
package v2
package object
import (
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
service "github.com/nspcc-dev/neofs-api-go/service/v2"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
"github.com/nspcc-dev/neofs-api-go/v2/service"
)
// SetAddress sets address of the requested object.

View file

@ -1,25 +1,25 @@
syntax = "proto3";
package object.v2;
package neo.fs.v2.object;
option go_package = "github.com/nspcc-dev/neofs-api-go/object/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object";
option csharp_namespace = "NeoFS.API.Object";
import "object/v2/types.proto";
import "refs/v2/types.proto";
import "service/v2/meta.proto";
import "service/v2/verify.proto";
import "v2/object/types.proto";
import "v2/refs/types.proto";
import "v2/service/meta.proto";
import "v2/service/verify.proto";
// Object service provides API for manipulating with the object.v2.
// Object service provides API for manipulating with the object.
service Service {
// Get the object from container.v2. Response uses gRPC stream. First response
// Get the object from container. Response uses gRPC stream. First response
// message carry object of requested address. Chunk messages are parts of
// the object's payload if it is needed. All messages except first carry
// chunks. Requested object can be restored by concatenation of object
// message payload and all chunks keeping receiving order.
rpc Get(GetRequest) returns (stream GetResponse);
// Put the object into container.v2. Request uses gRPC stream. First message
// Put the object into container. Request uses gRPC stream. First message
// SHOULD BE type of PutHeader. Container id and Owner id of object SHOULD
// BE set. Session token SHOULD BE obtained before put operation (see
// session package). Chunk messages considered by server as part of object
@ -35,7 +35,7 @@ service Service {
// headers are also present.
rpc Head(HeadRequest) returns (HeadResponse);
// Search objects in container.v2. Version of query language format SHOULD BE
// Search objects in container. Version of query language format SHOULD BE
// set to 1. Search query represented in serialized format (see query
// package).
rpc Search(SearchRequest) returns (stream SearchResponse);
@ -54,8 +54,8 @@ service Service {
message GetRequest {
message Body {
// Address of the requested object.v2.
refs.v2.Address address = 1;
// Address of the requested object.
neo.fs.v2.refs.Address address = 1;
// Carries the raw option flag of the request.
// Raw request is sent to receive only the objects
@ -67,11 +67,11 @@ message GetRequest {
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message GetResponse {
@ -79,9 +79,9 @@ message GetResponse {
// Initialization parameters of the object got from NeoFS.
message Init {
// Object ID
refs.v2.ObjectID object_id = 1;
neo.fs.v2.refs.ObjectID object_id = 1;
// Object signature
service.v2.Signature signature =2;
neo.fs.v2.service.Signature signature =2;
// Object header.
Header header = 3;
}
@ -98,12 +98,12 @@ message GetResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
message PutRequest {
@ -111,9 +111,9 @@ message PutRequest {
// Groups initialization parameters of object placement in NeoFS.
message Init {
// Object ID, where available
refs.v2.ObjectID object_id = 1;
neo.fs.v2.refs.ObjectID object_id = 1;
// Object signature, were available
service.v2.Signature signature =2;
neo.fs.v2.service.Signature signature =2;
// Header of the object to save in the system.
Header header = 3;
// Number of the object copies to store within the RPC call.
@ -135,49 +135,49 @@ message PutRequest {
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message PutResponse {
message Body {
// Carries identifier of the saved object.v2.
// It is used to access an object in the container.v2.
refs.v2.ObjectID object_id = 1;
// Carries identifier of the saved object.
// It is used to access an object in the container.
neo.fs.v2.refs.ObjectID object_id = 1;
}
// Body of put object 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.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
message DeleteRequest {
message Body {
// Carries the address of the object to be deleted.
refs.v2.Address address = 1;
neo.fs.v2.refs.Address address = 1;
// Carries identifier the object owner.
refs.v2.OwnerID owner_id = 2;
neo.fs.v2.refs.OwnerID owner_id = 2;
}
// Body of delete object 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.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
// DeleteResponse is empty because we cannot guarantee permanent object removal
@ -190,18 +190,18 @@ message DeleteResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
message HeadRequest {
message Body {
// Address of the object with the requested header.
refs.v2.Address address = 1;
neo.fs.v2.refs.Address address = 1;
// Return only minimal header subset
bool main_only = 2;
// Carries the raw option flag of the request.
@ -214,22 +214,22 @@ message HeadRequest {
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message HeadResponse {
message Body {
message ShortHeader {
// Object format version.
service.v2.Version version = 1;
neo.fs.v2.service.Version version = 1;
// Epoch when the object was created
uint64 creation_epoch = 2;
// Object's owner
refs.v2.OwnerID owner_id = 3;
neo.fs.v2.refs.OwnerID owner_id = 3;
// Type of the object payload content
ObjectType object_type = 4;
// Size of payload in bytes.
@ -247,18 +247,18 @@ message HeadResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
message SearchRequest {
message Body {
// Carries search container identifier.
refs.v2.ContainerID container_id = 1;
neo.fs.v2.refs.ContainerID container_id = 1;
message Query {
uint32 version = 1;
@ -287,17 +287,17 @@ message SearchRequest {
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message SearchResponse {
message Body {
// Carries list of object identifiers that match the search query.
repeated refs.v2.ObjectID id_list = 1;
repeated neo.fs.v2.refs.ObjectID id_list = 1;
}
// Body of search object response message.
@ -305,12 +305,12 @@ message SearchResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
// Range groups the parameters of object payload range.
@ -325,7 +325,7 @@ message Range {
message GetRangeRequest {
message Body {
// Address carries address of the object that contains the requested payload range.
refs.v2.Address address = 1;
neo.fs.v2.refs.Address address = 1;
// Range carries the parameters of the requested payload range.
Range range = 2;
@ -336,11 +336,11 @@ message GetRangeRequest {
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message GetRangeResponse {
@ -354,18 +354,18 @@ message GetRangeResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}
message GetRangeHashRequest {
message Body {
// Carries address of the object that contains the requested payload range.
refs.v2.Address address = 1;
neo.fs.v2.refs.Address address = 1;
// Carries the list of object payload range to calculate homomorphic hash.
repeated Range ranges = 2;
@ -379,11 +379,11 @@ message GetRangeHashRequest {
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
message GetRangeHashResponse {
@ -397,11 +397,11 @@ message GetRangeHashResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}

View file

@ -1,8 +1,8 @@
package v2
package object
import (
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
service "github.com/nspcc-dev/neofs-api-go/service/v2"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
"github.com/nspcc-dev/neofs-api-go/v2/service"
)
// SetKey sets key to the object attribute.

View file

@ -1,13 +1,13 @@
syntax = "proto3";
package object.v2;
package neo.fs.v2.object;
option go_package = "github.com/nspcc-dev/neofs-api-go/object/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object";
option csharp_namespace = "NeoFS.API.Object";
import "refs/v2/types.proto";
import "service/v2/meta.proto";
import "service/v2/verify.proto";
import "v2/refs/types.proto";
import "v2/service/meta.proto";
import "v2/service/verify.proto";
// Type of the object payload content
enum ObjectType {
@ -21,14 +21,14 @@ enum ObjectType {
message Header {
// Object's container
refs.v2.ContainerID container_id = 1;
neo.fs.v2.refs.ContainerID container_id = 1;
// Object's owner
refs.v2.OwnerID owner_id = 2;
neo.fs.v2.refs.OwnerID owner_id = 2;
// Epoch when the object was created
uint64 creation_epoch = 3;
// Object format version.
// Effectively the version of API library used to create particular object
service.v2.Version version = 4;
neo.fs.v2.service.Version version = 4;
// Size of payload in bytes.
// 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown
uint64 payload_length = 5;
@ -39,7 +39,7 @@ message Header {
bytes homomorphic_hash = 8;
// Session token, if it was used during Object creation.
// Need it to verify integrity and authenticity out of Request scope.
service.v2.SessionToken session_token = 9;
neo.fs.v2.service.SessionToken session_token = 9;
// Attribute groups the user-defined Key-Value pairs attached to the object
message Attribute {
@ -52,18 +52,18 @@ message Header {
// Information about spawning the objects through a payload splitting.
message Split {
// Identifier of the origin object.v2.
// Parent and children objects must be within the same container.v2.
// Identifier of the origin object.
// Parent and children objects must be within the same container.
// Parent object_id is known only to the minor child.
refs.v2.ObjectID parent = 1;
neo.fs.v2.refs.ObjectID parent = 1;
// Previous carries identifier of the left split neighbor.
refs.v2.ObjectID previous = 2;
// `signature` field of the parent object.v2. Used to reconstruct parent.
service.v2.Signature parent_signature = 3;
// `header` field of the parent object.v2. Used to reconstruct parent.
neo.fs.v2.refs.ObjectID previous = 2;
// `signature` field of the parent object. Used to reconstruct parent.
neo.fs.v2.service.Signature parent_signature = 3;
// `header` field of the parent object. Used to reconstruct parent.
Header parent_header = 4;
// Children carries list of identifiers of the objects generated by splitting the current.
repeated refs.v2.ObjectID children = 5;
repeated neo.fs.v2.refs.ObjectID children = 5;
}
// Position of the object in the split hierarchy.
Split split = 11;
@ -75,9 +75,9 @@ message Object {
// Object is content-addressed. It means id will change if header or payload
// changes. It's calculated as a hash of header field, which contains hash of
// object's payload
refs.v2.ObjectID object_id = 1;
neo.fs.v2.refs.ObjectID object_id = 1;
// Signed object_id
service.v2.Signature signature = 2;
neo.fs.v2.service.Signature signature = 2;
// Object metadata headers
Header header = 3;
// Payload bytes.

View file

@ -1,4 +1,4 @@
package v2
package refs
import (
"encoding/binary"

View file

@ -1,4 +1,4 @@
package v2
package refs
import (
"crypto/rand"

View file

@ -1,4 +1,4 @@
package v2
package refs
// SetValue sets container identifier in a binary format.
func (m *ContainerID) SetValue(v []byte) {

View file

@ -1,8 +1,8 @@
syntax = "proto3";
package refs.v2;
package neo.fs.v2.refs;
option go_package = "github.com/nspcc-dev/neofs-api-go/refs/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/refs";
option csharp_namespace = "NeoFS.API.Refs";
// Address of object (container id + object id)
@ -25,7 +25,7 @@ message ContainerID {
bytes value = 1;
}
// OwnerID group information about the owner of the NeoFS container.v2.
// OwnerID group information about the owner of the NeoFS container.
message OwnerID {
// value carries the identifier of the container owner in a binary format.
bytes value = 1;

View file

@ -1,8 +1,8 @@
package v2
package service
import (
acl "github.com/nspcc-dev/neofs-api-go/acl/v2"
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
"github.com/nspcc-dev/neofs-api-go/v2/acl"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
)
// SetKey sets key to the X-Header.

View file

@ -1,13 +1,13 @@
syntax = "proto3";
package service.v2;
package neo.fs.v2.service;
option go_package = "github.com/nspcc-dev/neofs-api-go/service/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service";
option csharp_namespace = "NeoFS.API.Service";
import "acl/v2/types.proto";
import "refs/v2/types.proto";
import "service/v2/verify.proto";
import "v2/acl/types.proto";
import "v2/refs/types.proto";
import "v2/service/verify.proto";
message XHeader {
// Key of the X-Header.
@ -40,7 +40,7 @@ message SessionToken {
// ID is a token identifier. valid UUIDv4 represented in bytes
bytes id = 1;
// OwnerID carries identifier of the session initiator.
refs.v2.OwnerID owner_id = 2;
neo.fs.v2.refs.OwnerID owner_id = 2;
// Verb is an enumeration of session request types
enum Verb {
// Refers to object.Put RPC call
@ -67,7 +67,7 @@ message SessionToken {
// Carries context of the session.
oneof context {
// object_address represents the object session context.
refs.v2.Address object_address = 6;
neo.fs.v2.refs.Address object_address = 6;
}
}
// Session Token body
@ -81,9 +81,9 @@ message SessionToken {
message BearerToken {
message Body {
// EACLTable carries table of extended ACL rules
acl.v2.EACLTable eacl_table = 1;
neo.fs.v2.acl.EACLTable eacl_table = 1;
// OwnerID carries identifier of the token owner
refs.v2.OwnerID owner_id = 2;
neo.fs.v2.refs.OwnerID owner_id = 2;
// Token expiration and valid time period parameters
TokenLifetime lifetime = 3;
}

View file

@ -1,4 +1,4 @@
package v2
package service
// SetKey sets public key in a binary format.
func (m *Signature) SetKey(v []byte) {

View file

@ -1,13 +1,10 @@
syntax = "proto3";
package service.v2;
package neo.fs.v2.service;
option go_package = "github.com/nspcc-dev/neofs-api-go/service/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service";
option csharp_namespace = "NeoFS.API.Service";
import "acl/v2/types.proto";
import "refs/v2/types.proto";
// Signature of something in NeoFS
message Signature {
// Public key used for signing.

View file

@ -1,8 +1,8 @@
package v2
package session
import (
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
service "github.com/nspcc-dev/neofs-api-go/service/v2"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
"github.com/nspcc-dev/neofs-api-go/v2/service"
)
// SetOwnerId sets identifier of the session initiator.

View file

@ -1,27 +1,26 @@
syntax = "proto3";
package session.v2;
option go_package = "github.com/nspcc-dev/neofs-api-go/session/v2";
package neo.fs.v2.session;
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session";
option csharp_namespace = "NeoFS.API.Session";
import "refs/v2/types.proto";
import "service/v2/meta.proto";
import "service/v2/verify.proto";
import "v2/refs/types.proto";
import "v2/service/meta.proto";
import "v2/service/verify.proto";
service Session {
// Create opens new session between the client and the server.
rpc Create (CreateRequest) returns (CreateResponse);
}
// CreateRequest carries an information necessary for opening a session.v2.
// CreateRequest carries an information necessary for opening a session.
message CreateRequest {
message Body {
// Carries an identifier of a session initiator.
refs.v2.OwnerID owner_id = 1;
neo.fs.v2.refs.OwnerID owner_id = 1;
// Carries a lifetime of the session.v2.
service.v2.TokenLifetime lifetime = 2;
// Carries a lifetime of the session.
neo.fs.v2.service.TokenLifetime lifetime = 2;
}
// Body of create session token request message.
@ -29,14 +28,14 @@ message CreateRequest {
// Carries request meta information. Header data is used only to regulate message
// transport and does not affect request execution.
service.v2.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.v2.RequestVerificationHeader verify_header = 3;
neo.fs.v2.service.RequestVerificationHeader verify_header = 3;
}
// CreateResponse carries an information about the opened session.v2.
// CreateResponse carries an information about the opened session.
message CreateResponse {
message Body {
// id carries an identifier of session token.
@ -51,10 +50,10 @@ message CreateResponse {
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
service.v2.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.v2.ResponseVerificationHeader verify_header = 3;
neo.fs.v2.service.ResponseVerificationHeader verify_header = 3;
}

View file

@ -1,7 +1,7 @@
package v2
package storagegroup
import (
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
"github.com/nspcc-dev/neofs-api-go/v2/refs"
)
// SetValidationDataSize sets the total size of the payloads of the storage group.

View file

@ -1,11 +1,11 @@
syntax = "proto3";
package storagegroup.v2;
package neo.fs.v2.storagegroup;
option go_package = "github.com/nspcc-dev/neofs-api-go/storagegroup/v2";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/storagegroup";
option csharp_namespace = "NeoFS.API.StorageGroup";
import "refs/v2/types.proto";
import "v2/refs/types.proto";
// StorageGroup groups the information about the NeoFS storage group.
// The storage group consists of objects from single container.
@ -26,5 +26,5 @@ message StorageGroup {
// Members carries the list of identifiers of the object storage group members.
// The list is strictly ordered.
repeated refs.v2.ObjectID members = 4;
repeated neo.fs.v2.refs.ObjectID members = 4;
}