forked from TrueCloudLab/frostfs-api-go
Add pre-release jindo branch
This commit is contained in:
parent
0a5d0ff1a2
commit
fabdd78d63
24 changed files with 33947 additions and 0 deletions
1494
accounting/v2/service.pb.go
Normal file
1494
accounting/v2/service.pb.go
Normal file
File diff suppressed because it is too large
Load diff
75
accounting/v2/service.proto
Normal file
75
accounting/v2/service.proto
Normal file
|
@ -0,0 +1,75 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package accounting.v2;
|
||||
|
||||
option go_package = "github.com/nspcc-dev/neofs-api-go/accounting/v2";
|
||||
option csharp_namespace = "NeoFS.API.Accounting";
|
||||
|
||||
import "refs/v2/types.proto";
|
||||
import "service/v2/meta.proto";
|
||||
import "service/v2/verify.proto";
|
||||
|
||||
// The service provides methods for obtaining information
|
||||
// about the account balance in NeoFS system.
|
||||
service Accounting {
|
||||
// Returns the amount of funds for the requested NeoFS account.
|
||||
rpc Balance (BalanceRequest) returns (BalanceResponse);
|
||||
}
|
||||
|
||||
// Message defines the request body of Balance method.
|
||||
//
|
||||
// To indicate the account for which the balance is requested, it's identifier
|
||||
// is used.
|
||||
//
|
||||
// To gain access to the requested information, the request body must be formed
|
||||
// according to the requirements from the system specification.
|
||||
message BalanceRequest {
|
||||
message Body {
|
||||
// Carries user identifier in NeoFS system for which the balance
|
||||
// is requested.
|
||||
refs.v2.OwnerID owner_id = 1;
|
||||
}
|
||||
|
||||
// Body of the balance 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;
|
||||
}
|
||||
|
||||
// Decimal represents the decimal numbers.
|
||||
message Decimal {
|
||||
// value carries number value.
|
||||
int64 value = 1;
|
||||
|
||||
// precision carries value precision.
|
||||
uint32 precision = 2;
|
||||
}
|
||||
|
||||
// Message defines the response body of Balance method.
|
||||
//
|
||||
// The amount of funds is calculated in decimal numbers.
|
||||
message BalanceResponse {
|
||||
message Body {
|
||||
// Carries the amount of funds on the account.
|
||||
Decimal balance = 1;
|
||||
}
|
||||
|
||||
// Body of the balance 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;
|
||||
}
|
1478
acl/v2/types.pb.go
Normal file
1478
acl/v2/types.pb.go
Normal file
File diff suppressed because it is too large
Load diff
106
acl/v2/types.proto
Normal file
106
acl/v2/types.proto
Normal file
|
@ -0,0 +1,106 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package acl.v2;
|
||||
|
||||
option go_package = "github.com/nspcc-dev/neofs-api-go/acl/v2";
|
||||
option csharp_namespace = "NeoFS.API.Acl";
|
||||
|
||||
import "refs/v2/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 = 1;
|
||||
|
||||
// System target rule is applied if sender is the storage node within the
|
||||
// container or inner ring node.
|
||||
SYSTEM = 2;
|
||||
|
||||
// Others target rule is applied if sender is not user or system target.
|
||||
OTHERS = 3;
|
||||
}
|
||||
|
||||
// EACLRecord groups information about extended ACL rule.
|
||||
message EACLRecord {
|
||||
// Operation is an enumeration of operation types.
|
||||
enum Operation {
|
||||
OPERATION_UNKNOWN = 0;
|
||||
GET = 1;
|
||||
HEAD = 2;
|
||||
PUT = 3;
|
||||
DELETE = 4;
|
||||
SEARCH = 5;
|
||||
GETRANGE = 6;
|
||||
GETRANGEHASH = 7;
|
||||
}
|
||||
|
||||
// Operation carries type of operation.
|
||||
Operation operation = 1 [json_name = "Operation"];
|
||||
|
||||
// Action is an enumeration of EACL actions.
|
||||
enum Action {
|
||||
ACTION_UNKNOWN = 0;
|
||||
ALLOW = 1;
|
||||
DENY = 2;
|
||||
}
|
||||
|
||||
// Action carries ACL target action.
|
||||
Action action = 2 [json_name = "Action"];
|
||||
|
||||
// FilterInfo groups information about filter.
|
||||
message FilterInfo {
|
||||
// Header is an enumeration of filtering header types.
|
||||
enum Header {
|
||||
HEADER_UNKNOWN = 0;
|
||||
REQUEST = 1;
|
||||
OBJECT = 2;
|
||||
}
|
||||
|
||||
// Header carries type of header.
|
||||
Header header = 1 [json_name = "HeaderType"];
|
||||
|
||||
// MatchType is an enumeration of match types.
|
||||
enum MatchType {
|
||||
MATCH_UNKNOWN = 0;
|
||||
STRING_EQUAL = 1;
|
||||
STRING_NOT_EQUAL = 2;
|
||||
}
|
||||
|
||||
// MatchType carries type of match.
|
||||
MatchType match_type = 2 [json_name = "MatchType"];
|
||||
|
||||
// header_name carries name of filtering header.
|
||||
string header_name = 3 [json_name="Name"];
|
||||
|
||||
// header_val carries value of filtering header.
|
||||
string header_val = 4 [json_name="Value"];
|
||||
}
|
||||
|
||||
// filters carries set of filters.
|
||||
repeated FilterInfo filters = 3 [json_name="Filters"];
|
||||
|
||||
// TargetInfo groups information about extended ACL target.
|
||||
message TargetInfo {
|
||||
// target carries target of ACL rule.
|
||||
acl.v2.Target target = 1 [json_name="Role"];
|
||||
|
||||
// key_list carries public keys of ACL target.
|
||||
repeated bytes key_list = 2 [json_name="Keys"];
|
||||
}
|
||||
|
||||
// targets carries information about extended ACL target list.
|
||||
repeated TargetInfo targets = 4 [json_name="Targets"];
|
||||
}
|
||||
|
||||
// EACLRecord carries the information about extended ACL rules.
|
||||
message EACLTable {
|
||||
// Carries identifier of the container that should use given
|
||||
// access control rules.
|
||||
refs.v2.ContainerID container_id = 1 [json_name="ContainerID"];
|
||||
|
||||
// Records carries list of extended ACL rule records.
|
||||
repeated EACLRecord records = 2 [json_name="Records"];
|
||||
}
|
6794
container/v2/service.pb.go
Normal file
6794
container/v2/service.pb.go
Normal file
File diff suppressed because it is too large
Load diff
285
container/v2/service.proto
Normal file
285
container/v2/service.proto
Normal file
|
@ -0,0 +1,285 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package container.v2;
|
||||
|
||||
option go_package = "github.com/nspcc-dev/neofs-api-go/container/v2";
|
||||
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";
|
||||
|
||||
// Service provides API to access container smart-contract in morph chain
|
||||
// via NeoFS node.
|
||||
service Service {
|
||||
// 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
|
||||
// added into smart-contract storage.
|
||||
rpc Put(PutRequest) returns (PutResponse);
|
||||
|
||||
// Delete invokes 'Delete' 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
|
||||
// removed from smart-contract storage.
|
||||
rpc Delete(DeleteRequest) returns (DeleteResponse);
|
||||
|
||||
// Get returns container from container smart-contract storage.
|
||||
rpc Get(GetRequest) returns (GetResponse);
|
||||
|
||||
// List returns all owner's containers from container smart-contract
|
||||
// storage.
|
||||
rpc List(ListRequest) returns (ListResponse);
|
||||
|
||||
// SetExtendedACL invokes 'SetEACL' method in container smart-contract and
|
||||
// returns response immediately. After new block in morph chain,
|
||||
// Extended ACL added into smart-contract storage.
|
||||
rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse);
|
||||
|
||||
// GetExtendedACL returns Extended ACL table and signature from container
|
||||
// smart-contract storage.
|
||||
rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse);
|
||||
}
|
||||
|
||||
message PutRequest {
|
||||
message Body {
|
||||
// Container to create in NeoFS.
|
||||
container.v2.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.
|
||||
bytes public_key = 2;
|
||||
|
||||
// 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.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 {
|
||||
// container_id carries identifier of the new container.v2.
|
||||
refs.v2.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.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 {
|
||||
// container_id carries identifier of the container to delete
|
||||
// from NeoFS.
|
||||
refs.v2.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.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 delete operation is asynchronous and done
|
||||
// via consensus in inner ring nodes
|
||||
message DeleteResponse {
|
||||
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.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 GetRequest {
|
||||
message Body {
|
||||
// container_id carries identifier of the container to get.
|
||||
refs.v2.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.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 {
|
||||
// Container that has been requested.
|
||||
container.v2.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.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 ListRequest {
|
||||
message Body {
|
||||
// owner_id carries identifier of the container owner.
|
||||
refs.v2.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.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 ListResponse {
|
||||
message Body {
|
||||
// ContainerIDs carries list of identifiers of the containers that belong to the owner.
|
||||
repeated refs.v2.ContainerID container_ids = 1;
|
||||
}
|
||||
|
||||
// Body of list containers 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 SetExtendedACLRequest {
|
||||
message Body {
|
||||
// Extended ACL to set for the container.v2.
|
||||
acl.v2.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.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 SetExtendedACLResponse {
|
||||
message Body { }
|
||||
|
||||
// Body of set 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.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 GetExtendedACLRequest {
|
||||
message Body {
|
||||
// container_id carries identifier of the container that has Extended ACL.
|
||||
refs.v2.ContainerID container_id = 1;
|
||||
}
|
||||
|
||||
// Body of get 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.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 GetExtendedACLResponse {
|
||||
message Body {
|
||||
// Extended ACL that has been requested if it was set up.
|
||||
acl.v2.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.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;
|
||||
}
|
808
container/v2/types.pb.go
Normal file
808
container/v2/types.pb.go
Normal file
|
@ -0,0 +1,808 @@
|
|||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: container/v2/types.proto
|
||||
|
||||
package v2
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
v21 "github.com/nspcc-dev/neofs-api-go/netmap/v2"
|
||||
v2 "github.com/nspcc-dev/neofs-api-go/refs/v2"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// Container is a structure that defines object placement behaviour. Objects
|
||||
// can be stored only within containers. They define placement rule, attributes
|
||||
// and access control information. ID of the container is a 32 byte long
|
||||
// SHA256 hash of stable-marshalled container message.
|
||||
type Container struct {
|
||||
// OwnerID carries identifier of the container owner.
|
||||
OwnerId *v2.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"`
|
||||
// Nonce is a 16 byte UUID, used to avoid collisions of container id.
|
||||
Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
|
||||
// BasicACL contains access control rules for owner, system, others groups and
|
||||
// permission bits for bearer token and Extended ACL.
|
||||
BasicAcl uint32 `protobuf:"varint,3,opt,name=basic_acl,json=basicAcl,proto3" json:"basic_acl,omitempty"`
|
||||
// Attributes define any immutable characteristics of container.v2.
|
||||
Attributes []*Container_Attribute `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty"`
|
||||
// Rules define storage policy for the object inside the container.v2.
|
||||
Rules *v21.PlacementRule `protobuf:"bytes,5,opt,name=rules,proto3" json:"rules,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Container) Reset() { *m = Container{} }
|
||||
func (m *Container) String() string { return proto.CompactTextString(m) }
|
||||
func (*Container) ProtoMessage() {}
|
||||
func (*Container) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_4fee8fa43abbe82f, []int{0}
|
||||
}
|
||||
func (m *Container) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Container) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Container.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *Container) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Container.Merge(m, src)
|
||||
}
|
||||
func (m *Container) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Container) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Container.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Container proto.InternalMessageInfo
|
||||
|
||||
func (m *Container) GetOwnerId() *v2.OwnerID {
|
||||
if m != nil {
|
||||
return m.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Container) GetNonce() []byte {
|
||||
if m != nil {
|
||||
return m.Nonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Container) GetBasicAcl() uint32 {
|
||||
if m != nil {
|
||||
return m.BasicAcl
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Container) GetAttributes() []*Container_Attribute {
|
||||
if m != nil {
|
||||
return m.Attributes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Container) GetRules() *v21.PlacementRule {
|
||||
if m != nil {
|
||||
return m.Rules
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Attribute is a key-value pair of strings.
|
||||
type Container_Attribute struct {
|
||||
// Key of immutable container attribute.
|
||||
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
// Value of immutable container attribute.
|
||||
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Container_Attribute) Reset() { *m = Container_Attribute{} }
|
||||
func (m *Container_Attribute) String() string { return proto.CompactTextString(m) }
|
||||
func (*Container_Attribute) ProtoMessage() {}
|
||||
func (*Container_Attribute) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_4fee8fa43abbe82f, []int{0, 0}
|
||||
}
|
||||
func (m *Container_Attribute) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Container_Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Container_Attribute.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *Container_Attribute) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Container_Attribute.Merge(m, src)
|
||||
}
|
||||
func (m *Container_Attribute) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Container_Attribute) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Container_Attribute.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Container_Attribute proto.InternalMessageInfo
|
||||
|
||||
func (m *Container_Attribute) GetKey() string {
|
||||
if m != nil {
|
||||
return m.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Container_Attribute) GetValue() string {
|
||||
if m != nil {
|
||||
return m.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Container)(nil), "container.v2.Container")
|
||||
proto.RegisterType((*Container_Attribute)(nil), "container.v2.Container.Attribute")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("container/v2/types.proto", fileDescriptor_4fee8fa43abbe82f) }
|
||||
|
||||
var fileDescriptor_4fee8fa43abbe82f = []byte{
|
||||
// 334 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x91, 0xd1, 0x4a, 0xc3, 0x30,
|
||||
0x18, 0x85, 0xed, 0xe6, 0x74, 0xcd, 0x26, 0x8c, 0x4c, 0x21, 0x4c, 0x28, 0xd5, 0xab, 0x82, 0x2c,
|
||||
0x85, 0xee, 0x09, 0xaa, 0x22, 0xec, 0x46, 0x47, 0x04, 0x2f, 0xbc, 0x19, 0x69, 0xf6, 0x6f, 0x16,
|
||||
0xbb, 0xa4, 0x34, 0x69, 0x65, 0xcf, 0xe1, 0x8d, 0xcf, 0xe0, 0x93, 0x78, 0xe9, 0x23, 0xc8, 0x7c,
|
||||
0x11, 0x69, 0xcb, 0xe6, 0xd8, 0x5d, 0xfe, 0xff, 0x9c, 0x13, 0xce, 0x97, 0x20, 0x22, 0x94, 0x34,
|
||||
0x3c, 0x96, 0x90, 0xf9, 0x45, 0xe0, 0x9b, 0x55, 0x0a, 0x9a, 0xa6, 0x99, 0x32, 0x0a, 0x77, 0xb7,
|
||||
0x0a, 0x2d, 0x82, 0xc1, 0x99, 0x04, 0xb3, 0xe4, 0xe9, 0x9e, 0x69, 0xd0, 0xcf, 0x60, 0xae, 0xf7,
|
||||
0x96, 0x97, 0xef, 0x0d, 0x64, 0xdf, 0x6c, 0xc2, 0xf8, 0x0a, 0xb5, 0xd5, 0x9b, 0x84, 0x6c, 0x1a,
|
||||
0xcf, 0x88, 0xe5, 0x5a, 0x5e, 0x27, 0xe8, 0xd1, 0x32, 0x45, 0x8b, 0x80, 0x3e, 0x94, 0xc2, 0xf8,
|
||||
0x96, 0x1d, 0x57, 0x8e, 0xf1, 0x0c, 0x9f, 0xa2, 0x96, 0x54, 0x52, 0x00, 0x69, 0xb8, 0x96, 0xd7,
|
||||
0x65, 0xf5, 0x80, 0xcf, 0x91, 0x1d, 0x71, 0x1d, 0x8b, 0x29, 0x17, 0x09, 0x69, 0xba, 0x96, 0x77,
|
||||
0xc2, 0xda, 0xd5, 0x22, 0x14, 0x09, 0x0e, 0x11, 0xe2, 0xc6, 0x64, 0x71, 0x94, 0x1b, 0xd0, 0xe4,
|
||||
0xd0, 0x6d, 0x7a, 0x9d, 0xe0, 0x82, 0xee, 0x96, 0xa7, 0xdb, 0x32, 0x34, 0xdc, 0x38, 0xd9, 0x4e,
|
||||
0x08, 0x53, 0xd4, 0xca, 0xf2, 0x04, 0x34, 0x69, 0x55, 0xfd, 0x08, 0xad, 0x61, 0xcb, 0xe8, 0x24,
|
||||
0xe1, 0x02, 0x96, 0x20, 0x0d, 0xcb, 0x13, 0x60, 0xb5, 0x6d, 0x30, 0x42, 0xf6, 0xf6, 0x22, 0xdc,
|
||||
0x43, 0xcd, 0x57, 0x58, 0x55, 0x68, 0x36, 0x2b, 0x8f, 0x25, 0x44, 0xc1, 0x93, 0xbc, 0x86, 0xb0,
|
||||
0x59, 0x3d, 0x5c, 0x3f, 0x7d, 0xad, 0x1d, 0xeb, 0x7b, 0xed, 0x58, 0x3f, 0x6b, 0xc7, 0xfa, 0xf8,
|
||||
0x75, 0x0e, 0x9e, 0xe9, 0x22, 0x36, 0x2f, 0x79, 0x44, 0x85, 0x5a, 0xfa, 0x52, 0xa7, 0x42, 0x0c,
|
||||
0x67, 0x50, 0xf8, 0x12, 0xd4, 0x5c, 0x0f, 0x79, 0x1a, 0x0f, 0x17, 0xca, 0xdf, 0xfd, 0x9d, 0xcf,
|
||||
0x46, 0xff, 0x1e, 0xd4, 0xdd, 0x23, 0x0d, 0x27, 0xe3, 0x7f, 0xa4, 0xe8, 0xa8, 0x7a, 0xf4, 0xd1,
|
||||
0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x16, 0x73, 0x26, 0x7e, 0xca, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Container) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Container) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Container) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if m.Rules != nil {
|
||||
{
|
||||
size, err := m.Rules.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTypes(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
if len(m.Attributes) > 0 {
|
||||
for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTypes(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
}
|
||||
if m.BasicAcl != 0 {
|
||||
i = encodeVarintTypes(dAtA, i, uint64(m.BasicAcl))
|
||||
i--
|
||||
dAtA[i] = 0x18
|
||||
}
|
||||
if len(m.Nonce) > 0 {
|
||||
i -= len(m.Nonce)
|
||||
copy(dAtA[i:], m.Nonce)
|
||||
i = encodeVarintTypes(dAtA, i, uint64(len(m.Nonce)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.OwnerId != nil {
|
||||
{
|
||||
size, err := m.OwnerId.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTypes(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Container_Attribute) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Container_Attribute) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Container_Attribute) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.Value) > 0 {
|
||||
i -= len(m.Value)
|
||||
copy(dAtA[i:], m.Value)
|
||||
i = encodeVarintTypes(dAtA, i, uint64(len(m.Value)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(m.Key) > 0 {
|
||||
i -= len(m.Key)
|
||||
copy(dAtA[i:], m.Key)
|
||||
i = encodeVarintTypes(dAtA, i, uint64(len(m.Key)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTypes(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
func (m *Container) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.OwnerId != nil {
|
||||
l = m.OwnerId.Size()
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
l = len(m.Nonce)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
if m.BasicAcl != 0 {
|
||||
n += 1 + sovTypes(uint64(m.BasicAcl))
|
||||
}
|
||||
if len(m.Attributes) > 0 {
|
||||
for _, e := range m.Attributes {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
}
|
||||
if m.Rules != nil {
|
||||
l = m.Rules.Size()
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
n += len(m.XXX_unrecognized)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Container_Attribute) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Key)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
l = len(m.Value)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
n += len(m.XXX_unrecognized)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTypes(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozTypes(x uint64) (n int) {
|
||||
return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *Container) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Container: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Container: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field OwnerId", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.OwnerId == nil {
|
||||
m.OwnerId = &v2.OwnerID{}
|
||||
}
|
||||
if err := m.OwnerId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Nonce = append(m.Nonce[:0], dAtA[iNdEx:postIndex]...)
|
||||
if m.Nonce == nil {
|
||||
m.Nonce = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field BasicAcl", wireType)
|
||||
}
|
||||
m.BasicAcl = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.BasicAcl |= uint32(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Attributes = append(m.Attributes, &Container_Attribute{})
|
||||
if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Rules == nil {
|
||||
m.Rules = &v21.PlacementRule{}
|
||||
}
|
||||
if err := m.Rules.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Container_Attribute) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Attribute: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Attribute: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Key = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Value = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTypes(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
wireType := int(wire & 0x7)
|
||||
switch wireType {
|
||||
case 0:
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx++
|
||||
if dAtA[iNdEx-1] < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
length |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if length < 0 {
|
||||
return 0, ErrInvalidLengthTypes
|
||||
}
|
||||
iNdEx += length
|
||||
case 3:
|
||||
depth++
|
||||
case 4:
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupTypes
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthTypes
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
40
container/v2/types.proto
Normal file
40
container/v2/types.proto
Normal file
|
@ -0,0 +1,40 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package container.v2;
|
||||
|
||||
option go_package = "github.com/nspcc-dev/neofs-api-go/container/v2";
|
||||
option csharp_namespace = "NeoFS.API.Container";
|
||||
|
||||
import "netmap/v2/types.proto";
|
||||
import "refs/v2/types.proto";
|
||||
|
||||
// Container is a structure that defines object placement behaviour. Objects
|
||||
// can be stored only within containers. They define placement rule, attributes
|
||||
// and access control information. ID of the container is a 32 byte long
|
||||
// SHA256 hash of stable-marshalled container message.
|
||||
message Container {
|
||||
// OwnerID carries identifier of the container owner.
|
||||
refs.v2.OwnerID owner_id = 1;
|
||||
|
||||
// Nonce is a 16 byte UUID, used to avoid collisions of container id.
|
||||
bytes nonce = 2;
|
||||
|
||||
// BasicACL contains access control rules for owner, system, others groups and
|
||||
// permission bits for bearer token and Extended ACL.
|
||||
uint32 basic_acl = 3;
|
||||
|
||||
// Attribute is a key-value pair of strings.
|
||||
message Attribute {
|
||||
// Key of immutable container attribute.
|
||||
string key = 1;
|
||||
|
||||
// Value of immutable container attribute.
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
// Attributes define any immutable characteristics of container.v2.
|
||||
repeated Attribute attributes = 4;
|
||||
|
||||
// Rules define storage policy for the object inside the container.v2.
|
||||
netmap.v2.PlacementRule rules = 5;
|
||||
}
|
2448
netmap/v2/types.pb.go
Normal file
2448
netmap/v2/types.pb.go
Normal file
File diff suppressed because it is too large
Load diff
92
netmap/v2/types.proto
Normal file
92
netmap/v2/types.proto
Normal file
|
@ -0,0 +1,92 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package netmap.v2;
|
||||
|
||||
option go_package = "github.com/nspcc-dev/neofs-api-go/netmap/v2";
|
||||
option csharp_namespace = "NeoFS.API.Netmap";
|
||||
|
||||
message PlacementRule {
|
||||
uint32 repl_factor = 1;
|
||||
|
||||
message SFGroup {
|
||||
message Filter {
|
||||
string key = 1;
|
||||
|
||||
message SimpleFilters {
|
||||
repeated SimpleFilter filters = 1;
|
||||
}
|
||||
|
||||
message SimpleFilter {
|
||||
enum Operation {
|
||||
NP = 0;
|
||||
EQ = 1;
|
||||
NE = 2;
|
||||
GT = 3;
|
||||
GE = 4;
|
||||
LT = 5;
|
||||
LE = 6;
|
||||
OR = 7;
|
||||
AND = 8;
|
||||
}
|
||||
|
||||
Operation op = 1;
|
||||
|
||||
oneof args {
|
||||
string value = 2;
|
||||
SimpleFilters f_args = 3;
|
||||
}
|
||||
}
|
||||
|
||||
SimpleFilter f = 2;
|
||||
}
|
||||
|
||||
repeated Filter filters = 1;
|
||||
|
||||
message Selector {
|
||||
uint32 count = 1;
|
||||
string key = 2;
|
||||
}
|
||||
|
||||
repeated Selector selectors = 2;
|
||||
|
||||
repeated uint32 exclude = 3;
|
||||
}
|
||||
|
||||
repeated SFGroup sf_groups = 2;
|
||||
}
|
||||
|
||||
// Groups the information about the NeoFS node.
|
||||
message NodeInfo {
|
||||
// Carries network address of the NeoFS node.
|
||||
string address = 1;
|
||||
|
||||
// Carries public key of the NeoFS node in a binary format.
|
||||
bytes public_key = 2;
|
||||
|
||||
// Groups attributes of the NeoFS node.
|
||||
message Attribute {
|
||||
// Carries string key to the node attribute.
|
||||
string key = 1;
|
||||
|
||||
// Carries string value of the node attribute.
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
// Carries list of the NeoFS node attributes in a string key-value format.
|
||||
repeated Attribute attributes = 3;
|
||||
|
||||
// Represents the enumeration of various states of the NeoFS node.
|
||||
enum State {
|
||||
// Undefined state.
|
||||
UNKNOWN = 0;
|
||||
|
||||
// Active state in the network.
|
||||
ONLINE = 1;
|
||||
|
||||
// Network unavailable state.
|
||||
OFFLINE = 2;
|
||||
}
|
||||
|
||||
// Carries state of the NeoFS node.
|
||||
State state = 4;
|
||||
}
|
10393
object/v2/service.pb.go
Normal file
10393
object/v2/service.pb.go
Normal file
File diff suppressed because it is too large
Load diff
407
object/v2/service.proto
Normal file
407
object/v2/service.proto
Normal file
|
@ -0,0 +1,407 @@
|
|||
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;
|
||||
}
|
||||
|
1986
object/v2/types.pb.go
Normal file
1986
object/v2/types.pb.go
Normal file
File diff suppressed because it is too large
Load diff
85
object/v2/types.proto
Normal file
85
object/v2/types.proto
Normal file
|
@ -0,0 +1,85 @@
|
|||
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;
|
||||
}
|
970
refs/v2/types.pb.go
Normal file
970
refs/v2/types.pb.go
Normal file
|
@ -0,0 +1,970 @@
|
|||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: refs/v2/types.proto
|
||||
|
||||
package v2
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// Address of object (container id + object id)
|
||||
type Address struct {
|
||||
// container_id carries container identifier.
|
||||
ContainerId *ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
|
||||
// object_id carries object identifier.
|
||||
ObjectId *ObjectID `protobuf:"bytes,2,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Address) Reset() { *m = Address{} }
|
||||
func (m *Address) String() string { return proto.CompactTextString(m) }
|
||||
func (*Address) ProtoMessage() {}
|
||||
func (*Address) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e9faa6bee2355acc, []int{0}
|
||||
}
|
||||
func (m *Address) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Address.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *Address) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Address.Merge(m, src)
|
||||
}
|
||||
func (m *Address) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Address) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Address.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Address proto.InternalMessageInfo
|
||||
|
||||
func (m *Address) GetContainerId() *ContainerID {
|
||||
if m != nil {
|
||||
return m.ContainerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Address) GetObjectId() *ObjectID {
|
||||
if m != nil {
|
||||
return m.ObjectId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NeoFS object identifier.
|
||||
type ObjectID struct {
|
||||
// value carries the object identifier in a binary format.
|
||||
Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ObjectID) Reset() { *m = ObjectID{} }
|
||||
func (m *ObjectID) String() string { return proto.CompactTextString(m) }
|
||||
func (*ObjectID) ProtoMessage() {}
|
||||
func (*ObjectID) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e9faa6bee2355acc, []int{1}
|
||||
}
|
||||
func (m *ObjectID) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *ObjectID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_ObjectID.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *ObjectID) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ObjectID.Merge(m, src)
|
||||
}
|
||||
func (m *ObjectID) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *ObjectID) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ObjectID.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ObjectID proto.InternalMessageInfo
|
||||
|
||||
func (m *ObjectID) GetValue() []byte {
|
||||
if m != nil {
|
||||
return m.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NeoFS container identifier.
|
||||
type ContainerID struct {
|
||||
// value carries the container identifier in a binary format.
|
||||
Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ContainerID) Reset() { *m = ContainerID{} }
|
||||
func (m *ContainerID) String() string { return proto.CompactTextString(m) }
|
||||
func (*ContainerID) ProtoMessage() {}
|
||||
func (*ContainerID) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e9faa6bee2355acc, []int{2}
|
||||
}
|
||||
func (m *ContainerID) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *ContainerID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_ContainerID.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *ContainerID) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ContainerID.Merge(m, src)
|
||||
}
|
||||
func (m *ContainerID) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *ContainerID) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ContainerID.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ContainerID proto.InternalMessageInfo
|
||||
|
||||
func (m *ContainerID) GetValue() []byte {
|
||||
if m != nil {
|
||||
return m.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// OwnerID group information about the owner of the NeoFS container.v2.
|
||||
type OwnerID struct {
|
||||
// value carries the identifier of the container owner in a binary format.
|
||||
Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *OwnerID) Reset() { *m = OwnerID{} }
|
||||
func (m *OwnerID) String() string { return proto.CompactTextString(m) }
|
||||
func (*OwnerID) ProtoMessage() {}
|
||||
func (*OwnerID) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e9faa6bee2355acc, []int{3}
|
||||
}
|
||||
func (m *OwnerID) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *OwnerID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_OwnerID.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *OwnerID) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_OwnerID.Merge(m, src)
|
||||
}
|
||||
func (m *OwnerID) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *OwnerID) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_OwnerID.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_OwnerID proto.InternalMessageInfo
|
||||
|
||||
func (m *OwnerID) GetValue() []byte {
|
||||
if m != nil {
|
||||
return m.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Address)(nil), "refs.v2.Address")
|
||||
proto.RegisterType((*ObjectID)(nil), "refs.v2.ObjectID")
|
||||
proto.RegisterType((*ContainerID)(nil), "refs.v2.ContainerID")
|
||||
proto.RegisterType((*OwnerID)(nil), "refs.v2.OwnerID")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("refs/v2/types.proto", fileDescriptor_e9faa6bee2355acc) }
|
||||
|
||||
var fileDescriptor_e9faa6bee2355acc = []byte{
|
||||
// 247 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2e, 0x4a, 0x4d, 0x2b,
|
||||
0xd6, 0x2f, 0x33, 0xd2, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
|
||||
0x62, 0x07, 0x09, 0xea, 0x95, 0x19, 0x29, 0x15, 0x71, 0xb1, 0x3b, 0xa6, 0xa4, 0x14, 0xa5, 0x16,
|
||||
0x17, 0x0b, 0x99, 0x73, 0xf1, 0x24, 0xe7, 0xe7, 0x95, 0x24, 0x66, 0xe6, 0xa5, 0x16, 0xc5, 0x67,
|
||||
0xa6, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x89, 0xe8, 0x41, 0x95, 0xea, 0x39, 0xc3, 0x24,
|
||||
0x3d, 0x5d, 0x82, 0xb8, 0xe1, 0x2a, 0x3d, 0x53, 0x84, 0xf4, 0xb8, 0x38, 0xf3, 0x93, 0xb2, 0x52,
|
||||
0x93, 0x4b, 0x40, 0xba, 0x98, 0xc0, 0xba, 0x04, 0xe1, 0xba, 0xfc, 0xc1, 0x32, 0x9e, 0x2e, 0x41,
|
||||
0x1c, 0x10, 0x35, 0x9e, 0x29, 0x4a, 0x0a, 0x5c, 0x1c, 0x30, 0x51, 0x21, 0x11, 0x2e, 0xd6, 0xb2,
|
||||
0xc4, 0x9c, 0xd2, 0x54, 0xb0, 0x6d, 0x3c, 0x41, 0x10, 0x8e, 0x92, 0x32, 0x17, 0x37, 0x92, 0x6d,
|
||||
0x38, 0x14, 0xc9, 0x73, 0xb1, 0xfb, 0x97, 0xe3, 0x51, 0xe0, 0xe4, 0x73, 0xe2, 0x91, 0x1c, 0xe3,
|
||||
0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xce, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x99, 0x9e,
|
||||
0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x57, 0x5c, 0x90, 0x9c, 0xac, 0x9b,
|
||||
0x92, 0x5a, 0xa6, 0x9f, 0x97, 0x9a, 0x9f, 0x56, 0xac, 0x9b, 0x58, 0x90, 0xa9, 0x9b, 0x9e, 0xaf,
|
||||
0x0f, 0x0d, 0xad, 0x55, 0x4c, 0x7c, 0x7e, 0xa9, 0xf9, 0x6e, 0xc1, 0x7a, 0x8e, 0x01, 0x9e, 0x7a,
|
||||
0x41, 0xa9, 0x69, 0xc5, 0x49, 0x6c, 0xe0, 0x90, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd2,
|
||||
0xd4, 0x5b, 0x91, 0x50, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Address) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Address) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Address) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if m.ObjectId != nil {
|
||||
{
|
||||
size, err := m.ObjectId.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTypes(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.ContainerId != nil {
|
||||
{
|
||||
size, err := m.ContainerId.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTypes(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *ObjectID) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *ObjectID) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *ObjectID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.Value) > 0 {
|
||||
i -= len(m.Value)
|
||||
copy(dAtA[i:], m.Value)
|
||||
i = encodeVarintTypes(dAtA, i, uint64(len(m.Value)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *ContainerID) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *ContainerID) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *ContainerID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.Value) > 0 {
|
||||
i -= len(m.Value)
|
||||
copy(dAtA[i:], m.Value)
|
||||
i = encodeVarintTypes(dAtA, i, uint64(len(m.Value)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *OwnerID) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *OwnerID) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *OwnerID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.Value) > 0 {
|
||||
i -= len(m.Value)
|
||||
copy(dAtA[i:], m.Value)
|
||||
i = encodeVarintTypes(dAtA, i, uint64(len(m.Value)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTypes(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
func (m *Address) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.ContainerId != nil {
|
||||
l = m.ContainerId.Size()
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
if m.ObjectId != nil {
|
||||
l = m.ObjectId.Size()
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
n += len(m.XXX_unrecognized)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *ObjectID) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Value)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
n += len(m.XXX_unrecognized)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *ContainerID) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Value)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
n += len(m.XXX_unrecognized)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *OwnerID) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Value)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
n += len(m.XXX_unrecognized)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTypes(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozTypes(x uint64) (n int) {
|
||||
return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *Address) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Address: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Address: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.ContainerId == nil {
|
||||
m.ContainerId = &ContainerID{}
|
||||
}
|
||||
if err := m.ContainerId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ObjectId", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.ObjectId == nil {
|
||||
m.ObjectId = &ObjectID{}
|
||||
}
|
||||
if err := m.ObjectId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *ObjectID) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: ObjectID: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: ObjectID: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
|
||||
if m.Value == nil {
|
||||
m.Value = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *ContainerID) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: ContainerID: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: ContainerID: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
|
||||
if m.Value == nil {
|
||||
m.Value = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *OwnerID) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: OwnerID: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: OwnerID: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
|
||||
if m.Value == nil {
|
||||
m.Value = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTypes(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
wireType := int(wire & 0x7)
|
||||
switch wireType {
|
||||
case 0:
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx++
|
||||
if dAtA[iNdEx-1] < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
length |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if length < 0 {
|
||||
return 0, ErrInvalidLengthTypes
|
||||
}
|
||||
iNdEx += length
|
||||
case 3:
|
||||
depth++
|
||||
case 4:
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupTypes
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthTypes
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
32
refs/v2/types.proto
Normal file
32
refs/v2/types.proto
Normal file
|
@ -0,0 +1,32 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package refs.v2;
|
||||
|
||||
option go_package = "github.com/nspcc-dev/neofs-api-go/refs/v2";
|
||||
option csharp_namespace = "NeoFS.API.Refs";
|
||||
|
||||
// Address of object (container id + object id)
|
||||
message Address {
|
||||
// container_id carries container identifier.
|
||||
ContainerID container_id = 1;
|
||||
// object_id carries object identifier.
|
||||
ObjectID object_id = 2;
|
||||
}
|
||||
|
||||
// NeoFS object identifier.
|
||||
message ObjectID {
|
||||
// value carries the object identifier in a binary format.
|
||||
bytes value = 1;
|
||||
}
|
||||
|
||||
// NeoFS container identifier.
|
||||
message ContainerID {
|
||||
// value carries the container identifier in a binary format.
|
||||
bytes value = 1;
|
||||
}
|
||||
|
||||
// OwnerID group information about the owner of the NeoFS container.v2.
|
||||
message OwnerID {
|
||||
// value carries the identifier of the container owner in a binary format.
|
||||
bytes value = 1;
|
||||
}
|
3168
service/v2/meta.pb.go
Normal file
3168
service/v2/meta.pb.go
Normal file
File diff suppressed because it is too large
Load diff
129
service/v2/meta.proto
Normal file
129
service/v2/meta.proto
Normal file
|
@ -0,0 +1,129 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package service.v2;
|
||||
|
||||
option go_package = "github.com/nspcc-dev/neofs-api-go/service/v2";
|
||||
option csharp_namespace = "NeoFS.API.Service";
|
||||
|
||||
import "acl/v2/types.proto";
|
||||
import "refs/v2/types.proto";
|
||||
import "service/v2/verify.proto";
|
||||
|
||||
message XHeader {
|
||||
// Key of the X-Header.
|
||||
string key = 1;
|
||||
// Value of the X-Header.
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
// Represents API version used by node.
|
||||
message Version {
|
||||
// Major API version.
|
||||
uint32 major = 1;
|
||||
// Minor API version.
|
||||
uint32 minor = 2;
|
||||
}
|
||||
|
||||
// Lifetime parameters of the token. Filed names taken from rfc7519.
|
||||
message TokenLifetime {
|
||||
// Expiration Epoch
|
||||
uint64 exp = 1;
|
||||
// Not valid before Epoch
|
||||
uint64 nbf = 2;
|
||||
// Issued at Epoch
|
||||
uint64 iat = 3;
|
||||
}
|
||||
|
||||
// NeoFS session token.
|
||||
message SessionToken {
|
||||
message Body {
|
||||
// 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;
|
||||
// Verb is an enumeration of session request types
|
||||
enum Verb {
|
||||
// Refers to object.Put RPC call
|
||||
OBJECT_PUT = 0;
|
||||
// Refers to object.Get RPC call
|
||||
OBJECT_GET = 1;
|
||||
// Refers to object.Head RPC call
|
||||
OBJECT_HEAD = 2;
|
||||
// Refers to object.Search RPC call
|
||||
OBJECT_SEARCH = 3;
|
||||
// Refers to object.Delete RPC call
|
||||
OBJECT_DELETE = 4;
|
||||
// Refers to object.GetRange RPC call
|
||||
OBJECT_RANGE = 5;
|
||||
// Refers to object.GetRangeHash RPC call
|
||||
OBJECT_RANGEHASH = 6;
|
||||
}
|
||||
// Verb is a type of request for which the token is issued
|
||||
Verb verb = 3;
|
||||
// Lifetime is a lifetime of the session
|
||||
TokenLifetime lifetime = 4;
|
||||
// SessionKey is a public key of session key
|
||||
bytes session_key = 5;
|
||||
// Carries context of the session.
|
||||
oneof context {
|
||||
// object_address represents the object session context.
|
||||
refs.v2.Address object_address = 6;
|
||||
}
|
||||
}
|
||||
// Session Token body
|
||||
Body token = 1;
|
||||
|
||||
// Signature is a signature of session token information
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
// BearerToken has information about request ACL rules with limited lifetime
|
||||
message BearerToken {
|
||||
message Body {
|
||||
// EACLTable carries table of extended ACL rules
|
||||
acl.v2.EACLTable eacl_table = 1;
|
||||
// OwnerID carries identifier of the token owner
|
||||
refs.v2.OwnerID owner_id = 2;
|
||||
// Token expiration and valid time period parameters
|
||||
TokenLifetime lifetime = 3;
|
||||
}
|
||||
// Bearer Token body
|
||||
Body token = 1;
|
||||
|
||||
// Signature of BearerToken body
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
// Information about the request
|
||||
message RequestMetaHeader {
|
||||
// Client API version.
|
||||
Version version = 1;
|
||||
// Client local epoch number. Set to 0 if unknown.
|
||||
uint64 epoch = 2;
|
||||
// Maximum number of nodes in the request route.
|
||||
uint32 ttl = 3;
|
||||
// Request X-Headers.
|
||||
repeated XHeader x_headers = 4;
|
||||
// Token is a token of the session within which the request is sent
|
||||
SessionToken token = 5;
|
||||
// Bearer is a Bearer token of the request
|
||||
BearerToken bearer = 6;
|
||||
|
||||
// RequestMetaHeader of the origin request.
|
||||
RequestMetaHeader origin = 7;
|
||||
}
|
||||
|
||||
// Information about the response
|
||||
message ResponseMetaHeader {
|
||||
// Server API version.
|
||||
Version version = 1;
|
||||
// Server local epoch number.
|
||||
uint64 epoch = 2;
|
||||
// Maximum number of nodes in the response route.
|
||||
uint32 ttl = 3;
|
||||
// Response X-Headers.
|
||||
repeated XHeader x_headers = 4;
|
||||
|
||||
// Carries response meta header of the origin response.
|
||||
ResponseMetaHeader origin = 5;
|
||||
}
|
1156
service/v2/verify.pb.go
Normal file
1156
service/v2/verify.pb.go
Normal file
File diff suppressed because it is too large
Load diff
43
service/v2/verify.proto
Normal file
43
service/v2/verify.proto
Normal file
|
@ -0,0 +1,43 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package service.v2;
|
||||
|
||||
option go_package = "github.com/nspcc-dev/neofs-api-go/service/v2";
|
||||
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.
|
||||
bytes key = 1;
|
||||
// Signature
|
||||
bytes sign = 2;
|
||||
}
|
||||
|
||||
// Verification info for request signed by all intermediate nodes
|
||||
message RequestVerificationHeader {
|
||||
// Request Body signature. Should be generated once by request initiator.
|
||||
Signature body_signature = 1;
|
||||
// Request Meta signature is added and signed by any intermediate node
|
||||
Signature meta_signature = 2;
|
||||
// Sign previous hops
|
||||
Signature origin_signature = 3;
|
||||
|
||||
// Chain of previous hops signatures
|
||||
RequestVerificationHeader origin = 4;
|
||||
}
|
||||
|
||||
// Verification info for response signed by all intermediate nodes
|
||||
message ResponseVerificationHeader {
|
||||
// Response Body signature. Should be generated once by answering node.
|
||||
Signature body_signature = 1;
|
||||
// Response Meta signature is added and signed by any intermediate node
|
||||
Signature meta_signature = 2;
|
||||
// Sign previous hops
|
||||
Signature origin_signature = 3;
|
||||
|
||||
// Chain of previous hops signatures
|
||||
ResponseVerificationHeader origin = 4;
|
||||
}
|
1385
session/v2/service.pb.go
Normal file
1385
session/v2/service.pb.go
Normal file
File diff suppressed because it is too large
Load diff
60
session/v2/service.proto
Normal file
60
session/v2/service.proto
Normal file
|
@ -0,0 +1,60 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package session.v2;
|
||||
|
||||
option go_package = "github.com/nspcc-dev/neofs-api-go/session/v2";
|
||||
option csharp_namespace = "NeoFS.API.Session";
|
||||
|
||||
import "refs/v2/types.proto";
|
||||
import "service/v2/meta.proto";
|
||||
import "service/v2/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.
|
||||
message CreateRequest {
|
||||
message Body {
|
||||
// Carries an identifier of a session initiator.
|
||||
refs.v2.OwnerID owner_id = 1;
|
||||
|
||||
// Carries a lifetime of the session.v2.
|
||||
service.v2.TokenLifetime lifetime = 2;
|
||||
}
|
||||
|
||||
// Body of create session token 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;
|
||||
}
|
||||
|
||||
// CreateResponse carries an information about the opened session.v2.
|
||||
message CreateResponse {
|
||||
message Body {
|
||||
// id carries an identifier of session token.
|
||||
bytes id = 1;
|
||||
|
||||
// session_key carries a session public key.
|
||||
bytes session_key = 2;
|
||||
}
|
||||
|
||||
// Body of create session token 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;
|
||||
}
|
483
storagegroup/v2/types.pb.go
Normal file
483
storagegroup/v2/types.pb.go
Normal file
|
@ -0,0 +1,483 @@
|
|||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: storagegroup/v2/types.proto
|
||||
|
||||
package v2
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
v2 "github.com/nspcc-dev/neofs-api-go/refs/v2"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// StorageGroup groups the information about the NeoFS storage group.
|
||||
// The storage group consists of objects from single container.
|
||||
type StorageGroup struct {
|
||||
// validation_data_size carries the total size of the payloads of the storage
|
||||
// group members.
|
||||
ValidationDataSize uint64 `protobuf:"varint,1,opt,name=validation_data_size,json=validationDataSize,proto3" json:"validation_data_size,omitempty"`
|
||||
// validation_hash carries homomorphic hash from the concatenation of the
|
||||
// payloads of the storage group members
|
||||
// The order of concatenation is the same as the order of the members in the
|
||||
// Members field.
|
||||
ValidationHash []byte `protobuf:"bytes,2,opt,name=validation_hash,json=validationHash,proto3" json:"validation_hash,omitempty"`
|
||||
// expiration_epoch carries last NeoFS epoch number of the storage group
|
||||
// lifetime.
|
||||
ExpirationEpoch uint64 `protobuf:"varint,3,opt,name=expiration_epoch,json=expirationEpoch,proto3" json:"expiration_epoch,omitempty"`
|
||||
// Members carries the list of identifiers of the object storage group members.
|
||||
// The list is strictly ordered.
|
||||
Members []*v2.ObjectID `protobuf:"bytes,4,rep,name=members,proto3" json:"members,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *StorageGroup) Reset() { *m = StorageGroup{} }
|
||||
func (m *StorageGroup) String() string { return proto.CompactTextString(m) }
|
||||
func (*StorageGroup) ProtoMessage() {}
|
||||
func (*StorageGroup) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e6cea1f26229f4f1, []int{0}
|
||||
}
|
||||
func (m *StorageGroup) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *StorageGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_StorageGroup.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *StorageGroup) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_StorageGroup.Merge(m, src)
|
||||
}
|
||||
func (m *StorageGroup) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *StorageGroup) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_StorageGroup.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_StorageGroup proto.InternalMessageInfo
|
||||
|
||||
func (m *StorageGroup) GetValidationDataSize() uint64 {
|
||||
if m != nil {
|
||||
return m.ValidationDataSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StorageGroup) GetValidationHash() []byte {
|
||||
if m != nil {
|
||||
return m.ValidationHash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *StorageGroup) GetExpirationEpoch() uint64 {
|
||||
if m != nil {
|
||||
return m.ExpirationEpoch
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *StorageGroup) GetMembers() []*v2.ObjectID {
|
||||
if m != nil {
|
||||
return m.Members
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*StorageGroup)(nil), "storagegroup.v2.StorageGroup")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("storagegroup/v2/types.proto", fileDescriptor_e6cea1f26229f4f1) }
|
||||
|
||||
var fileDescriptor_e6cea1f26229f4f1 = []byte{
|
||||
// 287 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0x2e, 0xc9, 0x2f,
|
||||
0x4a, 0x4c, 0x4f, 0x4d, 0x2f, 0xca, 0x2f, 0x2d, 0xd0, 0x2f, 0x33, 0xd2, 0x2f, 0xa9, 0x2c, 0x48,
|
||||
0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x47, 0x96, 0xd4, 0x2b, 0x33, 0x92, 0x12,
|
||||
0x2e, 0x4a, 0x4d, 0x2b, 0x46, 0x53, 0xa5, 0x74, 0x90, 0x91, 0x8b, 0x27, 0x18, 0xa2, 0xd0, 0x1d,
|
||||
0xa4, 0x50, 0xc8, 0x80, 0x4b, 0xa4, 0x2c, 0x31, 0x27, 0x33, 0x25, 0xb1, 0x24, 0x33, 0x3f, 0x2f,
|
||||
0x3e, 0x25, 0xb1, 0x24, 0x31, 0xbe, 0x38, 0xb3, 0x2a, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x25,
|
||||
0x48, 0x08, 0x21, 0xe7, 0x92, 0x58, 0x92, 0x18, 0x9c, 0x59, 0x95, 0x2a, 0xa4, 0xce, 0xc5, 0x8f,
|
||||
0xa4, 0x23, 0x23, 0xb1, 0x38, 0x43, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x88, 0x0f, 0x21, 0xec,
|
||||
0x91, 0x58, 0x9c, 0x21, 0xa4, 0xc9, 0x25, 0x90, 0x5a, 0x51, 0x90, 0x59, 0x04, 0x51, 0x98, 0x5a,
|
||||
0x90, 0x9f, 0x9c, 0x21, 0xc1, 0x0c, 0x36, 0x96, 0x1f, 0x21, 0xee, 0x0a, 0x12, 0x16, 0xd2, 0xe6,
|
||||
0x62, 0xcf, 0x4d, 0xcd, 0x4d, 0x4a, 0x2d, 0x2a, 0x96, 0x60, 0x51, 0x60, 0xd6, 0xe0, 0x36, 0x12,
|
||||
0xd4, 0x03, 0xb9, 0x5e, 0xaf, 0xcc, 0x48, 0xcf, 0x3f, 0x29, 0x2b, 0x35, 0xb9, 0xc4, 0xd3, 0x25,
|
||||
0x08, 0xa6, 0xc2, 0x29, 0xe6, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92,
|
||||
0x63, 0x9c, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x30, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39,
|
||||
0x3f, 0x57, 0x3f, 0xaf, 0xb8, 0x20, 0x39, 0x59, 0x37, 0x25, 0xb5, 0x4c, 0x3f, 0x2f, 0x35, 0x3f,
|
||||
0xad, 0x58, 0x37, 0xb1, 0x20, 0x53, 0x37, 0x3d, 0x5f, 0x1f, 0x2d, 0xe8, 0x56, 0x31, 0x89, 0xf9,
|
||||
0xa5, 0xe6, 0xbb, 0x05, 0xeb, 0x39, 0x06, 0x78, 0xea, 0x21, 0x07, 0x48, 0x12, 0x1b, 0x38, 0xa0,
|
||||
0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xae, 0xc0, 0x6d, 0x6d, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *StorageGroup) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *StorageGroup) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *StorageGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.Members) > 0 {
|
||||
for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Members[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTypes(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
}
|
||||
if m.ExpirationEpoch != 0 {
|
||||
i = encodeVarintTypes(dAtA, i, uint64(m.ExpirationEpoch))
|
||||
i--
|
||||
dAtA[i] = 0x18
|
||||
}
|
||||
if len(m.ValidationHash) > 0 {
|
||||
i -= len(m.ValidationHash)
|
||||
copy(dAtA[i:], m.ValidationHash)
|
||||
i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidationHash)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.ValidationDataSize != 0 {
|
||||
i = encodeVarintTypes(dAtA, i, uint64(m.ValidationDataSize))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTypes(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
func (m *StorageGroup) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.ValidationDataSize != 0 {
|
||||
n += 1 + sovTypes(uint64(m.ValidationDataSize))
|
||||
}
|
||||
l = len(m.ValidationHash)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
if m.ExpirationEpoch != 0 {
|
||||
n += 1 + sovTypes(uint64(m.ExpirationEpoch))
|
||||
}
|
||||
if len(m.Members) > 0 {
|
||||
for _, e := range m.Members {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
n += len(m.XXX_unrecognized)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTypes(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozTypes(x uint64) (n int) {
|
||||
return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *StorageGroup) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: StorageGroup: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: StorageGroup: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ValidationDataSize", wireType)
|
||||
}
|
||||
m.ValidationDataSize = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.ValidationDataSize |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ValidationHash", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.ValidationHash = append(m.ValidationHash[:0], dAtA[iNdEx:postIndex]...)
|
||||
if m.ValidationHash == nil {
|
||||
m.ValidationHash = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ExpirationEpoch", wireType)
|
||||
}
|
||||
m.ExpirationEpoch = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.ExpirationEpoch |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Members = append(m.Members, &v2.ObjectID{})
|
||||
if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTypes(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
wireType := int(wire & 0x7)
|
||||
switch wireType {
|
||||
case 0:
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx++
|
||||
if dAtA[iNdEx-1] < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
length |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if length < 0 {
|
||||
return 0, ErrInvalidLengthTypes
|
||||
}
|
||||
iNdEx += length
|
||||
case 3:
|
||||
depth++
|
||||
case 4:
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupTypes
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthTypes
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
30
storagegroup/v2/types.proto
Normal file
30
storagegroup/v2/types.proto
Normal file
|
@ -0,0 +1,30 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package storagegroup.v2;
|
||||
|
||||
option go_package = "github.com/nspcc-dev/neofs-api-go/storagegroup/v2";
|
||||
option csharp_namespace = "NeoFS.API.StorageGroup";
|
||||
|
||||
import "refs/v2/types.proto";
|
||||
|
||||
// StorageGroup groups the information about the NeoFS storage group.
|
||||
// The storage group consists of objects from single container.
|
||||
message StorageGroup {
|
||||
// validation_data_size carries the total size of the payloads of the storage
|
||||
// group members.
|
||||
uint64 validation_data_size = 1;
|
||||
|
||||
// validation_hash carries homomorphic hash from the concatenation of the
|
||||
// payloads of the storage group members
|
||||
// The order of concatenation is the same as the order of the members in the
|
||||
// Members field.
|
||||
bytes validation_hash = 2;
|
||||
|
||||
// expiration_epoch carries last NeoFS epoch number of the storage group
|
||||
// lifetime.
|
||||
uint64 expiration_epoch = 3;
|
||||
|
||||
// Members carries the list of identifiers of the object storage group members.
|
||||
// The list is strictly ordered.
|
||||
repeated refs.v2.ObjectID members = 4;
|
||||
}
|
Loading…
Reference in a new issue