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 1479 additions and 1515 deletions

View file

@ -1,585 +0,0 @@
package v2
import (
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
service "github.com/nspcc-dev/neofs-api-go/service/v2"
)
// SetAddress sets address of the requested object.
func (m *GetRequest_Body) SetAddress(v *refs.Address) {
if m != nil {
m.Address = v
}
}
// SetRaw sets raw flag of the request.
func (m *GetRequest_Body) SetRaw(v bool) {
if m != nil {
m.Raw = v
}
}
// SetBody sets body of the request.
func (m *GetRequest) SetBody(v *GetRequest_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the request.
func (m *GetRequest) SetMetaHeader(v *service.RequestMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the request.
func (m *GetRequest) SetVerifyHeader(v *service.RequestVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetObjectId sets identifier of the object.
func (m *GetResponse_Body_Init) SetObjectId(v *refs.ObjectID) {
if m != nil {
m.ObjectId = v
}
}
// SetSignature sets signature of the object identifier.
func (m *GetResponse_Body_Init) SetSignature(v *service.Signature) {
if m != nil {
m.Signature = v
}
}
// SetHeader sets header of the object.
func (m *GetResponse_Body_Init) SetHeader(v *Header) {
if m != nil {
m.Header = v
}
}
// SetInit sets initial part of the object.
func (m *GetResponse_Body) SetInit(v *GetResponse_Body_Init) {
if m != nil {
m.ObjectPart = &GetResponse_Body_Init_{
Init: v,
}
}
}
// SetChunk sets chunk of the object payload bytes.
func (m *GetResponse_Body) SetChunk(v []byte) {
if m != nil {
m.ObjectPart = &GetResponse_Body_Chunk{
Chunk: v,
}
}
}
// SetBody sets body of the response.
func (m *GetResponse) SetBody(v *GetResponse_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the response.
func (m *GetResponse) SetMetaHeader(v *service.ResponseMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the response.
func (m *GetResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetObjectId sets identifier of the object.
func (m *PutRequest_Body_Init) SetObjectId(v *refs.ObjectID) {
if m != nil {
m.ObjectId = v
}
}
// SetSignature sets signature of the object identifier.
func (m *PutRequest_Body_Init) SetSignature(v *service.Signature) {
if m != nil {
m.Signature = v
}
}
// SetHeader sets header of the object.
func (m *PutRequest_Body_Init) SetHeader(v *Header) {
if m != nil {
m.Header = v
}
}
// SetCopiesNumber sets number of the copies to save.
func (m *PutRequest_Body_Init) SetCopiesNumber(v uint32) {
if m != nil {
m.CopiesNumber = v
}
}
// SetInit sets initial part of the object.
func (m *PutRequest_Body) SetInit(v *PutRequest_Body_Init) {
if m != nil {
m.ObjectPart = &PutRequest_Body_Init_{
Init: v,
}
}
}
// SetChunk sets chunk of the object paloyad bytes.
func (m *PutRequest_Body) SetChunk(v []byte) {
if m != nil {
m.ObjectPart = &PutRequest_Body_Chunk{
Chunk: v,
}
}
}
// SetBody sets body of the request.
func (m *PutRequest) SetBody(v *PutRequest_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the request.
func (m *PutRequest) SetMetaHeader(v *service.RequestMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the request.
func (m *PutRequest) SetVerifyHeader(v *service.RequestVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetObjectId sets identifier of the saved object.
func (m *PutResponse_Body) SetObjectId(v *refs.ObjectID) {
if m != nil {
m.ObjectId = v
}
}
// SetBody sets body of the response.
func (m *PutResponse) SetBody(v *PutResponse_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the response.
func (m *PutResponse) SetMetaHeader(v *service.ResponseMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the response.
func (m *PutResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetAddress sets address of the object to delete.
func (m *DeleteRequest_Body) SetAddress(v *refs.Address) {
if m != nil {
m.Address = v
}
}
// SetOwnerId sets identifier of the removing object owner.
func (m *DeleteRequest_Body) SetOwnerId(v *refs.OwnerID) {
if m != nil {
m.OwnerId = v
}
}
// SetBody sets body of the request.
func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the request.
func (m *DeleteRequest) SetMetaHeader(v *service.RequestMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the request.
func (m *DeleteRequest) SetVerifyHeader(v *service.RequestVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetBody sets body of the response.
func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the response.
func (m *DeleteResponse) SetMetaHeader(v *service.ResponseMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the response.
func (m *DeleteResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetOwnerId sets identifier of the object with the requested header.
func (m *HeadRequest_Body) SetOwnerId(v *refs.Address) {
if m != nil {
m.Address = v
}
}
// SetMainOnly sets flag to return the minimal header subset.
func (m *HeadRequest_Body) SetMainOnly(v bool) {
if m != nil {
m.MainOnly = v
}
}
// SetRaw sets raw flag of the request.
func (m *HeadRequest_Body) SetRaw(v bool) {
if m != nil {
m.Raw = v
}
}
// SetBody sets body of the request.
func (m *HeadRequest) SetBody(v *HeadRequest_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the request.
func (m *HeadRequest) SetMetaHeader(v *service.RequestMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the request.
func (m *HeadRequest) SetVerifyHeader(v *service.RequestVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetVersion sets version of the object format.
func (m *HeadResponse_Body_ShortHeader) SetVersion(v *service.Version) {
if m != nil {
m.Version = v
}
}
// SetCreationEpoch sets creation epoch number of the object.
func (m *HeadResponse_Body_ShortHeader) SetCreationEpoch(v uint64) {
if m != nil {
m.CreationEpoch = v
}
}
// SetOwnerId sets identifier of the object owner.
func (m *HeadResponse_Body_ShortHeader) SetOwnerId(v *refs.OwnerID) {
if m != nil {
m.OwnerId = v
}
}
// SetObjectType sets type of the object.
func (m *HeadResponse_Body_ShortHeader) SetObjectType(v ObjectType) {
if m != nil {
m.ObjectType = v
}
}
// SetPayloadLength sets length of the object payload.
func (m *HeadResponse_Body_ShortHeader) SetPayloadLength(v uint64) {
if m != nil {
m.PayloadLength = v
}
}
// SetHeader sets full header of the object.
func (m *HeadResponse_Body) SetHeader(v *Header) {
if m != nil {
m.Head = &HeadResponse_Body_Header{
Header: v,
}
}
}
// SetShortHeader sets short header of the object.
func (m *HeadResponse_Body) SetShortHeader(v *HeadResponse_Body_ShortHeader) {
if m != nil {
m.Head = &HeadResponse_Body_ShortHeader_{
ShortHeader: v,
}
}
}
// SetBody sets body of the response.
func (m *HeadResponse) SetBody(v *HeadResponse_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the response.
func (m *HeadResponse) SetMetaHeader(v *service.ResponseMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the response.
func (m *HeadResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetMatchType sets match type of the filter.
func (m *SearchRequest_Body_Query_Filter) SetMatchType(v SearchRequest_Body_Query_Filter_MatchType) {
if m != nil {
m.MatchType = v
}
}
// SetName sets name of the filtering header.
func (m *SearchRequest_Body_Query_Filter) SetName(v string) {
if m != nil {
m.Name = v
}
}
// SetValue sets value of the filtering header.
func (m *SearchRequest_Body_Query_Filter) SetValue(v string) {
if m != nil {
m.Value = v
}
}
// SetVersion sets version of the search query.
func (m *SearchRequest_Body_Query) SetVersion(v uint32) {
if m != nil {
m.Version = v
}
}
// SetFilters sets list of the query filters.
func (m *SearchRequest_Body_Query) SetFilters(v []*SearchRequest_Body_Query_Filter) {
if m != nil {
m.Filters = v
}
}
// SetRaw sets raw flag of the request.
func (m *SearchRequest_Body) SetContainerId(v *refs.ContainerID) {
if m != nil {
m.ContainerId = v
}
}
// SetQuery sets search query structure.
func (m *SearchRequest_Body) SetQuery(v *SearchRequest_Body_Query) {
if m != nil {
m.Query = v
}
}
// SetBody sets body of the request.
func (m *SearchRequest) SetBody(v *SearchRequest_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the request.
func (m *SearchRequest) SetMetaHeader(v *service.RequestMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the request.
func (m *SearchRequest) SetVerifyHeader(v *service.RequestVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetIdList sets list of the identifiers of the matched objects.
func (m *SearchResponse_Body) SetIdList(v []*refs.ObjectID) {
if m != nil {
m.IdList = v
}
}
// SetBody sets body of the response.
func (m *SearchResponse) SetBody(v *SearchResponse_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the response.
func (m *SearchResponse) SetMetaHeader(v *service.ResponseMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the response.
func (m *SearchResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetOffset sets offset of the payload range.
func (m *Range) SetOffset(v uint64) {
if m != nil {
m.Offset = v
}
}
// SetLength sets length of the payload range.
func (m *Range) SetLength(v uint64) {
if m != nil {
m.Length = v
}
}
// SetAddress sets address of the object with the request payload range.
func (m *GetRangeRequest_Body) SetAddress(v *refs.Address) {
if m != nil {
m.Address = v
}
}
// SetRange sets range of the object payload.
func (m *GetRangeRequest_Body) SetRange(v *Range) {
if m != nil {
m.Range = v
}
}
// SetBody sets body of the request.
func (m *GetRangeRequest) SetBody(v *GetRangeRequest_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the request.
func (m *GetRangeRequest) SetMetaHeader(v *service.RequestMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the request.
func (m *GetRangeRequest) SetVerifyHeader(v *service.RequestVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetChunk sets chunk of the object payload.
func (m *GetRangeResponse_Body) SetChunk(v []byte) {
if m != nil {
m.Chunk = v
}
}
// SetBody sets body of the response.
func (m *GetRangeResponse) SetBody(v *GetRangeResponse_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the response.
func (m *GetRangeResponse) SetMetaHeader(v *service.ResponseMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the response.
func (m *GetRangeResponse) SetVerifyHeader(v *service.ResponseVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}
// SetAddress sets address of the object with the request payload range.
func (m *GetRangeHashRequest_Body) SetAddress(v *refs.Address) {
if m != nil {
m.Address = v
}
}
// SetRanges sets list of the ranges of the object payload.
func (m *GetRangeHashRequest_Body) SetRanges(v []*Range) {
if m != nil {
m.Ranges = v
}
}
// SetSalt sets salt for the object payload ranges.
func (m *GetRangeHashRequest_Body) SetSalt(v []byte) {
if m != nil {
m.Salt = v
}
}
// SetBody sets body of the request.
func (m *GetRangeHashRequest) SetBody(v *GetRangeHashRequest_Body) {
if m != nil {
m.Body = v
}
}
// SetMetaHeader sets meta header of the request.
func (m *GetRangeHashRequest) SetMetaHeader(v *service.RequestMetaHeader) {
if m != nil {
m.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the request.
func (m *GetRangeHashRequest) SetVerifyHeader(v *service.RequestVerificationHeader) {
if m != nil {
m.VerifyHeader = v
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,407 +0,0 @@
syntax = "proto3";
package object.v2;
option go_package = "github.com/nspcc-dev/neofs-api-go/object/v2";
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";
// Object service provides API for manipulating with the object.v2.
service Service {
// Get the object from container.v2. 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
// 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
// payload. All messages except first SHOULD BE chunks. Chunk messages
// SHOULD BE sent in direct order of fragmentation.
rpc Put(stream PutRequest) returns (PutResponse);
// Delete the object from a container
rpc Delete(DeleteRequest) returns (DeleteResponse);
// Head returns the object without data payload. Object in the
// response has system header only. If full headers flag is set, extended
// headers are also present.
rpc Head(HeadRequest) returns (HeadResponse);
// Search objects in container.v2. 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);
// GetRange of data payload. Range is a pair (offset, length).
// Requested range can be restored by concatenation of all chunks
// keeping receiving order.
rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse);
// GetRangeHash returns homomorphic hash of object payload range after XOR
// operation. Ranges are set of pairs (offset, length). Hashes order in
// response corresponds to ranges order in request. Homomorphic hash is
// calculated for XORed data.
rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse);
}
message GetRequest {
message Body {
// Address of the requested object.v2.
refs.v2.Address address = 1;
// Carries the raw option flag of the request.
// Raw request is sent to receive only the objects
// that are physically stored on the server.
bool raw = 2;
}
// Body of get 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;
// 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;
}
message GetResponse {
message Body {
// Initialization parameters of the object got from NeoFS.
message Init {
// Object ID
refs.v2.ObjectID object_id = 1;
// Object signature
service.v2.Signature signature =2;
// Object header.
Header header = 3;
}
// Carries the single message of the response stream.
oneof object_part {
// Initialization parameters of the object stream.
Init init =1;
// Part of the object payload.
bytes chunk = 2;
}
}
// Body of get 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;
// 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;
}
message PutRequest {
message Body {
// Groups initialization parameters of object placement in NeoFS.
message Init {
// Object ID, where available
refs.v2.ObjectID object_id = 1;
// Object signature, were available
service.v2.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.
// Default zero value is processed according to the
// container placement rules.
uint32 copies_number = 4;
}
// Carries the single part of the query stream.
oneof object_part {
// Carries the initialization parameters of the object stream.
Init init = 1;
// Carries part of the object payload.
bytes chunk = 2;
}
}
// Body of put 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;
// 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;
}
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;
}
// 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;
// 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;
}
message DeleteRequest {
message Body {
// Carries the address of the object to be deleted.
refs.v2.Address address = 1;
// Carries identifier the object owner.
refs.v2.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;
// 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;
}
// DeleteResponse is empty because we cannot guarantee permanent object removal
// in distributed system.
message DeleteResponse {
message Body { }
// Body of delete 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;
// 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;
}
message HeadRequest {
message Body {
// Address of the object with the requested header.
refs.v2.Address address = 1;
// Return only minimal header subset
bool main_only = 2;
// Carries the raw option flag of the request.
// Raw request is sent to receive only the headers of the objects
// that are physically stored on the server.
bool raw = 3;
}
// Body of head 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;
// 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;
}
message HeadResponse {
message Body {
message ShortHeader {
// Object format version.
service.v2.Version version = 1;
// Epoch when the object was created
uint64 creation_epoch = 2;
// Object's owner
refs.v2.OwnerID owner_id = 3;
// Type of the object payload content
ObjectType object_type = 4;
// Size of payload in bytes.
// 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown
uint64 payload_length = 5;
}
// Carries the requested object header or it's part
oneof head{
Header header = 1;
ShortHeader short_header = 2;
}
}
// Body of head 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;
// 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;
}
message SearchRequest {
message Body {
// Carries search container identifier.
refs.v2.ContainerID container_id = 1;
message Query {
uint32 version = 1;
message Filter {
enum MatchType {
MATCH_UNKNOWN = 0;
STRING_EQUAL = 1;
}
MatchType match_type = 1;
string name = 2;
string value = 3;
}
repeated Filter filters = 2;
}
Query query = 2;
}
// Body of search 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;
// 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;
}
message SearchResponse {
message Body {
// Carries list of object identifiers that match the search query.
repeated refs.v2.ObjectID id_list = 1;
}
// Body of search 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;
// 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;
}
// Range groups the parameters of object payload range.
message Range {
// Carries the offset of the range from the object payload start.
uint64 offset = 1;
// Carries the length of the object payload range.
uint64 length = 2;
}
message GetRangeRequest {
message Body {
// Address carries address of the object that contains the requested payload range.
refs.v2.Address address = 1;
// Range carries the parameters of the requested payload range.
Range range = 2;
}
// Body of get range 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;
// 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;
}
message GetRangeResponse {
message Body {
// Carries part of the object payload.
bytes chunk = 1;
}
// Body of get range 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;
// 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;
}
message GetRangeHashRequest {
message Body {
// Carries address of the object that contains the requested payload range.
refs.v2.Address address = 1;
// Carries the list of object payload range to calculate homomorphic hash.
repeated Range ranges = 2;
// Carries binary salt to XOR object payload ranges before hash calculation.
bytes salt = 3;
}
// Body of get range hash 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;
// 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;
}
message GetRangeHashResponse {
message Body {
// Carries list of homomorphic hashes in a binary format.
repeated bytes hash_list = 1;
}
// Body of get range hash 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;
// 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;
}

View file

@ -1,160 +0,0 @@
package v2
import (
refs "github.com/nspcc-dev/neofs-api-go/refs/v2"
service "github.com/nspcc-dev/neofs-api-go/service/v2"
)
// SetKey sets key to the object attribute.
func (m *Header_Attribute) SetKey(v string) {
if m != nil {
m.Key = v
}
}
// SetValue sets value of the object attribute.
func (m *Header_Attribute) SetValue(v string) {
if m != nil {
m.Value = v
}
}
// SetParent sets identifier of the parent object.
func (m *Header_Split) SetParent(v *refs.ObjectID) {
if m != nil {
m.Parent = v
}
}
// SetPrevious sets identifier of the previous object in split-chain.
func (m *Header_Split) SetPrevious(v *refs.ObjectID) {
if m != nil {
m.Previous = v
}
}
// SetParentSignature sets signature of the parent object header.
func (m *Header_Split) SetParentSignature(v *service.Signature) {
if m != nil {
m.ParentSignature = v
}
}
// SetParentHeader sets parent header structure.
func (m *Header_Split) SetParentHeader(v *Header) {
if m != nil {
m.ParentHeader = v
}
}
// SetChildren sets list of the identifiers of the child objects.
func (m *Header_Split) SetChildren(v []*refs.ObjectID) {
if m != nil {
m.Children = v
}
}
// SetContainerId sets identifier of the container.
func (m *Header) SetContainerId(v *refs.ContainerID) {
if m != nil {
m.ContainerId = v
}
}
// SetOwnerId sets identifier of the object owner.
func (m *Header) SetOwnerId(v *refs.OwnerID) {
if m != nil {
m.OwnerId = v
}
}
// SetCreationEpoch sets creation epoch number.
func (m *Header) SetCreationEpoch(v uint64) {
if m != nil {
m.CreationEpoch = v
}
}
// SetVersion sets version of the object format.
func (m *Header) SetVersion(v *service.Version) {
if m != nil {
m.Version = v
}
}
// SetPayloadLength sets length of the object payload.
func (m *Header) SetPayloadLength(v uint64) {
if m != nil {
m.PayloadLength = v
}
}
// SetPayloadHash sets hash of the object payload.
func (m *Header) SetPayloadHash(v []byte) {
if m != nil {
m.PayloadHash = v
}
}
// SetObjectType sets type of the object.
func (m *Header) SetObjectType(v ObjectType) {
if m != nil {
m.ObjectType = v
}
}
// SetHomomorphicHash sets homomorphic hash of the object payload.
func (m *Header) SetHomomorphicHash(v []byte) {
if m != nil {
m.HomomorphicHash = v
}
}
// SetSessionToken sets session token.
func (m *Header) SetSessionToken(v *service.SessionToken) {
if m != nil {
m.SessionToken = v
}
}
// SetAttributes sets list of the object attributes.
func (m *Header) SetAttributes(v []*Header_Attribute) {
if m != nil {
m.Attributes = v
}
}
// SetSplit sets split header.
func (m *Header) SetSplit(v *Header_Split) {
if m != nil {
m.Split = v
}
}
// SetObjectId sets identifier of the object.
func (m *Object) SetObjectId(v *refs.ObjectID) {
if m != nil {
m.ObjectId = v
}
}
// SetSignature sets signature of the object identifier.
func (m *Object) SetSignature(v *service.Signature) {
if m != nil {
m.Signature = v
}
}
// SetHeader sets header of the object.
func (m *Object) SetHeader(v *Header) {
if m != nil {
m.Header = v
}
}
// SetPayload sets payload bytes of the object.
func (m *Object) SetPayload(v []byte) {
if m != nil {
m.Payload = v
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,85 +0,0 @@
syntax = "proto3";
package object.v2;
option go_package = "github.com/nspcc-dev/neofs-api-go/object/v2";
option csharp_namespace = "NeoFS.API.Object";
import "refs/v2/types.proto";
import "service/v2/meta.proto";
import "service/v2/verify.proto";
// Type of the object payload content
enum ObjectType {
// Just a normal object
REGULAR = 0;
// Used internally to identify deleted objects
TOMBSTONE = 1;
// Identifies that the object holds StorageGroup information
STORAGE_GROUP = 2;
}
message Header {
// Object's container
refs.v2.ContainerID container_id = 1;
// Object's owner
refs.v2.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;
// Size of payload in bytes.
// 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown
uint64 payload_length = 5;
// Hash of payload bytes
bytes payload_hash = 6;
ObjectType object_type = 7;
// Homomorphic hash of the object payload.
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;
// Attribute groups the user-defined Key-Value pairs attached to the object
message Attribute {
// string key to the object attribute
string key = 1;
// string value of the object attribute
string value = 2;
}
repeated Attribute attributes = 10;
// 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.
// Parent object_id is known only to the minor child.
refs.v2.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.
Header parent_header = 4;
// Children carries list of identifiers of the objects generated by splitting the current.
repeated refs.v2.ObjectID children = 5;
}
// Position of the object in the split hierarchy.
Split split = 11;
}
// Object structure.
message Object {
// Object's unique identifier.
// 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;
// Signed object_id
service.v2.Signature signature = 2;
// Object metadata headers
Header header = 3;
// Payload bytes.
bytes payload = 4;
}