forked from TrueCloudLab/frostfs-api-go
[#77] protogen: Initial implementation
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
a28ceb251a
commit
adb7c602d7
115 changed files with 36376 additions and 20397 deletions
11
Makefile
11
Makefile
|
@ -61,12 +61,13 @@ protoc:
|
|||
make protoc-install; \
|
||||
fi
|
||||
# Protoc generate
|
||||
@for f in `find . -type f -name '*.proto' -not -path './bin/*'`; do \
|
||||
@for f in `find . -type f -name '*.proto' -not -path './bin/*' -not -path './util/proto/test/*'`; do \
|
||||
echo "⇒ Processing $$f "; \
|
||||
$(PROTOC_DIR)/bin/protoc \
|
||||
--proto_path=.:$(PROTOC_DIR)/include:/usr/local/include \
|
||||
--plugin=protoc-gen-go=$(PROTOC_GEN_GO_DIR)/protoc-gen-go \
|
||||
--go_out=. --go_opt=paths=source_relative \
|
||||
--plugin=protoc-gen-go-frostfs=$(abspath ./bin/protogen) \
|
||||
--go-frostfs_out=fuzz=true:. \
|
||||
--go-frostfs_opt=paths=source_relative \
|
||||
--go-grpc_opt=require_unimplemented_servers=false \
|
||||
--go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \
|
||||
done
|
||||
|
@ -79,7 +80,9 @@ protogen:
|
|||
protoc-test: protoc protogen
|
||||
@$(PROTOC_DIR)/bin/protoc \
|
||||
--plugin=protoc-gen-go-frostfs=$(abspath $(BIN)/protogen) \
|
||||
--go-frostfs_out=. --go-frostfs_opt=paths=source_relative \
|
||||
--go-frostfs_opt=Mutil/proto/test/test.proto=git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test/custom \
|
||||
--go-frostfs_opt=module=git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 \
|
||||
--go-frostfs_out=. --go-frostfs_opt=paths=import \
|
||||
./util/proto/test/test.proto
|
||||
|
||||
# Run Unit Test with go test
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
package accounting
|
||||
|
||||
import (
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
// SetOwnerId sets identifier of the account owner.
|
||||
func (m *BalanceRequest_Body) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *BalanceRequest) SetBody(v *BalanceRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *BalanceRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *BalanceRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBalance sets balance value of the response.
|
||||
func (m *BalanceResponse_Body) SetBalance(v *Decimal) {
|
||||
m.Balance = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *BalanceResponse) SetBody(v *BalanceResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *BalanceResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *BalanceResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
451
accounting/grpc/service.pb.go
generated
451
accounting/grpc/service.pb.go
generated
|
@ -1,451 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: accounting/grpc/service.proto
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// BalanceRequest message
|
||||
type BalanceRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Body of the balance request message.
|
||||
Body *BalanceRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
|
||||
// Carries request meta information. Header data is used only to regulate
|
||||
// message transport and does not affect request execution.
|
||||
MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"`
|
||||
// Carries request verification information. This header is used to
|
||||
// authenticate the nodes of the message route and check the correctness of
|
||||
// transmission.
|
||||
VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"`
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) Reset() {
|
||||
*x = BalanceRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BalanceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *BalanceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BalanceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*BalanceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_accounting_grpc_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) GetBody() *BalanceRequest_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) GetMetaHeader() *grpc.RequestMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) GetVerifyHeader() *grpc.RequestVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// BalanceResponse message
|
||||
type BalanceResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Body of the balance response message.
|
||||
Body *BalanceResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
|
||||
// Carries response meta information. Header data is used only to regulate
|
||||
// message transport and does not affect request execution.
|
||||
MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"`
|
||||
// Carries response verification information. This header is used to
|
||||
// authenticate the nodes of the message route and check the correctness of
|
||||
// transmission.
|
||||
VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"`
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) Reset() {
|
||||
*x = BalanceResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BalanceResponse) ProtoMessage() {}
|
||||
|
||||
func (x *BalanceResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BalanceResponse.ProtoReflect.Descriptor instead.
|
||||
func (*BalanceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_accounting_grpc_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) GetBody() *BalanceResponse_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) GetMetaHeader() *grpc.ResponseMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// To indicate the account for which the balance is requested, its identifier
|
||||
// is used. It can be any existing account in NeoFS sidechain `Balance` smart
|
||||
// contract. If omitted, client implementation MUST set it to the request's
|
||||
// signer `OwnerID`.
|
||||
type BalanceRequest_Body struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Valid user identifier in `OwnerID` format for which the balance is
|
||||
// requested. Required field.
|
||||
OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *BalanceRequest_Body) Reset() {
|
||||
*x = BalanceRequest_Body{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *BalanceRequest_Body) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BalanceRequest_Body) ProtoMessage() {}
|
||||
|
||||
func (x *BalanceRequest_Body) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BalanceRequest_Body.ProtoReflect.Descriptor instead.
|
||||
func (*BalanceRequest_Body) Descriptor() ([]byte, []int) {
|
||||
return file_accounting_grpc_service_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *BalanceRequest_Body) GetOwnerId() *grpc1.OwnerID {
|
||||
if x != nil {
|
||||
return x.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// The amount of funds in GAS token for the `OwnerID`'s account requested.
|
||||
// Balance is given in the `Decimal` format to avoid precision issues with
|
||||
// rounding.
|
||||
type BalanceResponse_Body struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Amount of funds in GAS token for the requested account.
|
||||
Balance *Decimal `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"`
|
||||
}
|
||||
|
||||
func (x *BalanceResponse_Body) Reset() {
|
||||
*x = BalanceResponse_Body{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *BalanceResponse_Body) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BalanceResponse_Body) ProtoMessage() {}
|
||||
|
||||
func (x *BalanceResponse_Body) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_accounting_grpc_service_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BalanceResponse_Body.ProtoReflect.Descriptor instead.
|
||||
func (*BalanceResponse_Body) Descriptor() ([]byte, []int) {
|
||||
return file_accounting_grpc_service_proto_rawDescGZIP(), []int{1, 0}
|
||||
}
|
||||
|
||||
func (x *BalanceResponse_Body) GetBalance() *Decimal {
|
||||
if x != nil {
|
||||
return x.Balance
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_accounting_grpc_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_accounting_grpc_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x14, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75,
|
||||
0x6e, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79,
|
||||
0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x02, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61,
|
||||
0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52,
|
||||
0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65,
|
||||
0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f,
|
||||
0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
|
||||
0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d,
|
||||
0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e,
|
||||
0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56,
|
||||
0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65,
|
||||
0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a,
|
||||
0x3a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72,
|
||||
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e,
|
||||
0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72,
|
||||
0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xae, 0x02, 0x0a, 0x0f,
|
||||
0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||
0x3e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
|
||||
0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12,
|
||||
0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74,
|
||||
0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66,
|
||||
0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d,
|
||||
0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66,
|
||||
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76,
|
||||
0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x3f, 0x0a, 0x04, 0x42,
|
||||
0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x63, 0x69,
|
||||
0x6d, 0x61, 0x6c, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x32, 0x6b, 0x0a, 0x11,
|
||||
0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x56, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x6e,
|
||||
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61,
|
||||
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63,
|
||||
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74,
|
||||
0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72,
|
||||
0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74,
|
||||
0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x63,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69,
|
||||
0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63,
|
||||
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_accounting_grpc_service_proto_rawDescOnce sync.Once
|
||||
file_accounting_grpc_service_proto_rawDescData = file_accounting_grpc_service_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_accounting_grpc_service_proto_rawDescGZIP() []byte {
|
||||
file_accounting_grpc_service_proto_rawDescOnce.Do(func() {
|
||||
file_accounting_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounting_grpc_service_proto_rawDescData)
|
||||
})
|
||||
return file_accounting_grpc_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_accounting_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_accounting_grpc_service_proto_goTypes = []interface{}{
|
||||
(*BalanceRequest)(nil), // 0: neo.fs.v2.accounting.BalanceRequest
|
||||
(*BalanceResponse)(nil), // 1: neo.fs.v2.accounting.BalanceResponse
|
||||
(*BalanceRequest_Body)(nil), // 2: neo.fs.v2.accounting.BalanceRequest.Body
|
||||
(*BalanceResponse_Body)(nil), // 3: neo.fs.v2.accounting.BalanceResponse.Body
|
||||
(*grpc.RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader
|
||||
(*grpc.RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader
|
||||
(*grpc.ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader
|
||||
(*grpc.ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader
|
||||
(*grpc1.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID
|
||||
(*Decimal)(nil), // 9: neo.fs.v2.accounting.Decimal
|
||||
}
|
||||
var file_accounting_grpc_service_proto_depIdxs = []int32{
|
||||
2, // 0: neo.fs.v2.accounting.BalanceRequest.body:type_name -> neo.fs.v2.accounting.BalanceRequest.Body
|
||||
4, // 1: neo.fs.v2.accounting.BalanceRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader
|
||||
5, // 2: neo.fs.v2.accounting.BalanceRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader
|
||||
3, // 3: neo.fs.v2.accounting.BalanceResponse.body:type_name -> neo.fs.v2.accounting.BalanceResponse.Body
|
||||
6, // 4: neo.fs.v2.accounting.BalanceResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader
|
||||
7, // 5: neo.fs.v2.accounting.BalanceResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader
|
||||
8, // 6: neo.fs.v2.accounting.BalanceRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID
|
||||
9, // 7: neo.fs.v2.accounting.BalanceResponse.Body.balance:type_name -> neo.fs.v2.accounting.Decimal
|
||||
0, // 8: neo.fs.v2.accounting.AccountingService.Balance:input_type -> neo.fs.v2.accounting.BalanceRequest
|
||||
1, // 9: neo.fs.v2.accounting.AccountingService.Balance:output_type -> neo.fs.v2.accounting.BalanceResponse
|
||||
9, // [9:10] is the sub-list for method output_type
|
||||
8, // [8:9] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_accounting_grpc_service_proto_init() }
|
||||
func file_accounting_grpc_service_proto_init() {
|
||||
if File_accounting_grpc_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_accounting_grpc_types_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_accounting_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BalanceRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_accounting_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BalanceResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_accounting_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BalanceRequest_Body); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_accounting_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BalanceResponse_Body); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_accounting_grpc_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_accounting_grpc_service_proto_goTypes,
|
||||
DependencyIndexes: file_accounting_grpc_service_proto_depIdxs,
|
||||
MessageInfos: file_accounting_grpc_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_accounting_grpc_service_proto = out.File
|
||||
file_accounting_grpc_service_proto_rawDesc = nil
|
||||
file_accounting_grpc_service_proto_goTypes = nil
|
||||
file_accounting_grpc_service_proto_depIdxs = nil
|
||||
}
|
724
accounting/grpc/service_frostfs.pb.go
generated
Normal file
724
accounting/grpc/service_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,724 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
)
|
||||
|
||||
type BalanceRequest_Body struct {
|
||||
OwnerId *grpc.OwnerID `json:"ownerId"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*BalanceRequest_Body)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*BalanceRequest_Body)(nil)
|
||||
_ json.Marshaler = (*BalanceRequest_Body)(nil)
|
||||
_ json.Unmarshaler = (*BalanceRequest_Body)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *BalanceRequest_Body) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.OwnerId)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *BalanceRequest_Body) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *BalanceRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
|
||||
x.OwnerId.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *BalanceRequest_Body) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "BalanceRequest_Body")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // OwnerId
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "OwnerId")
|
||||
}
|
||||
x.OwnerId = new(grpc.OwnerID)
|
||||
if err := x.OwnerId.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest_Body) GetOwnerId() *grpc.OwnerID {
|
||||
if x != nil {
|
||||
return x.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest_Body) SetOwnerId(v *grpc.OwnerID) {
|
||||
x.OwnerId = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *BalanceRequest_Body) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"ownerId\":"
|
||||
out.RawString(prefix[1:])
|
||||
x.OwnerId.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *BalanceRequest_Body) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *BalanceRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "ownerId":
|
||||
{
|
||||
var f *grpc.OwnerID
|
||||
f = new(grpc.OwnerID)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.OwnerId = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type BalanceRequest struct {
|
||||
Body *BalanceRequest_Body `json:"body"`
|
||||
MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"`
|
||||
VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*BalanceRequest)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*BalanceRequest)(nil)
|
||||
_ json.Marshaler = (*BalanceRequest)(nil)
|
||||
_ json.Unmarshaler = (*BalanceRequest)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *BalanceRequest) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.Body)
|
||||
size += proto.NestedStructureSize(2, x.MetaHeader)
|
||||
size += proto.NestedStructureSize(3, x.VerifyHeader)
|
||||
return size
|
||||
}
|
||||
|
||||
// ReadSignedData fills buf with signed data of x.
|
||||
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
|
||||
//
|
||||
// Returns any error encountered which did not allow writing the data completely.
|
||||
// Otherwise, returns the buffer in which the data is written.
|
||||
//
|
||||
// Structures with the same field values have the same signed data.
|
||||
func (x *BalanceRequest) SignedDataSize() int {
|
||||
return x.GetBody().StableSize()
|
||||
}
|
||||
|
||||
// SignedDataSize returns size of the request signed data in bytes.
|
||||
//
|
||||
// Structures with the same field values have the same signed data size.
|
||||
func (x *BalanceRequest) ReadSignedData(buf []byte) ([]byte, error) {
|
||||
return x.GetBody().MarshalProtobuf(buf), nil
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *BalanceRequest) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *BalanceRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Body != nil && x.Body.StableSize() != 0 {
|
||||
x.Body.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
|
||||
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
|
||||
}
|
||||
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
|
||||
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *BalanceRequest) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "BalanceRequest")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Body
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Body")
|
||||
}
|
||||
x.Body = new(BalanceRequest_Body)
|
||||
if err := x.Body.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 2: // MetaHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
|
||||
}
|
||||
x.MetaHeader = new(grpc1.RequestMetaHeader)
|
||||
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 3: // VerifyHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
|
||||
}
|
||||
x.VerifyHeader = new(grpc1.RequestVerificationHeader)
|
||||
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest) GetBody() *BalanceRequest_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest) SetBody(v *BalanceRequest_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
func (x *BalanceRequest) GetMetaHeader() *grpc1.RequestMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
func (x *BalanceRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *BalanceRequest) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"body\":"
|
||||
out.RawString(prefix[1:])
|
||||
x.Body.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"metaHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.MetaHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"verifyHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.VerifyHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *BalanceRequest) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *BalanceRequest) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "body":
|
||||
{
|
||||
var f *BalanceRequest_Body
|
||||
f = new(BalanceRequest_Body)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.Body = f
|
||||
}
|
||||
case "metaHeader":
|
||||
{
|
||||
var f *grpc1.RequestMetaHeader
|
||||
f = new(grpc1.RequestMetaHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.MetaHeader = f
|
||||
}
|
||||
case "verifyHeader":
|
||||
{
|
||||
var f *grpc1.RequestVerificationHeader
|
||||
f = new(grpc1.RequestVerificationHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.VerifyHeader = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type BalanceResponse_Body struct {
|
||||
Balance *Decimal `json:"balance"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*BalanceResponse_Body)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*BalanceResponse_Body)(nil)
|
||||
_ json.Marshaler = (*BalanceResponse_Body)(nil)
|
||||
_ json.Unmarshaler = (*BalanceResponse_Body)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *BalanceResponse_Body) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.Balance)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *BalanceResponse_Body) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *BalanceResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Balance != nil && x.Balance.StableSize() != 0 {
|
||||
x.Balance.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *BalanceResponse_Body) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "BalanceResponse_Body")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Balance
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Balance")
|
||||
}
|
||||
x.Balance = new(Decimal)
|
||||
if err := x.Balance.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse_Body) GetBalance() *Decimal {
|
||||
if x != nil {
|
||||
return x.Balance
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse_Body) SetBalance(v *Decimal) {
|
||||
x.Balance = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *BalanceResponse_Body) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"balance\":"
|
||||
out.RawString(prefix[1:])
|
||||
x.Balance.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *BalanceResponse_Body) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *BalanceResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "balance":
|
||||
{
|
||||
var f *Decimal
|
||||
f = new(Decimal)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.Balance = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type BalanceResponse struct {
|
||||
Body *BalanceResponse_Body `json:"body"`
|
||||
MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"`
|
||||
VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*BalanceResponse)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*BalanceResponse)(nil)
|
||||
_ json.Marshaler = (*BalanceResponse)(nil)
|
||||
_ json.Unmarshaler = (*BalanceResponse)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *BalanceResponse) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.Body)
|
||||
size += proto.NestedStructureSize(2, x.MetaHeader)
|
||||
size += proto.NestedStructureSize(3, x.VerifyHeader)
|
||||
return size
|
||||
}
|
||||
|
||||
// ReadSignedData fills buf with signed data of x.
|
||||
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
|
||||
//
|
||||
// Returns any error encountered which did not allow writing the data completely.
|
||||
// Otherwise, returns the buffer in which the data is written.
|
||||
//
|
||||
// Structures with the same field values have the same signed data.
|
||||
func (x *BalanceResponse) SignedDataSize() int {
|
||||
return x.GetBody().StableSize()
|
||||
}
|
||||
|
||||
// SignedDataSize returns size of the request signed data in bytes.
|
||||
//
|
||||
// Structures with the same field values have the same signed data size.
|
||||
func (x *BalanceResponse) ReadSignedData(buf []byte) ([]byte, error) {
|
||||
return x.GetBody().MarshalProtobuf(buf), nil
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *BalanceResponse) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *BalanceResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Body != nil && x.Body.StableSize() != 0 {
|
||||
x.Body.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
|
||||
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
|
||||
}
|
||||
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
|
||||
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *BalanceResponse) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "BalanceResponse")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Body
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Body")
|
||||
}
|
||||
x.Body = new(BalanceResponse_Body)
|
||||
if err := x.Body.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 2: // MetaHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
|
||||
}
|
||||
x.MetaHeader = new(grpc1.ResponseMetaHeader)
|
||||
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 3: // VerifyHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
|
||||
}
|
||||
x.VerifyHeader = new(grpc1.ResponseVerificationHeader)
|
||||
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse) GetBody() *BalanceResponse_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse) SetBody(v *BalanceResponse_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
func (x *BalanceResponse) GetMetaHeader() *grpc1.ResponseMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
func (x *BalanceResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *BalanceResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *BalanceResponse) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"body\":"
|
||||
out.RawString(prefix[1:])
|
||||
x.Body.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"metaHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.MetaHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"verifyHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.VerifyHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *BalanceResponse) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *BalanceResponse) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "body":
|
||||
{
|
||||
var f *BalanceResponse_Body
|
||||
f = new(BalanceResponse_Body)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.Body = f
|
||||
}
|
||||
case "metaHeader":
|
||||
{
|
||||
var f *grpc1.ResponseMetaHeader
|
||||
f = new(grpc1.ResponseMetaHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.MetaHeader = f
|
||||
}
|
||||
case "verifyHeader":
|
||||
{
|
||||
var f *grpc1.ResponseVerificationHeader
|
||||
f = new(grpc1.ResponseVerificationHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.VerifyHeader = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
45
accounting/grpc/service_frostfs_fuzz.go
Normal file
45
accounting/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,45 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
func DoFuzzProtoBalanceRequest(data []byte) int {
|
||||
msg := new(BalanceRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONBalanceRequest(data []byte) int {
|
||||
msg := new(BalanceRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoBalanceResponse(data []byte) int {
|
||||
msg := new(BalanceResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONBalanceResponse(data []byte) int {
|
||||
msg := new(BalanceResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
31
accounting/grpc/service_frostfs_test.go
Normal file
31
accounting/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoBalanceRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoBalanceRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONBalanceRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONBalanceRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoBalanceResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoBalanceResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONBalanceResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONBalanceResponse(data)
|
||||
})
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package accounting
|
||||
|
||||
// SetValue sets value of the decimal number.
|
||||
func (m *Decimal) SetValue(v int64) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetPrecision sets precision of the decimal number.
|
||||
func (m *Decimal) SetPrecision(v uint32) {
|
||||
m.Precision = v
|
||||
}
|
169
accounting/grpc/types.pb.go
generated
169
accounting/grpc/types.pb.go
generated
|
@ -1,169 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: accounting/grpc/types.proto
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Standard floating point data type can't be used in NeoFS due to inexactness
|
||||
// of the result when doing lots of small number operations. To solve the lost
|
||||
// precision issue, special `Decimal` format is used for monetary computations.
|
||||
//
|
||||
// Please see [The General Decimal Arithmetic
|
||||
// Specification](http://speleotrove.com/decimal/) for detailed problem
|
||||
// description.
|
||||
type Decimal struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Number in the smallest Token fractions.
|
||||
Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||
// Precision value indicating how many smallest fractions can be in one
|
||||
// integer.
|
||||
Precision uint32 `protobuf:"varint,2,opt,name=precision,proto3" json:"precision,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Decimal) Reset() {
|
||||
*x = Decimal{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_accounting_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Decimal) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Decimal) ProtoMessage() {}
|
||||
|
||||
func (x *Decimal) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_accounting_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Decimal.ProtoReflect.Descriptor instead.
|
||||
func (*Decimal) Descriptor() ([]byte, []int) {
|
||||
return file_accounting_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Decimal) GetValue() int64 {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Decimal) GetPrecision() uint32 {
|
||||
if x != nil {
|
||||
return x.Precision
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_accounting_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_accounting_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70,
|
||||
0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6e,
|
||||
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x69, 0x6e, 0x67, 0x22, 0x3d, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66,
|
||||
0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d,
|
||||
0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67,
|
||||
0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67,
|
||||
0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61,
|
||||
0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e,
|
||||
0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_accounting_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_accounting_grpc_types_proto_rawDescData = file_accounting_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_accounting_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_accounting_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_accounting_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounting_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_accounting_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_accounting_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_accounting_grpc_types_proto_goTypes = []interface{}{
|
||||
(*Decimal)(nil), // 0: neo.fs.v2.accounting.Decimal
|
||||
}
|
||||
var file_accounting_grpc_types_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_accounting_grpc_types_proto_init() }
|
||||
func file_accounting_grpc_types_proto_init() {
|
||||
if File_accounting_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_accounting_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Decimal); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_accounting_grpc_types_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_accounting_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_accounting_grpc_types_proto_depIdxs,
|
||||
MessageInfos: file_accounting_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_accounting_grpc_types_proto = out.File
|
||||
file_accounting_grpc_types_proto_rawDesc = nil
|
||||
file_accounting_grpc_types_proto_goTypes = nil
|
||||
file_accounting_grpc_types_proto_depIdxs = nil
|
||||
}
|
174
accounting/grpc/types_frostfs.pb.go
generated
Normal file
174
accounting/grpc/types_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,174 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
)
|
||||
|
||||
type Decimal struct {
|
||||
Value int64 `json:"value"`
|
||||
Precision uint32 `json:"precision"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Decimal)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Decimal)(nil)
|
||||
_ json.Marshaler = (*Decimal)(nil)
|
||||
_ json.Unmarshaler = (*Decimal)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Decimal) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.Int64Size(1, x.Value)
|
||||
size += proto.UInt32Size(2, x.Precision)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Decimal) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Decimal) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Value != 0 {
|
||||
mm.AppendInt64(1, x.Value)
|
||||
}
|
||||
if x.Precision != 0 {
|
||||
mm.AppendUint32(2, x.Precision)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Decimal) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Decimal")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Value
|
||||
data, ok := fc.Int64()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Value")
|
||||
}
|
||||
x.Value = data
|
||||
case 2: // Precision
|
||||
data, ok := fc.Uint32()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Precision")
|
||||
}
|
||||
x.Precision = data
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Decimal) GetValue() int64 {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *Decimal) SetValue(v int64) {
|
||||
x.Value = v
|
||||
}
|
||||
func (x *Decimal) GetPrecision() uint32 {
|
||||
if x != nil {
|
||||
return x.Precision
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *Decimal) SetPrecision(v uint32) {
|
||||
x.Precision = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Decimal) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"value\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Int64(x.Value)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"precision\":"
|
||||
out.RawString(prefix)
|
||||
out.Uint32(x.Precision)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Decimal) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Decimal) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "value":
|
||||
{
|
||||
var f int64
|
||||
f = in.Int64()
|
||||
x.Value = f
|
||||
}
|
||||
case "precision":
|
||||
{
|
||||
var f uint32
|
||||
f = in.Uint32()
|
||||
x.Precision = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
26
accounting/grpc/types_frostfs_fuzz.go
Normal file
26
accounting/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
func DoFuzzProtoDecimal(data []byte) int {
|
||||
msg := new(Decimal)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONDecimal(data []byte) int {
|
||||
msg := new(Decimal)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
21
accounting/grpc/types_frostfs_test.go
Normal file
21
accounting/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package accounting
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoDecimal(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoDecimal(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONDecimal(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONDecimal(data)
|
||||
})
|
||||
}
|
|
@ -478,7 +478,7 @@ func (bt *BearerTokenBody) ToGRPCMessage() grpc.Message {
|
|||
m.SetLifetime(bt.lifetime.ToGRPCMessage().(*acl.BearerToken_Body_TokenLifetime))
|
||||
m.SetEaclTable(bt.eacl.ToGRPCMessage().(*acl.EACLTable))
|
||||
m.SetAllowImpersonate(bt.impersonate)
|
||||
m.SetAPEOverride(bt.apeOverride.ToGRPCMessage().(*acl.BearerToken_Body_APEOverride))
|
||||
m.SetApeOverride(bt.apeOverride.ToGRPCMessage().(*acl.BearerToken_Body_APEOverride))
|
||||
}
|
||||
|
||||
return m
|
||||
|
|
|
@ -1,193 +0,0 @@
|
|||
package acl
|
||||
|
||||
import (
|
||||
ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc"
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
)
|
||||
|
||||
// SetVersion sets version of EACL rules in table.
|
||||
func (m *EACLTable) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetContainerId sets container identifier of the eACL table.
|
||||
func (m *EACLTable) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetRecords sets record list of the eACL table.
|
||||
func (m *EACLTable) SetRecords(v []*EACLRecord) {
|
||||
m.Records = v
|
||||
}
|
||||
|
||||
// SetOperation sets operation of the eACL record.
|
||||
func (m *EACLRecord) SetOperation(v Operation) {
|
||||
m.Operation = v
|
||||
}
|
||||
|
||||
// SetAction sets action of the eACL record.
|
||||
func (m *EACLRecord) SetAction(v Action) {
|
||||
m.Action = v
|
||||
}
|
||||
|
||||
// SetFilters sets filter list of the eACL record.
|
||||
func (m *EACLRecord) SetFilters(v []*EACLRecord_Filter) {
|
||||
m.Filters = v
|
||||
}
|
||||
|
||||
// SetTargets sets target list of the eACL record.
|
||||
func (m *EACLRecord) SetTargets(v []*EACLRecord_Target) {
|
||||
m.Targets = v
|
||||
}
|
||||
|
||||
// SetHeaderType sets header type of the eACL filter.
|
||||
func (m *EACLRecord_Filter) SetHeaderType(v HeaderType) {
|
||||
m.HeaderType = v
|
||||
}
|
||||
|
||||
// SetMatchType sets match type of the eACL filter.
|
||||
func (m *EACLRecord_Filter) SetMatchType(v MatchType) {
|
||||
m.MatchType = v
|
||||
}
|
||||
|
||||
// SetKey sets key of the eACL filter.
|
||||
func (m *EACLRecord_Filter) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the eACL filter.
|
||||
func (m *EACLRecord_Filter) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetRole sets target group of the eACL target.
|
||||
func (m *EACLRecord_Target) SetRole(v Role) {
|
||||
m.Role = v
|
||||
}
|
||||
|
||||
// SetKeys of the eACL target.
|
||||
func (m *EACLRecord_Target) SetKeys(v [][]byte) {
|
||||
m.Keys = v
|
||||
}
|
||||
|
||||
// SetEaclTable sets eACL table of the bearer token.
|
||||
func (m *BearerToken_Body) SetEaclTable(v *EACLTable) {
|
||||
m.EaclTable = v
|
||||
}
|
||||
|
||||
func (m *BearerToken_Body) SetAPEOverride(v *BearerToken_Body_APEOverride) {
|
||||
m.ApeOverride = v
|
||||
}
|
||||
|
||||
func (m *BearerToken_Body_APEOverride) SetChains(v []*ape.Chain) {
|
||||
m.Chains = v
|
||||
}
|
||||
|
||||
func (m *BearerToken_Body_APEOverride) SetTarget(v *ape.ChainTarget) {
|
||||
m.Target = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the bearer token owner.
|
||||
func (m *BearerToken_Body) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetLifetime sets lifetime of the bearer token.
|
||||
func (m *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) {
|
||||
m.Lifetime = v
|
||||
}
|
||||
|
||||
// SetAllowImpersonate allows impersonate.
|
||||
func (m *BearerToken_Body) SetAllowImpersonate(v bool) {
|
||||
m.AllowImpersonate = v
|
||||
}
|
||||
|
||||
// SetBody sets bearer token body.
|
||||
func (m *BearerToken) SetBody(v *BearerToken_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetSignature sets bearer token signature.
|
||||
func (m *BearerToken) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetExp sets epoch number of the token expiration.
|
||||
func (m *BearerToken_Body_TokenLifetime) SetExp(v uint64) {
|
||||
m.Exp = v
|
||||
}
|
||||
|
||||
// SetNbf sets starting epoch number of the token.
|
||||
func (m *BearerToken_Body_TokenLifetime) SetNbf(v uint64) {
|
||||
m.Nbf = v
|
||||
}
|
||||
|
||||
// SetIat sets the number of the epoch in which the token was issued.
|
||||
func (m *BearerToken_Body_TokenLifetime) SetIat(v uint64) {
|
||||
m.Iat = v
|
||||
}
|
||||
|
||||
// FromString parses Action from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Action) FromString(s string) bool {
|
||||
i, ok := Action_value[s]
|
||||
if ok {
|
||||
*x = Action(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses Role from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Role) FromString(s string) bool {
|
||||
i, ok := Role_value[s]
|
||||
if ok {
|
||||
*x = Role(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses Operation from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Operation) FromString(s string) bool {
|
||||
i, ok := Operation_value[s]
|
||||
if ok {
|
||||
*x = Operation(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses MatchType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *MatchType) FromString(s string) bool {
|
||||
i, ok := MatchType_value[s]
|
||||
if ok {
|
||||
*x = MatchType(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses HeaderType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *HeaderType) FromString(s string) bool {
|
||||
i, ok := HeaderType_value[s]
|
||||
if ok {
|
||||
*x = HeaderType(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
1231
acl/grpc/types.pb.go
generated
1231
acl/grpc/types.pb.go
generated
File diff suppressed because it is too large
Load diff
1994
acl/grpc/types_frostfs.pb.go
generated
Normal file
1994
acl/grpc/types_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
64
acl/grpc/types_frostfs_fuzz.go
Normal file
64
acl/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,64 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package acl
|
||||
|
||||
func DoFuzzProtoEACLRecord(data []byte) int {
|
||||
msg := new(EACLRecord)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONEACLRecord(data []byte) int {
|
||||
msg := new(EACLRecord)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoEACLTable(data []byte) int {
|
||||
msg := new(EACLTable)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONEACLTable(data []byte) int {
|
||||
msg := new(EACLTable)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoBearerToken(data []byte) int {
|
||||
msg := new(BearerToken)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONBearerToken(data []byte) int {
|
||||
msg := new(BearerToken)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
41
acl/grpc/types_frostfs_test.go
Normal file
41
acl/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,41 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package acl
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoEACLRecord(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoEACLRecord(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONEACLRecord(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONEACLRecord(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoEACLTable(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoEACLTable(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONEACLTable(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONEACLTable(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoBearerToken(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoBearerToken(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONBearerToken(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONBearerToken(data)
|
||||
})
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package ape
|
||||
|
||||
func (t *ChainTarget) SetType(typ TargetType) {
|
||||
t.Type = typ
|
||||
}
|
||||
|
||||
func (t *ChainTarget) SetName(name string) {
|
||||
t.Name = name
|
||||
}
|
||||
|
||||
func (c *Chain) SetKind(kind isChain_Kind) {
|
||||
c.Kind = kind
|
||||
}
|
||||
|
||||
func (cr *Chain_Raw) SetRaw(raw []byte) {
|
||||
cr.Raw = raw
|
||||
}
|
||||
|
||||
func (cr *Chain_Raw) GetRaw() []byte {
|
||||
return cr.Raw
|
||||
}
|
310
ape/grpc/types.pb.go
generated
310
ape/grpc/types.pb.go
generated
|
@ -1,310 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: ape/grpc/types.proto
|
||||
|
||||
package ape
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// TargetType is a type target to which a rule chain is defined.
|
||||
type TargetType int32
|
||||
|
||||
const (
|
||||
TargetType_UNDEFINED TargetType = 0
|
||||
TargetType_NAMESPACE TargetType = 1
|
||||
TargetType_CONTAINER TargetType = 2
|
||||
TargetType_USER TargetType = 3
|
||||
TargetType_GROUP TargetType = 4
|
||||
)
|
||||
|
||||
// Enum value maps for TargetType.
|
||||
var (
|
||||
TargetType_name = map[int32]string{
|
||||
0: "UNDEFINED",
|
||||
1: "NAMESPACE",
|
||||
2: "CONTAINER",
|
||||
3: "USER",
|
||||
4: "GROUP",
|
||||
}
|
||||
TargetType_value = map[string]int32{
|
||||
"UNDEFINED": 0,
|
||||
"NAMESPACE": 1,
|
||||
"CONTAINER": 2,
|
||||
"USER": 3,
|
||||
"GROUP": 4,
|
||||
}
|
||||
)
|
||||
|
||||
func (x TargetType) Enum() *TargetType {
|
||||
p := new(TargetType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x TargetType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (TargetType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_ape_grpc_types_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (TargetType) Type() protoreflect.EnumType {
|
||||
return &file_ape_grpc_types_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x TargetType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use TargetType.Descriptor instead.
|
||||
func (TargetType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_ape_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// ChainTarget is an object to which a rule chain is defined.
|
||||
type ChainTarget struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Type TargetType `protobuf:"varint,1,opt,name=type,proto3,enum=frostfs.v2.ape.TargetType" json:"type,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ChainTarget) Reset() {
|
||||
*x = ChainTarget{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_ape_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ChainTarget) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ChainTarget) ProtoMessage() {}
|
||||
|
||||
func (x *ChainTarget) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ape_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ChainTarget.ProtoReflect.Descriptor instead.
|
||||
func (*ChainTarget) Descriptor() ([]byte, []int) {
|
||||
return file_ape_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ChainTarget) GetType() TargetType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return TargetType_UNDEFINED
|
||||
}
|
||||
|
||||
func (x *ChainTarget) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Chain is a chain of rules defined for a specific target.
|
||||
type Chain struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Kind:
|
||||
//
|
||||
// *Chain_Raw
|
||||
Kind isChain_Kind `protobuf_oneof:"kind"`
|
||||
}
|
||||
|
||||
func (x *Chain) Reset() {
|
||||
*x = Chain{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_ape_grpc_types_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Chain) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Chain) ProtoMessage() {}
|
||||
|
||||
func (x *Chain) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ape_grpc_types_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Chain.ProtoReflect.Descriptor instead.
|
||||
func (*Chain) Descriptor() ([]byte, []int) {
|
||||
return file_ape_grpc_types_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (m *Chain) GetKind() isChain_Kind {
|
||||
if m != nil {
|
||||
return m.Kind
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Chain) GetRaw() []byte {
|
||||
if x, ok := x.GetKind().(*Chain_Raw); ok {
|
||||
return x.Raw
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isChain_Kind interface {
|
||||
isChain_Kind()
|
||||
}
|
||||
|
||||
type Chain_Raw struct {
|
||||
// Raw representation of a serizalized rule chain.
|
||||
Raw []byte `protobuf:"bytes,1,opt,name=raw,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*Chain_Raw) isChain_Kind() {}
|
||||
|
||||
var File_ape_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_ape_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x14, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x22, 0x51, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54,
|
||||
0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x61, 0x70, 0x65, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52,
|
||||
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x23, 0x0a, 0x05, 0x43, 0x68, 0x61,
|
||||
0x69, 0x6e, 0x12, 0x12, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48,
|
||||
0x00, 0x52, 0x03, 0x72, 0x61, 0x77, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x2a, 0x4e,
|
||||
0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09,
|
||||
0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e,
|
||||
0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f,
|
||||
0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45,
|
||||
0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x04, 0x42, 0x3e,
|
||||
0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e,
|
||||
0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f,
|
||||
0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76,
|
||||
0x32, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x70, 0x65, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_ape_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_ape_grpc_types_proto_rawDescData = file_ape_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_ape_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_ape_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_ape_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_ape_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_ape_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_ape_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_ape_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_ape_grpc_types_proto_goTypes = []interface{}{
|
||||
(TargetType)(0), // 0: frostfs.v2.ape.TargetType
|
||||
(*ChainTarget)(nil), // 1: frostfs.v2.ape.ChainTarget
|
||||
(*Chain)(nil), // 2: frostfs.v2.ape.Chain
|
||||
}
|
||||
var file_ape_grpc_types_proto_depIdxs = []int32{
|
||||
0, // 0: frostfs.v2.ape.ChainTarget.type:type_name -> frostfs.v2.ape.TargetType
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_ape_grpc_types_proto_init() }
|
||||
func file_ape_grpc_types_proto_init() {
|
||||
if File_ape_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_ape_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ChainTarget); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_ape_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Chain); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_ape_grpc_types_proto_msgTypes[1].OneofWrappers = []interface{}{
|
||||
(*Chain_Raw)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_ape_grpc_types_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_ape_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_ape_grpc_types_proto_depIdxs,
|
||||
EnumInfos: file_ape_grpc_types_proto_enumTypes,
|
||||
MessageInfos: file_ape_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_ape_grpc_types_proto = out.File
|
||||
file_ape_grpc_types_proto_rawDesc = nil
|
||||
file_ape_grpc_types_proto_goTypes = nil
|
||||
file_ape_grpc_types_proto_depIdxs = nil
|
||||
}
|
400
ape/grpc/types_frostfs.pb.go
generated
Normal file
400
ape/grpc/types_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,400 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package ape
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
strconv "strconv"
|
||||
)
|
||||
|
||||
type TargetType int32
|
||||
|
||||
const (
|
||||
TargetType_UNDEFINED TargetType = 0
|
||||
TargetType_NAMESPACE TargetType = 1
|
||||
TargetType_CONTAINER TargetType = 2
|
||||
TargetType_USER TargetType = 3
|
||||
TargetType_GROUP TargetType = 4
|
||||
)
|
||||
|
||||
var (
|
||||
TargetType_name = map[int32]string{
|
||||
0: "UNDEFINED",
|
||||
1: "NAMESPACE",
|
||||
2: "CONTAINER",
|
||||
3: "USER",
|
||||
4: "GROUP",
|
||||
}
|
||||
TargetType_value = map[string]int32{
|
||||
"UNDEFINED": 0,
|
||||
"NAMESPACE": 1,
|
||||
"CONTAINER": 2,
|
||||
"USER": 3,
|
||||
"GROUP": 4,
|
||||
}
|
||||
)
|
||||
|
||||
func (x TargetType) String() string {
|
||||
if v, ok := TargetType_name[int32(x)]; ok {
|
||||
return v
|
||||
}
|
||||
return strconv.FormatInt(int64(x), 10)
|
||||
}
|
||||
func (x *TargetType) FromString(s string) bool {
|
||||
if v, ok := TargetType_value[s]; ok {
|
||||
*x = TargetType(v)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ChainTarget struct {
|
||||
Type TargetType `json:"type"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*ChainTarget)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*ChainTarget)(nil)
|
||||
_ json.Marshaler = (*ChainTarget)(nil)
|
||||
_ json.Unmarshaler = (*ChainTarget)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *ChainTarget) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.EnumSize(1, int32(x.Type))
|
||||
size += proto.StringSize(2, x.Name)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *ChainTarget) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *ChainTarget) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if int32(x.Type) != 0 {
|
||||
mm.AppendInt32(1, int32(x.Type))
|
||||
}
|
||||
if len(x.Name) != 0 {
|
||||
mm.AppendString(2, x.Name)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *ChainTarget) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "ChainTarget")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Type
|
||||
data, ok := fc.Int32()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Type")
|
||||
}
|
||||
x.Type = TargetType(data)
|
||||
case 2: // Name
|
||||
data, ok := fc.String()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Name")
|
||||
}
|
||||
x.Name = data
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *ChainTarget) GetType() TargetType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *ChainTarget) SetType(v TargetType) {
|
||||
x.Type = v
|
||||
}
|
||||
func (x *ChainTarget) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (x *ChainTarget) SetName(v string) {
|
||||
x.Name = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *ChainTarget) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"type\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Int32(int32(x.Type))
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"name\":"
|
||||
out.RawString(prefix)
|
||||
out.String(x.Name)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *ChainTarget) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *ChainTarget) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "type":
|
||||
{
|
||||
var f TargetType
|
||||
var parsedValue TargetType
|
||||
switch v := in.Interface().(type) {
|
||||
case string:
|
||||
if vv, ok := TargetType_value[v]; ok {
|
||||
parsedValue = TargetType(vv)
|
||||
break
|
||||
}
|
||||
vv, err := strconv.ParseInt(v, 10, 32)
|
||||
if err != nil {
|
||||
in.AddError(err)
|
||||
return
|
||||
}
|
||||
parsedValue = TargetType(vv)
|
||||
case float64:
|
||||
parsedValue = TargetType(v)
|
||||
}
|
||||
f = parsedValue
|
||||
x.Type = f
|
||||
}
|
||||
case "name":
|
||||
{
|
||||
var f string
|
||||
f = in.String()
|
||||
x.Name = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type Chain struct {
|
||||
Kind isChain_Kind
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Chain)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Chain)(nil)
|
||||
_ json.Marshaler = (*Chain)(nil)
|
||||
_ json.Unmarshaler = (*Chain)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Chain) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
if inner, ok := x.Kind.(*Chain_Raw); ok {
|
||||
size += proto.BytesSize(1, inner.Raw)
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Chain) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Chain) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if inner, ok := x.Kind.(*Chain_Raw); ok {
|
||||
if len(inner.Raw) != 0 {
|
||||
mm.AppendBytes(1, inner.Raw)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Chain) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Chain")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Raw
|
||||
data, ok := fc.Bytes()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Raw")
|
||||
}
|
||||
x.Kind = &Chain_Raw{Raw: data}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Chain) GetKind() isChain_Kind {
|
||||
if x != nil {
|
||||
return x.Kind
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Chain) SetKind(v isChain_Kind) {
|
||||
x.Kind = v
|
||||
}
|
||||
func (x *Chain) GetRaw() *Chain_Raw {
|
||||
if xx, ok := x.GetKind().(*Chain_Raw); ok {
|
||||
return xx
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Chain) SetRaw(v *Chain_Raw) {
|
||||
x.Kind = v
|
||||
}
|
||||
func (x *Chain_Raw) GetRaw() []byte {
|
||||
if x != nil {
|
||||
return x.Raw
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Chain_Raw) SetRaw(v []byte) {
|
||||
x.Raw = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Chain) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
switch xx := x.Kind.(type) {
|
||||
case *Chain_Raw:
|
||||
{
|
||||
const prefix string = ",\"raw\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Base64Bytes(xx.Raw)
|
||||
}
|
||||
default:
|
||||
out.RawString("null")
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Chain) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Chain) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "raw":
|
||||
xx := new(Chain_Raw)
|
||||
x.Kind = xx
|
||||
{
|
||||
var f []byte
|
||||
f = in.Bytes()
|
||||
xx.Raw = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type isChain_Kind interface {
|
||||
isChain_Kind()
|
||||
}
|
||||
|
||||
type Chain_Raw struct {
|
||||
Raw []byte
|
||||
}
|
||||
|
||||
func (*Chain_Raw) isChain_Kind() {}
|
45
ape/grpc/types_frostfs_fuzz.go
Normal file
45
ape/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,45 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package ape
|
||||
|
||||
func DoFuzzProtoChainTarget(data []byte) int {
|
||||
msg := new(ChainTarget)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONChainTarget(data []byte) int {
|
||||
msg := new(ChainTarget)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoChain(data []byte) int {
|
||||
msg := new(Chain)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONChain(data []byte) int {
|
||||
msg := new(Chain)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
31
ape/grpc/types_frostfs_test.go
Normal file
31
ape/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package ape
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoChainTarget(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoChainTarget(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONChainTarget(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONChainTarget(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoChain(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoChain(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONChain(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONChain(data)
|
||||
})
|
||||
}
|
|
@ -1,106 +0,0 @@
|
|||
package apemanager
|
||||
|
||||
import (
|
||||
ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
func (rb *AddChainRequest_Body) SetTarget(t *ape.ChainTarget) {
|
||||
rb.Target = t
|
||||
}
|
||||
|
||||
func (rb *AddChainRequest_Body) SetChain(chain *ape.Chain) {
|
||||
rb.Chain = chain
|
||||
}
|
||||
|
||||
func (r *AddChainRequest) SetBody(rb *AddChainRequest_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *AddChainRequest) SetMetaHeader(mh *session.RequestMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *AddChainRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
||||
|
||||
func (rb *AddChainResponse_Body) SetChainId(chainID []byte) {
|
||||
rb.ChainId = chainID
|
||||
}
|
||||
|
||||
func (r *AddChainResponse) SetBody(rb *AddChainResponse_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *AddChainResponse) SetMetaHeader(mh *session.ResponseMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *AddChainResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
||||
|
||||
func (rb *RemoveChainRequest_Body) SetTarget(t *ape.ChainTarget) {
|
||||
rb.Target = t
|
||||
}
|
||||
|
||||
func (rb *RemoveChainRequest_Body) SetChainId(chainID []byte) {
|
||||
rb.ChainId = chainID
|
||||
}
|
||||
|
||||
func (r *RemoveChainRequest) SetBody(rb *RemoveChainRequest_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *RemoveChainRequest) SetMetaHeader(mh *session.RequestMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *RemoveChainRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
||||
|
||||
func (r *RemoveChainResponse) SetBody(rb *RemoveChainResponse_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *RemoveChainResponse) SetMetaHeader(mh *session.ResponseMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *RemoveChainResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
||||
|
||||
func (r *ListChainsRequest_Body) SetTarget(t *ape.ChainTarget) {
|
||||
r.Target = t
|
||||
}
|
||||
|
||||
func (r *ListChainsRequest) SetBody(rb *ListChainsRequest_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *ListChainsRequest) SetMetaHeader(mh *session.RequestMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *ListChainsRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
||||
|
||||
func (rb *ListChainsResponse_Body) SetChains(chains []*ape.Chain) {
|
||||
rb.Chains = chains
|
||||
}
|
||||
|
||||
func (r *ListChainsResponse) SetBody(rb *ListChainsResponse_Body) {
|
||||
r.Body = rb
|
||||
}
|
||||
|
||||
func (r *ListChainsResponse) SetMetaHeader(mh *session.ResponseMetaHeader) {
|
||||
r.MetaHeader = mh
|
||||
}
|
||||
|
||||
func (r *ListChainsResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) {
|
||||
r.VerifyHeader = vh
|
||||
}
|
1129
apemanager/grpc/service.pb.go
generated
1129
apemanager/grpc/service.pb.go
generated
File diff suppressed because it is too large
Load diff
2183
apemanager/grpc/service_frostfs.pb.go
generated
Normal file
2183
apemanager/grpc/service_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
121
apemanager/grpc/service_frostfs_fuzz.go
Normal file
121
apemanager/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,121 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package apemanager
|
||||
|
||||
func DoFuzzProtoAddChainRequest(data []byte) int {
|
||||
msg := new(AddChainRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONAddChainRequest(data []byte) int {
|
||||
msg := new(AddChainRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoAddChainResponse(data []byte) int {
|
||||
msg := new(AddChainResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONAddChainResponse(data []byte) int {
|
||||
msg := new(AddChainResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoRemoveChainRequest(data []byte) int {
|
||||
msg := new(RemoveChainRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONRemoveChainRequest(data []byte) int {
|
||||
msg := new(RemoveChainRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoRemoveChainResponse(data []byte) int {
|
||||
msg := new(RemoveChainResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONRemoveChainResponse(data []byte) int {
|
||||
msg := new(RemoveChainResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoListChainsRequest(data []byte) int {
|
||||
msg := new(ListChainsRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONListChainsRequest(data []byte) int {
|
||||
msg := new(ListChainsRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoListChainsResponse(data []byte) int {
|
||||
msg := new(ListChainsResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONListChainsResponse(data []byte) int {
|
||||
msg := new(ListChainsResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
71
apemanager/grpc/service_frostfs_test.go
Normal file
71
apemanager/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,71 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package apemanager
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoAddChainRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoAddChainRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONAddChainRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONAddChainRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoAddChainResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoAddChainResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONAddChainResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONAddChainResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoRemoveChainRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoRemoveChainRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONRemoveChainRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONRemoveChainRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoRemoveChainResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoRemoveChainResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONRemoveChainResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONRemoveChainResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoListChainsRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoListChainsRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONListChainsRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONListChainsRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoListChainsResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoListChainsResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONListChainsResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONListChainsResponse(data)
|
||||
})
|
||||
}
|
|
@ -1,234 +0,0 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc"
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
// SetContainer sets container of the request.
|
||||
func (m *PutRequest_Body) SetContainer(v *Container) {
|
||||
m.Container = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the container structure.
|
||||
func (m *PutRequest_Body) SetSignature(v *refs.SignatureRFC6979) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *PutRequest) SetBody(v *PutRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *PutRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *PutRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *PutResponse_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *PutResponse) SetBody(v *PutResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *PutResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *PutResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *DeleteRequest_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the container identifier.
|
||||
func (m *DeleteRequest_Body) SetSignature(v *refs.SignatureRFC6979) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *DeleteRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *DeleteRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *DeleteResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *DeleteResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *GetRequest_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *GetRequest) SetBody(v *GetRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *GetRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *GetRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainer sets the container structure.
|
||||
func (m *GetResponse_Body) SetContainer(v *Container) {
|
||||
m.Container = v
|
||||
}
|
||||
|
||||
// SetSessionToken sets token of the session within which requested
|
||||
// container was created.
|
||||
func (m *GetResponse_Body) SetSessionToken(v *session.SessionToken) {
|
||||
m.SessionToken = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the container structure.
|
||||
func (m *GetResponse_Body) SetSignature(v *refs.SignatureRFC6979) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetResponse) SetBody(v *GetResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *GetResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *GetResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the container owner.
|
||||
func (m *ListRequest_Body) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *ListRequest) SetBody(v *ListRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *ListRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *ListRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerIds sets list of the container identifiers.
|
||||
func (m *ListResponse_Body) SetContainerIds(v []*refs.ContainerID) {
|
||||
m.ContainerIds = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *ListResponse) SetBody(v *ListResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *ListResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *ListResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *GetExtendedACLRequest_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *GetExtendedACLRequest) SetBody(v *GetExtendedACLRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *GetExtendedACLRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *GetExtendedACLRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetEacl sets eACL table structure.
|
||||
func (m *GetExtendedACLResponse_Body) SetEacl(v *acl.EACLTable) {
|
||||
m.Eacl = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the eACL table structure.
|
||||
func (m *GetExtendedACLResponse_Body) SetSignature(v *refs.SignatureRFC6979) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetSessionToken sets token of the session within which requested
|
||||
// eACl table was set.
|
||||
func (m *GetExtendedACLResponse_Body) SetSessionToken(v *session.SessionToken) {
|
||||
m.SessionToken = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *GetExtendedACLResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *GetExtendedACLResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
1909
container/grpc/service.pb.go
generated
1909
container/grpc/service.pb.go
generated
File diff suppressed because it is too large
Load diff
3748
container/grpc/service_frostfs.pb.go
generated
Normal file
3748
container/grpc/service_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
197
container/grpc/service_frostfs_fuzz.go
Normal file
197
container/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,197 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package container
|
||||
|
||||
func DoFuzzProtoPutRequest(data []byte) int {
|
||||
msg := new(PutRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutRequest(data []byte) int {
|
||||
msg := new(PutRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPutResponse(data []byte) int {
|
||||
msg := new(PutResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutResponse(data []byte) int {
|
||||
msg := new(PutResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoDeleteRequest(data []byte) int {
|
||||
msg := new(DeleteRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONDeleteRequest(data []byte) int {
|
||||
msg := new(DeleteRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoDeleteResponse(data []byte) int {
|
||||
msg := new(DeleteResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONDeleteResponse(data []byte) int {
|
||||
msg := new(DeleteResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetRequest(data []byte) int {
|
||||
msg := new(GetRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRequest(data []byte) int {
|
||||
msg := new(GetRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetResponse(data []byte) int {
|
||||
msg := new(GetResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetResponse(data []byte) int {
|
||||
msg := new(GetResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoListRequest(data []byte) int {
|
||||
msg := new(ListRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONListRequest(data []byte) int {
|
||||
msg := new(ListRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoListResponse(data []byte) int {
|
||||
msg := new(ListResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONListResponse(data []byte) int {
|
||||
msg := new(ListResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetExtendedACLRequest(data []byte) int {
|
||||
msg := new(GetExtendedACLRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetExtendedACLRequest(data []byte) int {
|
||||
msg := new(GetExtendedACLRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetExtendedACLResponse(data []byte) int {
|
||||
msg := new(GetExtendedACLResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetExtendedACLResponse(data []byte) int {
|
||||
msg := new(GetExtendedACLResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
111
container/grpc/service_frostfs_test.go
Normal file
111
container/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,111 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package container
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoPutRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPutResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoDeleteRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoDeleteRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONDeleteRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONDeleteRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoDeleteResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoDeleteResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONDeleteResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONDeleteResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoListRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoListRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONListRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONListRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoListResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoListResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONListResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONListResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetExtendedACLRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetExtendedACLRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetExtendedACLRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetExtendedACLRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetExtendedACLResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetExtendedACLResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetExtendedACLResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetExtendedACLResponse(data)
|
||||
})
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc"
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
)
|
||||
|
||||
// SetKey sets key to the container attribute.
|
||||
func (m *Container_Attribute) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the container attribute.
|
||||
func (m *Container_Attribute) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the container owner,
|
||||
func (m *Container) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetNonce sets nonce of the container structure.
|
||||
func (m *Container) SetNonce(v []byte) {
|
||||
m.Nonce = v
|
||||
}
|
||||
|
||||
// SetBasicAcl sets basic ACL of the container.
|
||||
func (m *Container) SetBasicAcl(v uint32) {
|
||||
m.BasicAcl = v
|
||||
}
|
||||
|
||||
// SetAttributes sets list of the container attributes.
|
||||
func (m *Container) SetAttributes(v []*Container_Attribute) {
|
||||
m.Attributes = v
|
||||
}
|
||||
|
||||
// SetPlacementPolicy sets placement policy of the container.
|
||||
func (m *Container) SetPlacementPolicy(v *netmap.PlacementPolicy) {
|
||||
m.PlacementPolicy = v
|
||||
}
|
||||
|
||||
// SetVersion sets version of the container.
|
||||
func (m *Container) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
337
container/grpc/types.pb.go
generated
337
container/grpc/types.pb.go
generated
|
@ -1,337 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: container/grpc/types.proto
|
||||
|
||||
package container
|
||||
|
||||
import (
|
||||
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// 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. An ID of a container is a 32 byte long SHA256
|
||||
// hash of stable-marshalled container message.
|
||||
type Container struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Container format version. Effectively, the version of API library used to
|
||||
// create the container.
|
||||
Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
||||
// Identifier of the container owner
|
||||
OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"`
|
||||
// Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s
|
||||
Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
|
||||
// `BasicACL` contains access control rules for the owner, system and others
|
||||
// groups, as well as permission bits for `BearerToken` and `Extended ACL`
|
||||
BasicAcl uint32 `protobuf:"varint,4,opt,name=basic_acl,json=basicACL,proto3" json:"basic_acl,omitempty"`
|
||||
// Attributes represent immutable container's meta data
|
||||
Attributes []*Container_Attribute `protobuf:"bytes,5,rep,name=attributes,proto3" json:"attributes,omitempty"`
|
||||
// Placement policy for the object inside the container
|
||||
PlacementPolicy *grpc1.PlacementPolicy `protobuf:"bytes,6,opt,name=placement_policy,json=placementPolicy,proto3" json:"placement_policy,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Container) Reset() {
|
||||
*x = Container{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_container_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Container) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Container) ProtoMessage() {}
|
||||
|
||||
func (x *Container) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_container_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Container.ProtoReflect.Descriptor instead.
|
||||
func (*Container) Descriptor() ([]byte, []int) {
|
||||
return file_container_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Container) GetVersion() *grpc.Version {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Container) GetOwnerId() *grpc.OwnerID {
|
||||
if x != nil {
|
||||
return x.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Container) GetNonce() []byte {
|
||||
if x != nil {
|
||||
return x.Nonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Container) GetBasicAcl() uint32 {
|
||||
if x != nil {
|
||||
return x.BasicAcl
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Container) GetAttributes() []*Container_Attribute {
|
||||
if x != nil {
|
||||
return x.Attributes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy {
|
||||
if x != nil {
|
||||
return x.PlacementPolicy
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// `Attribute` is a user-defined Key-Value metadata pair attached to the
|
||||
// container. Container attributes are immutable. They are set at the moment
|
||||
// of container creation and can never be added or updated.
|
||||
//
|
||||
// Key name must be a container-unique valid UTF-8 string. Value can't be
|
||||
// empty. Containers with duplicated attribute names or attributes with empty
|
||||
// values will be considered invalid.
|
||||
//
|
||||
// There are some "well-known" attributes affecting system behaviour:
|
||||
//
|
||||
// - [ __SYSTEM__NAME ] \
|
||||
// (`__NEOFS__NAME` is deprecated) \
|
||||
// String of a human-friendly container name registered as a domain in
|
||||
// NNS contract.
|
||||
// - [ __SYSTEM__ZONE ] \
|
||||
// (`__NEOFS__ZONE` is deprecated) \
|
||||
// String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated).
|
||||
// Used as a TLD of a domain name in NNS contract. If no zone is specified,
|
||||
// use default zone: `container`.
|
||||
// - [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \
|
||||
// (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \
|
||||
// Disables homomorphic hashing for the container if the value equals "true"
|
||||
// string. Any other values are interpreted as missing attribute. Container
|
||||
// could be accepted in a NeoFS network only if the global network hashing
|
||||
// configuration value corresponds with that attribute's value. After
|
||||
// container inclusion, network setting is ignored.
|
||||
//
|
||||
// And some well-known attributes used by applications only:
|
||||
//
|
||||
// - Name \
|
||||
// Human-friendly name
|
||||
// - Timestamp \
|
||||
// User-defined local time of container creation in Unix Timestamp format
|
||||
type Container_Attribute struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Attribute name key
|
||||
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
// Attribute value
|
||||
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Container_Attribute) Reset() {
|
||||
*x = Container_Attribute{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_container_grpc_types_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Container_Attribute) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Container_Attribute) ProtoMessage() {}
|
||||
|
||||
func (x *Container_Attribute) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_container_grpc_types_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Container_Attribute.ProtoReflect.Descriptor instead.
|
||||
func (*Container_Attribute) Descriptor() ([]byte, []int) {
|
||||
return file_container_grpc_types_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *Container_Attribute) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Container_Attribute) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_container_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_container_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x6e, 0x65,
|
||||
0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||
0x72, 0x1a, 0x17, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74,
|
||||
0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73,
|
||||
0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0xf2, 0x02, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12,
|
||||
0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66,
|
||||
0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f,
|
||||
0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09,
|
||||
0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52,
|
||||
0x08, 0x62, 0x61, 0x73, 0x69, 0x63, 0x41, 0x43, 0x4c, 0x12, 0x48, 0x0a, 0x0a, 0x61, 0x74, 0x74,
|
||||
0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x74,
|
||||
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
|
||||
0x74, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70,
|
||||
0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
|
||||
0x52, 0x0f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63,
|
||||
0x79, 0x1a, 0x33, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x6a, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72,
|
||||
0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43,
|
||||
0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d,
|
||||
0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
|
||||
0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f,
|
||||
0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
|
||||
0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_container_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_container_grpc_types_proto_rawDescData = file_container_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_container_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_container_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_container_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_container_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_container_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_container_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_container_grpc_types_proto_goTypes = []interface{}{
|
||||
(*Container)(nil), // 0: neo.fs.v2.container.Container
|
||||
(*Container_Attribute)(nil), // 1: neo.fs.v2.container.Container.Attribute
|
||||
(*grpc.Version)(nil), // 2: neo.fs.v2.refs.Version
|
||||
(*grpc.OwnerID)(nil), // 3: neo.fs.v2.refs.OwnerID
|
||||
(*grpc1.PlacementPolicy)(nil), // 4: neo.fs.v2.netmap.PlacementPolicy
|
||||
}
|
||||
var file_container_grpc_types_proto_depIdxs = []int32{
|
||||
2, // 0: neo.fs.v2.container.Container.version:type_name -> neo.fs.v2.refs.Version
|
||||
3, // 1: neo.fs.v2.container.Container.owner_id:type_name -> neo.fs.v2.refs.OwnerID
|
||||
1, // 2: neo.fs.v2.container.Container.attributes:type_name -> neo.fs.v2.container.Container.Attribute
|
||||
4, // 3: neo.fs.v2.container.Container.placement_policy:type_name -> neo.fs.v2.netmap.PlacementPolicy
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_container_grpc_types_proto_init() }
|
||||
func file_container_grpc_types_proto_init() {
|
||||
if File_container_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_container_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Container); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_container_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Container_Attribute); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_container_grpc_types_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_container_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_container_grpc_types_proto_depIdxs,
|
||||
MessageInfos: file_container_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_container_grpc_types_proto = out.File
|
||||
file_container_grpc_types_proto_rawDesc = nil
|
||||
file_container_grpc_types_proto_goTypes = nil
|
||||
file_container_grpc_types_proto_depIdxs = nil
|
||||
}
|
495
container/grpc/types_frostfs.pb.go
generated
Normal file
495
container/grpc/types_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,495 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package container
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
)
|
||||
|
||||
type Container_Attribute struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Container_Attribute)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Container_Attribute)(nil)
|
||||
_ json.Marshaler = (*Container_Attribute)(nil)
|
||||
_ json.Unmarshaler = (*Container_Attribute)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Container_Attribute) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.StringSize(1, x.Key)
|
||||
size += proto.StringSize(2, x.Value)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Container_Attribute) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Container_Attribute) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if len(x.Key) != 0 {
|
||||
mm.AppendString(1, x.Key)
|
||||
}
|
||||
if len(x.Value) != 0 {
|
||||
mm.AppendString(2, x.Value)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Container_Attribute) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Container_Attribute")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Key
|
||||
data, ok := fc.String()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Key")
|
||||
}
|
||||
x.Key = data
|
||||
case 2: // Value
|
||||
data, ok := fc.String()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Value")
|
||||
}
|
||||
x.Value = data
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container_Attribute) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (x *Container_Attribute) SetKey(v string) {
|
||||
x.Key = v
|
||||
}
|
||||
func (x *Container_Attribute) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (x *Container_Attribute) SetValue(v string) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Container_Attribute) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"key\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.String(x.Key)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"value\":"
|
||||
out.RawString(prefix)
|
||||
out.String(x.Value)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Container_Attribute) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Container_Attribute) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "key":
|
||||
{
|
||||
var f string
|
||||
f = in.String()
|
||||
x.Key = f
|
||||
}
|
||||
case "value":
|
||||
{
|
||||
var f string
|
||||
f = in.String()
|
||||
x.Value = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type Container struct {
|
||||
Version *grpc.Version `json:"version"`
|
||||
OwnerId *grpc.OwnerID `json:"ownerID"`
|
||||
Nonce []byte `json:"nonce"`
|
||||
BasicAcl uint32 `json:"basicACL"`
|
||||
Attributes []*Container_Attribute `json:"attributes"`
|
||||
PlacementPolicy *grpc1.PlacementPolicy `json:"placementPolicy"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Container)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Container)(nil)
|
||||
_ json.Marshaler = (*Container)(nil)
|
||||
_ json.Unmarshaler = (*Container)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Container) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.Version)
|
||||
size += proto.NestedStructureSize(2, x.OwnerId)
|
||||
size += proto.BytesSize(3, x.Nonce)
|
||||
size += proto.UInt32Size(4, x.BasicAcl)
|
||||
for i := range x.Attributes {
|
||||
size += proto.NestedStructureSize(5, x.Attributes[i])
|
||||
}
|
||||
size += proto.NestedStructureSize(6, x.PlacementPolicy)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Container) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Container) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Version != nil && x.Version.StableSize() != 0 {
|
||||
x.Version.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
|
||||
x.OwnerId.EmitProtobuf(mm.AppendMessage(2))
|
||||
}
|
||||
if len(x.Nonce) != 0 {
|
||||
mm.AppendBytes(3, x.Nonce)
|
||||
}
|
||||
if x.BasicAcl != 0 {
|
||||
mm.AppendUint32(4, x.BasicAcl)
|
||||
}
|
||||
for i := range x.Attributes {
|
||||
if x.Attributes[i] != nil && x.Attributes[i].StableSize() != 0 {
|
||||
x.Attributes[i].EmitProtobuf(mm.AppendMessage(5))
|
||||
}
|
||||
}
|
||||
if x.PlacementPolicy != nil && x.PlacementPolicy.StableSize() != 0 {
|
||||
x.PlacementPolicy.EmitProtobuf(mm.AppendMessage(6))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Container) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Container")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Version
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Version")
|
||||
}
|
||||
x.Version = new(grpc.Version)
|
||||
if err := x.Version.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 2: // OwnerId
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "OwnerId")
|
||||
}
|
||||
x.OwnerId = new(grpc.OwnerID)
|
||||
if err := x.OwnerId.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 3: // Nonce
|
||||
data, ok := fc.Bytes()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Nonce")
|
||||
}
|
||||
x.Nonce = data
|
||||
case 4: // BasicAcl
|
||||
data, ok := fc.Uint32()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "BasicAcl")
|
||||
}
|
||||
x.BasicAcl = data
|
||||
case 5: // Attributes
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Attributes")
|
||||
}
|
||||
x.Attributes = append(x.Attributes, new(Container_Attribute))
|
||||
ff := x.Attributes[len(x.Attributes)-1]
|
||||
if err := ff.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 6: // PlacementPolicy
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "PlacementPolicy")
|
||||
}
|
||||
x.PlacementPolicy = new(grpc1.PlacementPolicy)
|
||||
if err := x.PlacementPolicy.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) GetVersion() *grpc.Version {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) SetVersion(v *grpc.Version) {
|
||||
x.Version = v
|
||||
}
|
||||
func (x *Container) GetOwnerId() *grpc.OwnerID {
|
||||
if x != nil {
|
||||
return x.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) SetOwnerId(v *grpc.OwnerID) {
|
||||
x.OwnerId = v
|
||||
}
|
||||
func (x *Container) GetNonce() []byte {
|
||||
if x != nil {
|
||||
return x.Nonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) SetNonce(v []byte) {
|
||||
x.Nonce = v
|
||||
}
|
||||
func (x *Container) GetBasicAcl() uint32 {
|
||||
if x != nil {
|
||||
return x.BasicAcl
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *Container) SetBasicAcl(v uint32) {
|
||||
x.BasicAcl = v
|
||||
}
|
||||
func (x *Container) GetAttributes() []*Container_Attribute {
|
||||
if x != nil {
|
||||
return x.Attributes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) SetAttributes(v []*Container_Attribute) {
|
||||
x.Attributes = v
|
||||
}
|
||||
func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy {
|
||||
if x != nil {
|
||||
return x.PlacementPolicy
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Container) SetPlacementPolicy(v *grpc1.PlacementPolicy) {
|
||||
x.PlacementPolicy = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Container) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"version\":"
|
||||
out.RawString(prefix[1:])
|
||||
x.Version.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"ownerID\":"
|
||||
out.RawString(prefix)
|
||||
x.OwnerId.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"nonce\":"
|
||||
out.RawString(prefix)
|
||||
out.Base64Bytes(x.Nonce)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"basicACL\":"
|
||||
out.RawString(prefix)
|
||||
out.Uint32(x.BasicAcl)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"attributes\":"
|
||||
out.RawString(prefix)
|
||||
out.RawByte('[')
|
||||
for i := range x.Attributes {
|
||||
if i != 0 {
|
||||
out.RawByte(',')
|
||||
}
|
||||
x.Attributes[i].MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte(']')
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"placementPolicy\":"
|
||||
out.RawString(prefix)
|
||||
x.PlacementPolicy.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Container) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Container) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "version":
|
||||
{
|
||||
var f *grpc.Version
|
||||
f = new(grpc.Version)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.Version = f
|
||||
}
|
||||
case "ownerID":
|
||||
{
|
||||
var f *grpc.OwnerID
|
||||
f = new(grpc.OwnerID)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.OwnerId = f
|
||||
}
|
||||
case "nonce":
|
||||
{
|
||||
var f []byte
|
||||
f = in.Bytes()
|
||||
x.Nonce = f
|
||||
}
|
||||
case "basicACL":
|
||||
{
|
||||
var f uint32
|
||||
f = in.Uint32()
|
||||
x.BasicAcl = f
|
||||
}
|
||||
case "attributes":
|
||||
{
|
||||
var f *Container_Attribute
|
||||
var list []*Container_Attribute
|
||||
in.Delim('[')
|
||||
for !in.IsDelim(']') {
|
||||
f = new(Container_Attribute)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
list = append(list, f)
|
||||
in.WantComma()
|
||||
}
|
||||
x.Attributes = list
|
||||
in.Delim(']')
|
||||
}
|
||||
case "placementPolicy":
|
||||
{
|
||||
var f *grpc1.PlacementPolicy
|
||||
f = new(grpc1.PlacementPolicy)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.PlacementPolicy = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
26
container/grpc/types_frostfs_fuzz.go
Normal file
26
container/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package container
|
||||
|
||||
func DoFuzzProtoContainer(data []byte) int {
|
||||
msg := new(Container)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONContainer(data []byte) int {
|
||||
msg := new(Container)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
21
container/grpc/types_frostfs_test.go
Normal file
21
container/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package container
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoContainer(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoContainer(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONContainer(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONContainer(data)
|
||||
})
|
||||
}
|
3
go.mod
3
go.mod
|
@ -4,6 +4,8 @@ go 1.20
|
|||
|
||||
require (
|
||||
git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0
|
||||
github.com/VictoriaMetrics/easyproto v0.1.4
|
||||
github.com/mailru/easyjson v0.7.7
|
||||
github.com/stretchr/testify v1.8.3
|
||||
golang.org/x/sync v0.6.0
|
||||
google.golang.org/grpc v1.63.2
|
||||
|
@ -13,6 +15,7 @@ require (
|
|||
require (
|
||||
git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/kr/pretty v0.1.0 // indirect
|
||||
github.com/mr-tron/base58 v1.2.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
|
|
6
go.sum
6
go.sum
|
@ -2,15 +2,21 @@ git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSV
|
|||
git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0/go.mod h1:RUIKZATQLJ+TaYQa60X2fTDwfuhMfm8Ar60bQ5fr+vU=
|
||||
git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9mwVfJ+SjT3HA=
|
||||
git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc=
|
||||
github.com/VictoriaMetrics/easyproto v0.1.4 h1:r8cNvo8o6sR4QShBXQd1bKw/VVLSQma/V2KhTBPf+Sc=
|
||||
github.com/VictoriaMetrics/easyproto v0.1.4/go.mod h1:QlGlzaJnDfFd8Lk6Ci/fuLxfTo3/GThPs2KH23mv710=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
|
||||
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package lock
|
||||
|
||||
import refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
|
||||
// SetMembers sets `members` field.
|
||||
func (x *Lock) SetMembers(ids []*refs.ObjectID) {
|
||||
x.Members = ids
|
||||
}
|
160
lock/grpc/types.pb.go
generated
160
lock/grpc/types.pb.go
generated
|
@ -1,160 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: lock/grpc/types.proto
|
||||
|
||||
package lock
|
||||
|
||||
import (
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Lock objects protects a list of objects from being deleted. The lifetime of a
|
||||
// lock object is limited similar to regular objects in
|
||||
// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated)
|
||||
// attribute. Lock object MUST have expiration epoch. It is impossible to delete
|
||||
// a lock object via ObjectService.Delete RPC call.
|
||||
type Lock struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// List of objects to lock. Must not be empty or carry empty IDs.
|
||||
// All members must be of the `REGULAR` type.
|
||||
Members []*grpc.ObjectID `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Lock) Reset() {
|
||||
*x = Lock{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_lock_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Lock) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Lock) ProtoMessage() {}
|
||||
|
||||
func (x *Lock) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_lock_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Lock.ProtoReflect.Descriptor instead.
|
||||
func (*Lock) Descriptor() ([]byte, []int) {
|
||||
return file_lock_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Lock) GetMembers() []*grpc.ObjectID {
|
||||
if x != nil {
|
||||
return x.Members
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_lock_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_lock_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x15, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65,
|
||||
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72,
|
||||
0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a,
|
||||
0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73,
|
||||
0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49,
|
||||
0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69,
|
||||
0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54,
|
||||
0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73,
|
||||
0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0xaa, 0x02, 0x18, 0x4e,
|
||||
0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41,
|
||||
0x50, 0x49, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_lock_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_lock_grpc_types_proto_rawDescData = file_lock_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_lock_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_lock_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_lock_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_lock_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_lock_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_lock_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_lock_grpc_types_proto_goTypes = []interface{}{
|
||||
(*Lock)(nil), // 0: neo.fs.v2.lock.Lock
|
||||
(*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID
|
||||
}
|
||||
var file_lock_grpc_types_proto_depIdxs = []int32{
|
||||
1, // 0: neo.fs.v2.lock.Lock.members:type_name -> neo.fs.v2.refs.ObjectID
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_lock_grpc_types_proto_init() }
|
||||
func file_lock_grpc_types_proto_init() {
|
||||
if File_lock_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_lock_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Lock); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_lock_grpc_types_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_lock_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_lock_grpc_types_proto_depIdxs,
|
||||
MessageInfos: file_lock_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_lock_grpc_types_proto = out.File
|
||||
file_lock_grpc_types_proto_rawDesc = nil
|
||||
file_lock_grpc_types_proto_goTypes = nil
|
||||
file_lock_grpc_types_proto_depIdxs = nil
|
||||
}
|
167
lock/grpc/types_frostfs.pb.go
generated
Normal file
167
lock/grpc/types_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,167 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package lock
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
)
|
||||
|
||||
type Lock struct {
|
||||
Members []*grpc.ObjectID `json:"members"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Lock)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Lock)(nil)
|
||||
_ json.Marshaler = (*Lock)(nil)
|
||||
_ json.Unmarshaler = (*Lock)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Lock) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
for i := range x.Members {
|
||||
size += proto.NestedStructureSize(1, x.Members[i])
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Lock) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Lock) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
for i := range x.Members {
|
||||
if x.Members[i] != nil && x.Members[i].StableSize() != 0 {
|
||||
x.Members[i].EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Lock) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Lock")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Members
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Members")
|
||||
}
|
||||
x.Members = append(x.Members, new(grpc.ObjectID))
|
||||
ff := x.Members[len(x.Members)-1]
|
||||
if err := ff.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Lock) GetMembers() []*grpc.ObjectID {
|
||||
if x != nil {
|
||||
return x.Members
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Lock) SetMembers(v []*grpc.ObjectID) {
|
||||
x.Members = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Lock) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"members\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.RawByte('[')
|
||||
for i := range x.Members {
|
||||
if i != 0 {
|
||||
out.RawByte(',')
|
||||
}
|
||||
x.Members[i].MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte(']')
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Lock) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Lock) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "members":
|
||||
{
|
||||
var f *grpc.ObjectID
|
||||
var list []*grpc.ObjectID
|
||||
in.Delim('[')
|
||||
for !in.IsDelim(']') {
|
||||
f = new(grpc.ObjectID)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
list = append(list, f)
|
||||
in.WantComma()
|
||||
}
|
||||
x.Members = list
|
||||
in.Delim(']')
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
26
lock/grpc/types_frostfs_fuzz.go
Normal file
26
lock/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package lock
|
||||
|
||||
func DoFuzzProtoLock(data []byte) int {
|
||||
msg := new(Lock)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONLock(data []byte) int {
|
||||
msg := new(Lock)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
21
lock/grpc/types_frostfs_test.go
Normal file
21
lock/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package lock
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoLock(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoLock(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONLock(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONLock(data)
|
||||
})
|
||||
}
|
|
@ -1,116 +0,0 @@
|
|||
package netmap
|
||||
|
||||
import (
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *LocalNodeInfoRequest) SetBody(v *LocalNodeInfoRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *LocalNodeInfoRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *LocalNodeInfoRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetVersion sets version of response body.
|
||||
func (m *LocalNodeInfoResponse_Body) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetNodeInfo sets node info of response body.
|
||||
func (m *LocalNodeInfoResponse_Body) SetNodeInfo(v *NodeInfo) {
|
||||
m.NodeInfo = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *LocalNodeInfoResponse) SetBody(v *LocalNodeInfoResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *LocalNodeInfoResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *LocalNodeInfoResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (x *NetworkInfoRequest) SetBody(v *NetworkInfoRequest_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (x *NetworkInfoRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (x *NetworkInfoRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetNetworkInfo sets information about the network.
|
||||
func (x *NetworkInfoResponse_Body) SetNetworkInfo(v *NetworkInfo) {
|
||||
x.NetworkInfo = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (x *NetworkInfoResponse) SetBody(v *NetworkInfoResponse_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (x *NetworkInfoResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (x *NetworkInfoResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (x *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (x *NetmapSnapshotRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (x *NetmapSnapshotRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetNetmap sets current Netmap.
|
||||
func (x *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) {
|
||||
x.Netmap = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (x *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (x *NetmapSnapshotResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (x *NetmapSnapshotResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
1108
netmap/grpc/service.pb.go
generated
1108
netmap/grpc/service.pb.go
generated
File diff suppressed because it is too large
Load diff
2061
netmap/grpc/service_frostfs.pb.go
generated
Normal file
2061
netmap/grpc/service_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
121
netmap/grpc/service_frostfs_fuzz.go
Normal file
121
netmap/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,121 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
func DoFuzzProtoLocalNodeInfoRequest(data []byte) int {
|
||||
msg := new(LocalNodeInfoRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONLocalNodeInfoRequest(data []byte) int {
|
||||
msg := new(LocalNodeInfoRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoLocalNodeInfoResponse(data []byte) int {
|
||||
msg := new(LocalNodeInfoResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONLocalNodeInfoResponse(data []byte) int {
|
||||
msg := new(LocalNodeInfoResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkInfoRequest(data []byte) int {
|
||||
msg := new(NetworkInfoRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkInfoRequest(data []byte) int {
|
||||
msg := new(NetworkInfoRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkInfoResponse(data []byte) int {
|
||||
msg := new(NetworkInfoResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkInfoResponse(data []byte) int {
|
||||
msg := new(NetworkInfoResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetmapSnapshotRequest(data []byte) int {
|
||||
msg := new(NetmapSnapshotRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetmapSnapshotRequest(data []byte) int {
|
||||
msg := new(NetmapSnapshotRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetmapSnapshotResponse(data []byte) int {
|
||||
msg := new(NetmapSnapshotResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetmapSnapshotResponse(data []byte) int {
|
||||
msg := new(NetmapSnapshotResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
71
netmap/grpc/service_frostfs_test.go
Normal file
71
netmap/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,71 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoLocalNodeInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoLocalNodeInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONLocalNodeInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONLocalNodeInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoLocalNodeInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoLocalNodeInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONLocalNodeInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONLocalNodeInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetmapSnapshotRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetmapSnapshotRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetmapSnapshotRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetmapSnapshotRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetmapSnapshotResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetmapSnapshotResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetmapSnapshotResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetmapSnapshotResponse(data)
|
||||
})
|
||||
}
|
|
@ -1,212 +0,0 @@
|
|||
package netmap
|
||||
|
||||
// SetReplicas of placement policy.
|
||||
func (m *PlacementPolicy) SetReplicas(v []*Replica) {
|
||||
m.Replicas = v
|
||||
}
|
||||
|
||||
// SetContainerBackupFactor of placement policy.
|
||||
func (m *PlacementPolicy) SetContainerBackupFactor(v uint32) {
|
||||
m.ContainerBackupFactor = v
|
||||
}
|
||||
|
||||
// SetSelectors of placement policy.
|
||||
func (m *PlacementPolicy) SetSelectors(v []*Selector) {
|
||||
m.Selectors = v
|
||||
}
|
||||
|
||||
// SetFilters of placement policy.
|
||||
func (m *PlacementPolicy) SetFilters(v []*Filter) {
|
||||
m.Filters = v
|
||||
}
|
||||
|
||||
// SetUnique of placement policy.
|
||||
func (m *PlacementPolicy) SetUnique(unique bool) {
|
||||
m.Unique = unique
|
||||
}
|
||||
|
||||
// SetName of placement filter.
|
||||
func (m *Filter) SetName(v string) {
|
||||
m.Name = v
|
||||
}
|
||||
|
||||
// SetKey of placement filter.
|
||||
func (m *Filter) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetOperation of placement filter.
|
||||
func (m *Filter) SetOp(v Operation) {
|
||||
m.Op = v
|
||||
}
|
||||
|
||||
// SetValue of placement filter.
|
||||
func (m *Filter) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetFilters sets sub-filters of placement filter.
|
||||
func (m *Filter) SetFilters(v []*Filter) {
|
||||
m.Filters = v
|
||||
}
|
||||
|
||||
// SetName of placement selector.
|
||||
func (m *Selector) SetName(v string) {
|
||||
m.Name = v
|
||||
}
|
||||
|
||||
// SetCount of nodes of placement selector.
|
||||
func (m *Selector) SetCount(v uint32) {
|
||||
m.Count = v
|
||||
}
|
||||
|
||||
// SetAttribute of nodes of placement selector.
|
||||
func (m *Selector) SetAttribute(v string) {
|
||||
m.Attribute = v
|
||||
}
|
||||
|
||||
// SetFilter of placement selector.
|
||||
func (m *Selector) SetFilter(v string) {
|
||||
m.Filter = v
|
||||
}
|
||||
|
||||
// SetClause of placement selector.
|
||||
func (m *Selector) SetClause(v Clause) {
|
||||
m.Clause = v
|
||||
}
|
||||
|
||||
// SetCount of object replica.
|
||||
func (m *Replica) SetCount(v uint32) {
|
||||
m.Count = v
|
||||
}
|
||||
|
||||
// SetSelector of object replica.
|
||||
func (m *Replica) SetSelector(v string) {
|
||||
m.Selector = v
|
||||
}
|
||||
|
||||
// SetKey sets key to the node attribute.
|
||||
func (m *NodeInfo_Attribute) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the node attribute.
|
||||
func (m *NodeInfo_Attribute) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetParent sets value of the node parents.
|
||||
func (m *NodeInfo_Attribute) SetParents(v []string) {
|
||||
m.Parents = v
|
||||
}
|
||||
|
||||
// SetAddress sets node network address.
|
||||
//
|
||||
// Deprecated: use SetAddresses.
|
||||
func (m *NodeInfo) SetAddress(v string) {
|
||||
m.SetAddresses([]string{v})
|
||||
}
|
||||
|
||||
// SetAddresses sets list of network addresses of the node.
|
||||
func (m *NodeInfo) SetAddresses(v []string) {
|
||||
m.Addresses = v
|
||||
}
|
||||
|
||||
// SetPublicKey sets node public key in a binary format.
|
||||
func (m *NodeInfo) SetPublicKey(v []byte) {
|
||||
m.PublicKey = v
|
||||
}
|
||||
|
||||
// SetAttributes sets list of the node attributes.
|
||||
func (m *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) {
|
||||
m.Attributes = v
|
||||
}
|
||||
|
||||
// SetState sets node state.
|
||||
func (m *NodeInfo) SetState(v NodeInfo_State) {
|
||||
m.State = v
|
||||
}
|
||||
|
||||
// SetCurrentEpoch sets number of the current epoch.
|
||||
func (x *NetworkInfo) SetCurrentEpoch(v uint64) {
|
||||
x.CurrentEpoch = v
|
||||
}
|
||||
|
||||
// SetMagicNumber sets magic number of the sidechain.
|
||||
func (x *NetworkInfo) SetMagicNumber(v uint64) {
|
||||
x.MagicNumber = v
|
||||
}
|
||||
|
||||
// SetMsPerBlock sets MillisecondsPerBlock network parameter.
|
||||
func (x *NetworkInfo) SetMsPerBlock(v int64) {
|
||||
x.MsPerBlock = v
|
||||
}
|
||||
|
||||
// SetNetworkConfig sets NeoFS network configuration.
|
||||
func (x *NetworkInfo) SetNetworkConfig(v *NetworkConfig) {
|
||||
x.NetworkConfig = v
|
||||
}
|
||||
|
||||
// FromString parses Clause from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Clause) FromString(s string) bool {
|
||||
i, ok := Clause_value[s]
|
||||
if ok {
|
||||
*x = Clause(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses Operation from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Operation) FromString(s string) bool {
|
||||
i, ok := Operation_value[s]
|
||||
if ok {
|
||||
*x = Operation(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses NodeInfo_State from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *NodeInfo_State) FromString(s string) bool {
|
||||
i, ok := NodeInfo_State_value[s]
|
||||
if ok {
|
||||
*x = NodeInfo_State(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetKey sets parameter key.
|
||||
func (x *NetworkConfig_Parameter) SetKey(v []byte) {
|
||||
x.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets parameter value.
|
||||
func (x *NetworkConfig_Parameter) SetValue(v []byte) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// SetParameters sets NeoFS network parameters.
|
||||
func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) {
|
||||
x.Parameters = v
|
||||
}
|
||||
|
||||
// SetEpoch sets revision number of the Netmap.
|
||||
func (x *Netmap) SetEpoch(v uint64) {
|
||||
x.Epoch = v
|
||||
}
|
||||
|
||||
// SetNodes sets nodes presented in the Netmap.
|
||||
func (x *Netmap) SetNodes(v []*NodeInfo) {
|
||||
x.Nodes = v
|
||||
}
|
1371
netmap/grpc/types.pb.go
generated
1371
netmap/grpc/types.pb.go
generated
File diff suppressed because it is too large
Load diff
2453
netmap/grpc/types_frostfs.pb.go
generated
Normal file
2453
netmap/grpc/types_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
159
netmap/grpc/types_frostfs_fuzz.go
Normal file
159
netmap/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,159 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
func DoFuzzProtoFilter(data []byte) int {
|
||||
msg := new(Filter)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONFilter(data []byte) int {
|
||||
msg := new(Filter)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSelector(data []byte) int {
|
||||
msg := new(Selector)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSelector(data []byte) int {
|
||||
msg := new(Selector)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoReplica(data []byte) int {
|
||||
msg := new(Replica)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONReplica(data []byte) int {
|
||||
msg := new(Replica)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPlacementPolicy(data []byte) int {
|
||||
msg := new(PlacementPolicy)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPlacementPolicy(data []byte) int {
|
||||
msg := new(PlacementPolicy)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNodeInfo(data []byte) int {
|
||||
msg := new(NodeInfo)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNodeInfo(data []byte) int {
|
||||
msg := new(NodeInfo)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetmap(data []byte) int {
|
||||
msg := new(Netmap)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetmap(data []byte) int {
|
||||
msg := new(Netmap)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkConfig(data []byte) int {
|
||||
msg := new(NetworkConfig)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkConfig(data []byte) int {
|
||||
msg := new(NetworkConfig)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkInfo(data []byte) int {
|
||||
msg := new(NetworkInfo)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkInfo(data []byte) int {
|
||||
msg := new(NetworkInfo)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
91
netmap/grpc/types_frostfs_test.go
Normal file
91
netmap/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,91 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoFilter(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoFilter(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONFilter(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONFilter(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSelector(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSelector(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSelector(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSelector(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoReplica(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoReplica(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONReplica(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONReplica(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPlacementPolicy(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPlacementPolicy(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPlacementPolicy(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPlacementPolicy(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNodeInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNodeInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNodeInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNodeInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetmap(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetmap(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetmap(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetmap(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkConfig(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkConfig(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkConfig(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkConfig(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkInfo(data)
|
||||
})
|
||||
}
|
|
@ -2491,7 +2491,7 @@ func (r *PatchResponseBody) ToGRPCMessage() grpc.Message {
|
|||
if r != nil {
|
||||
m = new(object.PatchResponse_Body)
|
||||
|
||||
m.SetObjectID(r.ObjectID.ToGRPCMessage().(*refsGRPC.ObjectID))
|
||||
m.SetObjectId(r.ObjectID.ToGRPCMessage().(*refsGRPC.ObjectID))
|
||||
}
|
||||
|
||||
return m
|
||||
|
|
|
@ -1,610 +0,0 @@
|
|||
package object
|
||||
|
||||
import (
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
// SetAddress sets address of the requested object.
|
||||
func (m *GetRequest_Body) SetAddress(v *refs.Address) {
|
||||
m.Address = v
|
||||
}
|
||||
|
||||
// SetRaw sets raw flag of the request.
|
||||
func (m *GetRequest_Body) SetRaw(v bool) {
|
||||
m.Raw = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *GetRequest) SetBody(v *GetRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *GetRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *GetRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetObjectId sets identifier of the object.
|
||||
func (m *GetResponse_Body_Init) SetObjectId(v *refs.ObjectID) {
|
||||
m.ObjectId = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the object identifier.
|
||||
func (m *GetResponse_Body_Init) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetHeader sets header of the object.
|
||||
func (m *GetResponse_Body_Init) SetHeader(v *Header) {
|
||||
m.Header = v
|
||||
}
|
||||
|
||||
// GetChunk returns chunk of the object payload bytes.
|
||||
func (m *GetResponse_Body_Chunk) GetChunk() []byte {
|
||||
if m != nil {
|
||||
return m.Chunk
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetChunk sets chunk of the object payload bytes.
|
||||
func (m *GetResponse_Body_Chunk) SetChunk(v []byte) {
|
||||
m.Chunk = v
|
||||
}
|
||||
|
||||
// SetInit sets initial part of the object.
|
||||
func (m *GetResponse_Body) SetInit(v *GetResponse_Body_Init) {
|
||||
m.ObjectPart = &GetResponse_Body_Init_{
|
||||
Init: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetChunk sets part of the object payload.
|
||||
func (m *GetResponse_Body) SetChunk(v *GetResponse_Body_Chunk) {
|
||||
m.ObjectPart = v
|
||||
}
|
||||
|
||||
// SetSplitInfo sets part of the object payload.
|
||||
func (m *GetResponse_Body) SetSplitInfo(v *SplitInfo) {
|
||||
m.ObjectPart = &GetResponse_Body_SplitInfo{
|
||||
SplitInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetEcInfo sets part of the object payload.
|
||||
func (m *GetResponse_Body) SetEcInfo(v *ECInfo) {
|
||||
m.ObjectPart = &GetResponse_Body_EcInfo{
|
||||
EcInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetResponse) SetBody(v *GetResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *GetResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *GetResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetObjectId sets identifier of the object.
|
||||
func (m *PutRequest_Body_Init) SetObjectId(v *refs.ObjectID) {
|
||||
m.ObjectId = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the object identifier.
|
||||
func (m *PutRequest_Body_Init) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetHeader sets header of the object.
|
||||
func (m *PutRequest_Body_Init) SetHeader(v *Header) {
|
||||
m.Header = v
|
||||
}
|
||||
|
||||
// SetCopiesNumber sets number of the copies to save.
|
||||
func (m *PutRequest_Body_Init) SetCopiesNumber(v []uint32) {
|
||||
m.CopiesNumber = v
|
||||
}
|
||||
|
||||
// GetChunk returns chunk of the object payload bytes.
|
||||
func (m *PutRequest_Body_Chunk) GetChunk() []byte {
|
||||
if m != nil {
|
||||
return m.Chunk
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetChunk sets chunk of the object payload bytes.
|
||||
func (m *PutRequest_Body_Chunk) SetChunk(v []byte) {
|
||||
m.Chunk = v
|
||||
}
|
||||
|
||||
// SetInit sets initial part of the object.
|
||||
func (m *PutRequest_Body) SetInit(v *PutRequest_Body_Init) {
|
||||
m.ObjectPart = &PutRequest_Body_Init_{
|
||||
Init: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetChunk sets part of the object payload.
|
||||
func (m *PutRequest_Body) SetChunk(v *PutRequest_Body_Chunk) {
|
||||
m.ObjectPart = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *PutRequest) SetBody(v *PutRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *PutRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *PutRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetObjectId sets identifier of the saved object.
|
||||
func (m *PutResponse_Body) SetObjectId(v *refs.ObjectID) {
|
||||
m.ObjectId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *PutResponse) SetBody(v *PutResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *PutResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *PutResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetAddress sets address of the object to delete.
|
||||
func (m *DeleteRequest_Body) SetAddress(v *refs.Address) {
|
||||
m.Address = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *DeleteRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *DeleteRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetTombstone sets tombstone address.
|
||||
func (x *DeleteResponse_Body) SetTombstone(v *refs.Address) {
|
||||
x.Tombstone = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *DeleteResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *DeleteResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetAddress sets address of the object with the requested header.
|
||||
func (m *HeadRequest_Body) SetAddress(v *refs.Address) {
|
||||
m.Address = v
|
||||
}
|
||||
|
||||
// SetMainOnly sets flag to return the minimal header subset.
|
||||
func (m *HeadRequest_Body) SetMainOnly(v bool) {
|
||||
m.MainOnly = v
|
||||
}
|
||||
|
||||
// SetRaw sets raw flag of the request.
|
||||
func (m *HeadRequest_Body) SetRaw(v bool) {
|
||||
m.Raw = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *HeadRequest) SetBody(v *HeadRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *HeadRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *HeadRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetHeader sets object header.
|
||||
func (m *HeaderWithSignature) SetHeader(v *Header) {
|
||||
m.Header = v
|
||||
}
|
||||
|
||||
// SetSignature of the header.
|
||||
func (m *HeaderWithSignature) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetHeader sets full header of the object.
|
||||
func (m *HeadResponse_Body) SetHeader(v *HeaderWithSignature) {
|
||||
m.Head = &HeadResponse_Body_Header{
|
||||
Header: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetShortHeader sets short header of the object.
|
||||
func (m *HeadResponse_Body) SetShortHeader(v *ShortHeader) {
|
||||
m.Head = &HeadResponse_Body_ShortHeader{
|
||||
ShortHeader: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetSplitInfo sets meta info about split hierarchy of the object.
|
||||
func (m *HeadResponse_Body) SetSplitInfo(v *SplitInfo) {
|
||||
m.Head = &HeadResponse_Body_SplitInfo{
|
||||
SplitInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetEcInfo sets meta info about the erasure coded object.
|
||||
func (m *HeadResponse_Body) SetEcInfo(v *ECInfo) {
|
||||
m.Head = &HeadResponse_Body_EcInfo{
|
||||
EcInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *HeadResponse) SetBody(v *HeadResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *HeadResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *HeadResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetMatchType sets match type of the filter.
|
||||
func (m *SearchRequest_Body_Filter) SetMatchType(v MatchType) {
|
||||
m.MatchType = v
|
||||
}
|
||||
|
||||
// SetKey sets key to the filtering header.
|
||||
func (m *SearchRequest_Body_Filter) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the filtering header.
|
||||
func (m *SearchRequest_Body_Filter) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetVersion sets version of the search query.
|
||||
func (m *SearchRequest_Body) SetVersion(v uint32) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetFilters sets list of the query filters.
|
||||
func (m *SearchRequest_Body) SetFilters(v []*SearchRequest_Body_Filter) {
|
||||
m.Filters = v
|
||||
}
|
||||
|
||||
// SetContainerId sets container ID of the search requets.
|
||||
func (m *SearchRequest_Body) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *SearchRequest) SetBody(v *SearchRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *SearchRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *SearchRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetIdList sets list of the identifiers of the matched objects.
|
||||
func (m *SearchResponse_Body) SetIdList(v []*refs.ObjectID) {
|
||||
m.IdList = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *SearchResponse) SetBody(v *SearchResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *SearchResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *SearchResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetOffset sets offset of the payload range.
|
||||
func (m *Range) SetOffset(v uint64) {
|
||||
m.Offset = v
|
||||
}
|
||||
|
||||
// SetLength sets length of the payload range.
|
||||
func (m *Range) SetLength(v uint64) {
|
||||
m.Length = v
|
||||
}
|
||||
|
||||
// SetAddress sets address of the object with the request payload range.
|
||||
func (m *GetRangeRequest_Body) SetAddress(v *refs.Address) {
|
||||
m.Address = v
|
||||
}
|
||||
|
||||
// SetRange sets range of the object payload.
|
||||
func (m *GetRangeRequest_Body) SetRange(v *Range) {
|
||||
m.Range = v
|
||||
}
|
||||
|
||||
// SetRaw sets raw flag of the request.
|
||||
func (m *GetRangeRequest_Body) SetRaw(v bool) {
|
||||
m.Raw = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *GetRangeRequest) SetBody(v *GetRangeRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *GetRangeRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *GetRangeRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// GetChunk returns chunk of the object payload range bytes.
|
||||
func (m *GetRangeResponse_Body_Chunk) GetChunk() []byte {
|
||||
if m != nil {
|
||||
return m.Chunk
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetChunk sets chunk of the object payload range bytes.
|
||||
func (m *GetRangeResponse_Body_Chunk) SetChunk(v []byte) {
|
||||
m.Chunk = v
|
||||
}
|
||||
|
||||
// SetChunk sets chunk of the object payload.
|
||||
func (m *GetRangeResponse_Body) SetChunk(v *GetRangeResponse_Body_Chunk) {
|
||||
m.RangePart = v
|
||||
}
|
||||
|
||||
// SetSplitInfo sets meta info about split hierarchy of the object.
|
||||
func (m *GetRangeResponse_Body) SetSplitInfo(v *SplitInfo) {
|
||||
m.RangePart = &GetRangeResponse_Body_SplitInfo{
|
||||
SplitInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetEcInfo sets meta info about the erasure-coded object.
|
||||
func (m *GetRangeResponse_Body) SetEcInfo(v *ECInfo) {
|
||||
m.RangePart = &GetRangeResponse_Body_EcInfo{
|
||||
EcInfo: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetRangeResponse) SetBody(v *GetRangeResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *GetRangeResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *GetRangeResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetAddress sets address of the object with the request payload range.
|
||||
func (m *GetRangeHashRequest_Body) SetAddress(v *refs.Address) {
|
||||
m.Address = v
|
||||
}
|
||||
|
||||
// SetRanges sets list of the ranges of the object payload.
|
||||
func (m *GetRangeHashRequest_Body) SetRanges(v []*Range) {
|
||||
m.Ranges = v
|
||||
}
|
||||
|
||||
// SetSalt sets salt for the object payload ranges.
|
||||
func (m *GetRangeHashRequest_Body) SetSalt(v []byte) {
|
||||
m.Salt = v
|
||||
}
|
||||
|
||||
// Set sets salt for the object payload ranges.
|
||||
func (m *GetRangeHashRequest_Body) SetType(v refs.ChecksumType) {
|
||||
m.Type = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *GetRangeHashRequest) SetBody(v *GetRangeHashRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *GetRangeHashRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *GetRangeHashRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetHashList returns list of the range hashes.
|
||||
func (m *GetRangeHashResponse_Body) SetHashList(v [][]byte) {
|
||||
m.HashList = v
|
||||
}
|
||||
|
||||
// SetHashList returns list of the range hashes.
|
||||
func (m *GetRangeHashResponse_Body) SetType(v refs.ChecksumType) {
|
||||
m.Type = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *GetRangeHashResponse) SetBody(v *GetRangeHashResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *GetRangeHashResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *GetRangeHashResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetObject set object of the body.
|
||||
func (m *PutSingleRequest_Body) SetObject(o *Object) {
|
||||
m.Object = o
|
||||
}
|
||||
|
||||
// SetCopiesNumber sets copies number of the body.
|
||||
func (m *PutSingleRequest_Body) SetCopiesNumber(v []uint32) {
|
||||
m.CopiesNumber = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *PutSingleRequest) SetBody(b *PutSingleRequest_Body) {
|
||||
m.Body = b
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *PutSingleRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *PutSingleRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *PutSingleResponse) SetBody(b *PutSingleResponse_Body) {
|
||||
m.Body = b
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *PutSingleResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *PutSingleResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body) SetAddress(addr *refs.Address) {
|
||||
m.Address = addr
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body) SetNewAttributes(attrs []*Header_Attribute) {
|
||||
m.NewAttributes = attrs
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body) SetReplaceAttributes(replaceAttributes bool) {
|
||||
m.ReplaceAttributes = replaceAttributes
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body) SetPatch(patch *PatchRequest_Body_Patch) {
|
||||
m.Patch = patch
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body_Patch) SetSourceRange(r *Range) {
|
||||
m.SourceRange = r
|
||||
}
|
||||
|
||||
func (m *PatchRequest_Body_Patch) SetChunk(chunk []byte) {
|
||||
m.Chunk = chunk
|
||||
}
|
||||
|
||||
func (m *PatchRequest) SetBody(b *PatchRequest_Body) {
|
||||
m.Body = b
|
||||
}
|
||||
|
||||
func (m *PatchRequest) SetMetaHeader(v *session.RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
func (m *PatchRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
func (m *PatchResponse_Body) SetObjectID(objectID *refs.ObjectID) {
|
||||
m.ObjectId = objectID
|
||||
}
|
||||
|
||||
func (m *PatchResponse) SetBody(b *PatchResponse_Body) {
|
||||
m.Body = b
|
||||
}
|
||||
|
||||
func (m *PatchResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
func (m *PatchResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
4244
object/grpc/service.pb.go
generated
4244
object/grpc/service.pb.go
generated
File diff suppressed because it is too large
Load diff
8690
object/grpc/service_frostfs.pb.go
generated
Normal file
8690
object/grpc/service_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
387
object/grpc/service_frostfs_fuzz.go
Normal file
387
object/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,387 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package object
|
||||
|
||||
func DoFuzzProtoGetRequest(data []byte) int {
|
||||
msg := new(GetRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRequest(data []byte) int {
|
||||
msg := new(GetRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetResponse(data []byte) int {
|
||||
msg := new(GetResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetResponse(data []byte) int {
|
||||
msg := new(GetResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPutRequest(data []byte) int {
|
||||
msg := new(PutRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutRequest(data []byte) int {
|
||||
msg := new(PutRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPutResponse(data []byte) int {
|
||||
msg := new(PutResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutResponse(data []byte) int {
|
||||
msg := new(PutResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoDeleteRequest(data []byte) int {
|
||||
msg := new(DeleteRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONDeleteRequest(data []byte) int {
|
||||
msg := new(DeleteRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoDeleteResponse(data []byte) int {
|
||||
msg := new(DeleteResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONDeleteResponse(data []byte) int {
|
||||
msg := new(DeleteResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoHeadRequest(data []byte) int {
|
||||
msg := new(HeadRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONHeadRequest(data []byte) int {
|
||||
msg := new(HeadRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoHeaderWithSignature(data []byte) int {
|
||||
msg := new(HeaderWithSignature)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONHeaderWithSignature(data []byte) int {
|
||||
msg := new(HeaderWithSignature)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoHeadResponse(data []byte) int {
|
||||
msg := new(HeadResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONHeadResponse(data []byte) int {
|
||||
msg := new(HeadResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSearchRequest(data []byte) int {
|
||||
msg := new(SearchRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSearchRequest(data []byte) int {
|
||||
msg := new(SearchRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSearchResponse(data []byte) int {
|
||||
msg := new(SearchResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSearchResponse(data []byte) int {
|
||||
msg := new(SearchResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoRange(data []byte) int {
|
||||
msg := new(Range)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONRange(data []byte) int {
|
||||
msg := new(Range)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetRangeRequest(data []byte) int {
|
||||
msg := new(GetRangeRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRangeRequest(data []byte) int {
|
||||
msg := new(GetRangeRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetRangeResponse(data []byte) int {
|
||||
msg := new(GetRangeResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRangeResponse(data []byte) int {
|
||||
msg := new(GetRangeResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetRangeHashRequest(data []byte) int {
|
||||
msg := new(GetRangeHashRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRangeHashRequest(data []byte) int {
|
||||
msg := new(GetRangeHashRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoGetRangeHashResponse(data []byte) int {
|
||||
msg := new(GetRangeHashResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONGetRangeHashResponse(data []byte) int {
|
||||
msg := new(GetRangeHashResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPutSingleRequest(data []byte) int {
|
||||
msg := new(PutSingleRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutSingleRequest(data []byte) int {
|
||||
msg := new(PutSingleRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPutSingleResponse(data []byte) int {
|
||||
msg := new(PutSingleResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPutSingleResponse(data []byte) int {
|
||||
msg := new(PutSingleResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPatchRequest(data []byte) int {
|
||||
msg := new(PatchRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPatchRequest(data []byte) int {
|
||||
msg := new(PatchRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPatchResponse(data []byte) int {
|
||||
msg := new(PatchResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPatchResponse(data []byte) int {
|
||||
msg := new(PatchResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
211
object/grpc/service_frostfs_test.go
Normal file
211
object/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,211 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package object
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoGetRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPutRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPutResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoDeleteRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoDeleteRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONDeleteRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONDeleteRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoDeleteResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoDeleteResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONDeleteResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONDeleteResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoHeadRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoHeadRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONHeadRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONHeadRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoHeaderWithSignature(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoHeaderWithSignature(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONHeaderWithSignature(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONHeaderWithSignature(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoHeadResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoHeadResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONHeadResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONHeadResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSearchRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSearchRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSearchRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSearchRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSearchResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSearchResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSearchResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSearchResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoRange(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoRange(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONRange(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONRange(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetRangeRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRangeRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRangeRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRangeRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetRangeResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRangeResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRangeResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRangeResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetRangeHashRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRangeHashRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRangeHashRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRangeHashRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoGetRangeHashResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoGetRangeHashResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONGetRangeHashResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONGetRangeHashResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPutSingleRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutSingleRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutSingleRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutSingleRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPutSingleResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPutSingleResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPutSingleResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPutSingleResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPatchRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPatchRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPatchRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPatchRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPatchResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPatchResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPatchResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPatchResponse(data)
|
||||
})
|
||||
}
|
4
object/grpc/service_grpc.pb.go
generated
4
object/grpc/service_grpc.pb.go
generated
|
@ -331,7 +331,7 @@ type ObjectServiceClient interface {
|
|||
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
||||
// object not found in container;
|
||||
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
||||
// the requested object has been marked as deleted;
|
||||
// the requested object has been marked as deleted.
|
||||
// - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \
|
||||
// the requested range is out of bounds;
|
||||
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
||||
|
@ -855,7 +855,7 @@ type ObjectServiceServer interface {
|
|||
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \
|
||||
// object not found in container;
|
||||
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \
|
||||
// the requested object has been marked as deleted;
|
||||
// the requested object has been marked as deleted.
|
||||
// - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \
|
||||
// the requested range is out of bounds;
|
||||
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
||||
|
|
251
object/grpc/status.pb.go
generated
251
object/grpc/status.pb.go
generated
|
@ -1,251 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.18.0
|
||||
// source: v2/object/grpc/status.proto
|
||||
|
||||
package object
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type StatusCommon int32
|
||||
|
||||
const (
|
||||
StatusCommon_ACCESS_DENIED StatusCommon = 0
|
||||
)
|
||||
|
||||
// Enum value maps for StatusCommon.
|
||||
var (
|
||||
StatusCommon_name = map[int32]string{
|
||||
0: "ACCESS_DENIED",
|
||||
}
|
||||
StatusCommon_value = map[string]int32{
|
||||
"ACCESS_DENIED": 0,
|
||||
}
|
||||
)
|
||||
|
||||
func (x StatusCommon) Enum() *StatusCommon {
|
||||
p := new(StatusCommon)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x StatusCommon) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (StatusCommon) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_v2_object_grpc_status_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (StatusCommon) Type() protoreflect.EnumType {
|
||||
return &file_v2_object_grpc_status_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x StatusCommon) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusCommon.Descriptor instead.
|
||||
func (StatusCommon) EnumDescriptor() ([]byte, []int) {
|
||||
return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type StatusPut int32
|
||||
|
||||
const (
|
||||
StatusPut_STATUS_PUT_INCOMPLETE StatusPut = 0
|
||||
)
|
||||
|
||||
// Enum value maps for StatusPut.
|
||||
var (
|
||||
StatusPut_name = map[int32]string{
|
||||
0: "STATUS_PUT_INCOMPLETE",
|
||||
}
|
||||
StatusPut_value = map[string]int32{
|
||||
"STATUS_PUT_INCOMPLETE": 0,
|
||||
}
|
||||
)
|
||||
|
||||
func (x StatusPut) Enum() *StatusPut {
|
||||
p := new(StatusPut)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x StatusPut) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (StatusPut) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_v2_object_grpc_status_proto_enumTypes[1].Descriptor()
|
||||
}
|
||||
|
||||
func (StatusPut) Type() protoreflect.EnumType {
|
||||
return &file_v2_object_grpc_status_proto_enumTypes[1]
|
||||
}
|
||||
|
||||
func (x StatusPut) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusPut.Descriptor instead.
|
||||
func (StatusPut) EnumDescriptor() ([]byte, []int) {
|
||||
return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
type PutIncompleteDetail struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Statuses []*grpc.Status `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"`
|
||||
}
|
||||
|
||||
func (x *PutIncompleteDetail) Reset() {
|
||||
*x = PutIncompleteDetail{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v2_object_grpc_status_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PutIncompleteDetail) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PutIncompleteDetail) ProtoMessage() {}
|
||||
|
||||
func (x *PutIncompleteDetail) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v2_object_grpc_status_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PutIncompleteDetail.ProtoReflect.Descriptor instead.
|
||||
func (*PutIncompleteDetail) Descriptor() ([]byte, []int) {
|
||||
return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *PutIncompleteDetail) GetStatuses() []*grpc.Status {
|
||||
if x != nil {
|
||||
return x.Statuses
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_v2_object_grpc_status_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_v2_object_grpc_status_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e,
|
||||
0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a,
|
||||
0x1a, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f,
|
||||
0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x13, 0x50,
|
||||
0x75, 0x74, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61,
|
||||
0x69, 0x6c, 0x12, 0x34, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08,
|
||||
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x2a, 0x21, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45,
|
||||
0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x2a, 0x26, 0x0a, 0x09, 0x53,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x41, 0x54,
|
||||
0x55, 0x53, 0x5f, 0x50, 0x55, 0x54, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54,
|
||||
0x45, 0x10, 0x00, 0x42, 0x56, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66,
|
||||
0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65,
|
||||
0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02,
|
||||
0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65,
|
||||
0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_v2_object_grpc_status_proto_rawDescOnce sync.Once
|
||||
file_v2_object_grpc_status_proto_rawDescData = file_v2_object_grpc_status_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_v2_object_grpc_status_proto_rawDescGZIP() []byte {
|
||||
file_v2_object_grpc_status_proto_rawDescOnce.Do(func() {
|
||||
file_v2_object_grpc_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2_object_grpc_status_proto_rawDescData)
|
||||
})
|
||||
return file_v2_object_grpc_status_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_v2_object_grpc_status_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_v2_object_grpc_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_v2_object_grpc_status_proto_goTypes = []interface{}{
|
||||
(StatusCommon)(0), // 0: neo.fs.v2.object.StatusCommon
|
||||
(StatusPut)(0), // 1: neo.fs.v2.object.StatusPut
|
||||
(*PutIncompleteDetail)(nil), // 2: neo.fs.v2.object.PutIncompleteDetail
|
||||
(*grpc.Status)(nil), // 3: neo.fs.v2.status.Status
|
||||
}
|
||||
var file_v2_object_grpc_status_proto_depIdxs = []int32{
|
||||
3, // 0: neo.fs.v2.object.PutIncompleteDetail.statuses:type_name -> neo.fs.v2.status.Status
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_v2_object_grpc_status_proto_init() }
|
||||
func file_v2_object_grpc_status_proto_init() {
|
||||
if File_v2_object_grpc_status_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_v2_object_grpc_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PutIncompleteDetail); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_v2_object_grpc_status_proto_rawDesc,
|
||||
NumEnums: 2,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_v2_object_grpc_status_proto_goTypes,
|
||||
DependencyIndexes: file_v2_object_grpc_status_proto_depIdxs,
|
||||
EnumInfos: file_v2_object_grpc_status_proto_enumTypes,
|
||||
MessageInfos: file_v2_object_grpc_status_proto_msgTypes,
|
||||
}.Build()
|
||||
File_v2_object_grpc_status_proto = out.File
|
||||
file_v2_object_grpc_status_proto_rawDesc = nil
|
||||
file_v2_object_grpc_status_proto_goTypes = nil
|
||||
file_v2_object_grpc_status_proto_depIdxs = nil
|
||||
}
|
|
@ -1,197 +0,0 @@
|
|||
package object
|
||||
|
||||
import (
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
|
||||
)
|
||||
|
||||
// SetKey sets key to the object attribute.
|
||||
func (m *Header_Attribute) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the object attribute.
|
||||
func (m *Header_Attribute) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetParent sets identifier of the parent object.
|
||||
func (m *Header_Split) SetParent(v *refs.ObjectID) {
|
||||
m.Parent = v
|
||||
}
|
||||
|
||||
// SetPrevious sets identifier of the previous object in split-chain.
|
||||
func (m *Header_Split) SetPrevious(v *refs.ObjectID) {
|
||||
m.Previous = v
|
||||
}
|
||||
|
||||
// SetParentSignature sets signature of the parent object header.
|
||||
func (m *Header_Split) SetParentSignature(v *refs.Signature) {
|
||||
m.ParentSignature = v
|
||||
}
|
||||
|
||||
// SetParentHeader sets parent header structure.
|
||||
func (m *Header_Split) SetParentHeader(v *Header) {
|
||||
m.ParentHeader = v
|
||||
}
|
||||
|
||||
// SetChildren sets list of the identifiers of the child objects.
|
||||
func (m *Header_Split) SetChildren(v []*refs.ObjectID) {
|
||||
m.Children = v
|
||||
}
|
||||
|
||||
// SetSplitId sets split ID of the object.
|
||||
func (m *Header_Split) SetSplitId(v []byte) {
|
||||
m.SplitId = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container.
|
||||
func (m *Header) SetContainerId(v *refs.ContainerID) {
|
||||
m.ContainerId = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the object owner.
|
||||
func (m *Header) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetCreationEpoch sets creation epoch number.
|
||||
func (m *Header) SetCreationEpoch(v uint64) {
|
||||
m.CreationEpoch = v
|
||||
}
|
||||
|
||||
// SetVersion sets version of the object format.
|
||||
func (m *Header) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetPayloadLength sets length of the object payload.
|
||||
func (m *Header) SetPayloadLength(v uint64) {
|
||||
m.PayloadLength = v
|
||||
}
|
||||
|
||||
// SetPayloadHash sets hash of the object payload.
|
||||
func (m *Header) SetPayloadHash(v *refs.Checksum) {
|
||||
m.PayloadHash = v
|
||||
}
|
||||
|
||||
// SetObjectType sets type of the object.
|
||||
func (m *Header) SetObjectType(v ObjectType) {
|
||||
m.ObjectType = v
|
||||
}
|
||||
|
||||
// SetHomomorphicHash sets homomorphic hash of the object payload.
|
||||
func (m *Header) SetHomomorphicHash(v *refs.Checksum) {
|
||||
m.HomomorphicHash = v
|
||||
}
|
||||
|
||||
// SetSessionToken sets session token.
|
||||
func (m *Header) SetSessionToken(v *session.SessionToken) {
|
||||
m.SessionToken = v
|
||||
}
|
||||
|
||||
// SetAttributes sets list of the object attributes.
|
||||
func (m *Header) SetAttributes(v []*Header_Attribute) {
|
||||
m.Attributes = v
|
||||
}
|
||||
|
||||
// SetSplit sets split header.
|
||||
func (m *Header) SetSplit(v *Header_Split) {
|
||||
m.Split = v
|
||||
}
|
||||
|
||||
// SetObjectId sets identifier of the object.
|
||||
func (m *Object) SetObjectId(v *refs.ObjectID) {
|
||||
m.ObjectId = v
|
||||
}
|
||||
|
||||
// SetSignature sets signature of the object identifier.
|
||||
func (m *Object) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetHeader sets header of the object.
|
||||
func (m *Object) SetHeader(v *Header) {
|
||||
m.Header = v
|
||||
}
|
||||
|
||||
// SetPayload sets payload bytes of the object.
|
||||
func (m *Object) SetPayload(v []byte) {
|
||||
m.Payload = v
|
||||
}
|
||||
|
||||
// SetVersion sets version of the object.
|
||||
func (m *ShortHeader) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetCreationEpoch sets creation epoch number.
|
||||
func (m *ShortHeader) SetCreationEpoch(v uint64) {
|
||||
m.CreationEpoch = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the object owner.
|
||||
func (m *ShortHeader) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetObjectType sets type of the object.
|
||||
func (m *ShortHeader) SetObjectType(v ObjectType) {
|
||||
m.ObjectType = v
|
||||
}
|
||||
|
||||
// SetPayloadLength sets length of the object payload.
|
||||
func (m *ShortHeader) SetPayloadLength(v uint64) {
|
||||
m.PayloadLength = v
|
||||
}
|
||||
|
||||
// SetPayloadHash sets hash of the object payload.
|
||||
func (m *ShortHeader) SetPayloadHash(v *refs.Checksum) {
|
||||
m.PayloadHash = v
|
||||
}
|
||||
|
||||
// SetHomomorphicHash sets homomorphic hash of the object payload.
|
||||
func (m *ShortHeader) SetHomomorphicHash(v *refs.Checksum) {
|
||||
m.HomomorphicHash = v
|
||||
}
|
||||
|
||||
// SetSplitId sets id of split hierarchy.
|
||||
func (m *SplitInfo) SetSplitId(v []byte) {
|
||||
m.SplitId = v
|
||||
}
|
||||
|
||||
// SetLastPart sets id of most right child in split hierarchy.
|
||||
func (m *SplitInfo) SetLastPart(v *refs.ObjectID) {
|
||||
m.LastPart = v
|
||||
}
|
||||
|
||||
// SetLink sets id of linking object in split hierarchy.
|
||||
func (m *SplitInfo) SetLink(v *refs.ObjectID) {
|
||||
m.Link = v
|
||||
}
|
||||
|
||||
// FromString parses ObjectType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *ObjectType) FromString(s string) bool {
|
||||
i, ok := ObjectType_value[s]
|
||||
if ok {
|
||||
*x = ObjectType(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses MatchType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *MatchType) FromString(s string) bool {
|
||||
i, ok := MatchType_value[s]
|
||||
if ok {
|
||||
*x = MatchType(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
1373
object/grpc/types.pb.go
generated
1373
object/grpc/types.pb.go
generated
File diff suppressed because it is too large
Load diff
2621
object/grpc/types_frostfs.pb.go
generated
Normal file
2621
object/grpc/types_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
102
object/grpc/types_frostfs_fuzz.go
Normal file
102
object/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,102 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package object
|
||||
|
||||
func DoFuzzProtoShortHeader(data []byte) int {
|
||||
msg := new(ShortHeader)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONShortHeader(data []byte) int {
|
||||
msg := new(ShortHeader)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoHeader(data []byte) int {
|
||||
msg := new(Header)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONHeader(data []byte) int {
|
||||
msg := new(Header)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoObject(data []byte) int {
|
||||
msg := new(Object)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONObject(data []byte) int {
|
||||
msg := new(Object)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSplitInfo(data []byte) int {
|
||||
msg := new(SplitInfo)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSplitInfo(data []byte) int {
|
||||
msg := new(SplitInfo)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoECInfo(data []byte) int {
|
||||
msg := new(ECInfo)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONECInfo(data []byte) int {
|
||||
msg := new(ECInfo)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
61
object/grpc/types_frostfs_test.go
Normal file
61
object/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,61 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package object
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoShortHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoShortHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONShortHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONShortHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoObject(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoObject(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONObject(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONObject(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSplitInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSplitInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSplitInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSplitInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoECInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoECInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONECInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONECInfo(data)
|
||||
})
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
package refs
|
||||
|
||||
// SetValue sets container identifier in a binary format.
|
||||
func (x *ContainerID) SetValue(v []byte) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// SetValue sets object identifier in a binary format.
|
||||
func (x *ObjectID) SetValue(v []byte) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// SetValue sets owner identifier in a binary format.
|
||||
func (x *OwnerID) SetValue(v []byte) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// SetContainerId sets container identifier of the address.
|
||||
func (x *Address) SetContainerId(v *ContainerID) {
|
||||
x.ContainerId = v
|
||||
}
|
||||
|
||||
// SetObjectId sets object identifier of the address.
|
||||
func (x *Address) SetObjectId(v *ObjectID) {
|
||||
x.ObjectId = v
|
||||
}
|
||||
|
||||
// SetType in generic checksum structure.
|
||||
func (x *Checksum) SetType(v ChecksumType) {
|
||||
x.Type = v
|
||||
}
|
||||
|
||||
// SetSum in generic checksum structure.
|
||||
func (x *Checksum) SetSum(v []byte) {
|
||||
x.Sum = v
|
||||
}
|
||||
|
||||
// SetMajor sets major version number.
|
||||
func (x *Version) SetMajor(v uint32) {
|
||||
x.Major = v
|
||||
}
|
||||
|
||||
// SetMinor sets minor version number.
|
||||
func (x *Version) SetMinor(v uint32) {
|
||||
x.Minor = v
|
||||
}
|
||||
|
||||
// SetKey sets public key in a binary format.
|
||||
func (x *Signature) SetKey(v []byte) {
|
||||
x.Key = v
|
||||
}
|
||||
|
||||
// SetSign sets signature.
|
||||
func (x *Signature) SetSign(v []byte) {
|
||||
x.Sign = v
|
||||
}
|
||||
|
||||
// SetScheme sets signature scheme.
|
||||
func (x *Signature) SetScheme(s SignatureScheme) {
|
||||
x.Scheme = s
|
||||
}
|
||||
|
||||
// SetKey sets public key in a binary format.
|
||||
func (x *SignatureRFC6979) SetKey(v []byte) {
|
||||
x.Key = v
|
||||
}
|
||||
|
||||
// SetSign sets signature.
|
||||
func (x *SignatureRFC6979) SetSign(v []byte) {
|
||||
x.Sign = v
|
||||
}
|
||||
|
||||
// FromString parses SignatureScheme from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *SignatureScheme) FromString(s string) bool {
|
||||
i, ok := SignatureScheme_value[s]
|
||||
if ok {
|
||||
*x = SignatureScheme(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses ChecksumType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *ChecksumType) FromString(s string) bool {
|
||||
i, ok := ChecksumType_value[s]
|
||||
if ok {
|
||||
*x = ChecksumType(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
852
refs/grpc/types.pb.go
generated
852
refs/grpc/types.pb.go
generated
|
@ -1,852 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: refs/grpc/types.proto
|
||||
|
||||
package refs
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Signature scheme describes digital signing scheme used for (key, signature)
|
||||
// pair.
|
||||
type SignatureScheme int32
|
||||
|
||||
const (
|
||||
// ECDSA with SHA-512 hashing (FIPS 186-3)
|
||||
SignatureScheme_ECDSA_SHA512 SignatureScheme = 0
|
||||
// Deterministic ECDSA with SHA-256 hashing (RFC 6979)
|
||||
SignatureScheme_ECDSA_RFC6979_SHA256 SignatureScheme = 1
|
||||
// Deterministic ECDSA with SHA-256 hashing using WalletConnect API.
|
||||
// Here the algorithm is the same, but the message format differs.
|
||||
SignatureScheme_ECDSA_RFC6979_SHA256_WALLET_CONNECT SignatureScheme = 2
|
||||
)
|
||||
|
||||
// Enum value maps for SignatureScheme.
|
||||
var (
|
||||
SignatureScheme_name = map[int32]string{
|
||||
0: "ECDSA_SHA512",
|
||||
1: "ECDSA_RFC6979_SHA256",
|
||||
2: "ECDSA_RFC6979_SHA256_WALLET_CONNECT",
|
||||
}
|
||||
SignatureScheme_value = map[string]int32{
|
||||
"ECDSA_SHA512": 0,
|
||||
"ECDSA_RFC6979_SHA256": 1,
|
||||
"ECDSA_RFC6979_SHA256_WALLET_CONNECT": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x SignatureScheme) Enum() *SignatureScheme {
|
||||
p := new(SignatureScheme)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x SignatureScheme) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (SignatureScheme) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_refs_grpc_types_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (SignatureScheme) Type() protoreflect.EnumType {
|
||||
return &file_refs_grpc_types_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x SignatureScheme) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SignatureScheme.Descriptor instead.
|
||||
func (SignatureScheme) EnumDescriptor() ([]byte, []int) {
|
||||
return file_refs_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// Checksum algorithm type.
|
||||
type ChecksumType int32
|
||||
|
||||
const (
|
||||
// Unknown. Not used
|
||||
ChecksumType_CHECKSUM_TYPE_UNSPECIFIED ChecksumType = 0
|
||||
// Tillich-Zemor homomorphic hash function
|
||||
ChecksumType_TZ ChecksumType = 1
|
||||
// SHA-256
|
||||
ChecksumType_SHA256 ChecksumType = 2
|
||||
)
|
||||
|
||||
// Enum value maps for ChecksumType.
|
||||
var (
|
||||
ChecksumType_name = map[int32]string{
|
||||
0: "CHECKSUM_TYPE_UNSPECIFIED",
|
||||
1: "TZ",
|
||||
2: "SHA256",
|
||||
}
|
||||
ChecksumType_value = map[string]int32{
|
||||
"CHECKSUM_TYPE_UNSPECIFIED": 0,
|
||||
"TZ": 1,
|
||||
"SHA256": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ChecksumType) Enum() *ChecksumType {
|
||||
p := new(ChecksumType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ChecksumType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ChecksumType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_refs_grpc_types_proto_enumTypes[1].Descriptor()
|
||||
}
|
||||
|
||||
func (ChecksumType) Type() protoreflect.EnumType {
|
||||
return &file_refs_grpc_types_proto_enumTypes[1]
|
||||
}
|
||||
|
||||
func (x ChecksumType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ChecksumType.Descriptor instead.
|
||||
func (ChecksumType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_refs_grpc_types_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
// Objects in NeoFS are addressed by their ContainerID and ObjectID.
|
||||
//
|
||||
// String presentation of `Address` is a concatenation of string encoded
|
||||
// `ContainerID` and `ObjectID` delimited by '/' character.
|
||||
type Address struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Container identifier
|
||||
ContainerId *ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"`
|
||||
// Object identifier
|
||||
ObjectId *ObjectID `protobuf:"bytes,2,opt,name=object_id,json=objectID,proto3" json:"object_id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Address) Reset() {
|
||||
*x = Address{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Address) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Address) ProtoMessage() {}
|
||||
|
||||
func (x *Address) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Address.ProtoReflect.Descriptor instead.
|
||||
func (*Address) Descriptor() ([]byte, []int) {
|
||||
return file_refs_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Address) GetContainerId() *ContainerID {
|
||||
if x != nil {
|
||||
return x.ContainerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Address) GetObjectId() *ObjectID {
|
||||
if x != nil {
|
||||
return x.ObjectId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NeoFS Object unique identifier. Objects are immutable and content-addressed.
|
||||
// It means `ObjectID` will change if the `header` or the `payload` changes.
|
||||
//
|
||||
// `ObjectID` is a 32 byte long
|
||||
// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of
|
||||
// the object's `header` field, which, in it's turn, contains the hash of the
|
||||
// object's payload.
|
||||
//
|
||||
// String presentation is a
|
||||
// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string.
|
||||
//
|
||||
// JSON value will be data encoded as a string using standard base64
|
||||
// encoding with paddings. Either
|
||||
// [standard](https://tools.ietf.org/html/rfc4648#section-4) or
|
||||
// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding
|
||||
// with/without paddings are accepted.
|
||||
type ObjectID struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Object identifier in a binary format
|
||||
Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ObjectID) Reset() {
|
||||
*x = ObjectID{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ObjectID) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ObjectID) ProtoMessage() {}
|
||||
|
||||
func (x *ObjectID) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ObjectID.ProtoReflect.Descriptor instead.
|
||||
func (*ObjectID) Descriptor() ([]byte, []int) {
|
||||
return file_refs_grpc_types_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ObjectID) GetValue() []byte {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NeoFS container identifier. Container structures are immutable and
|
||||
// content-addressed.
|
||||
//
|
||||
// `ContainerID` is a 32 byte long
|
||||
// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of
|
||||
// stable-marshalled container message.
|
||||
//
|
||||
// String presentation is a
|
||||
// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string.
|
||||
//
|
||||
// JSON value will be data encoded as a string using standard base64
|
||||
// encoding with paddings. Either
|
||||
// [standard](https://tools.ietf.org/html/rfc4648#section-4) or
|
||||
// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding
|
||||
// with/without paddings are accepted.
|
||||
type ContainerID struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Container identifier in a binary format.
|
||||
Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ContainerID) Reset() {
|
||||
*x = ContainerID{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ContainerID) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ContainerID) ProtoMessage() {}
|
||||
|
||||
func (x *ContainerID) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ContainerID.ProtoReflect.Descriptor instead.
|
||||
func (*ContainerID) Descriptor() ([]byte, []int) {
|
||||
return file_refs_grpc_types_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ContainerID) GetValue() []byte {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// `OwnerID` is a derivative of a user's main public key. The transformation
|
||||
// algorithm is the same as for Neo3 wallet addresses. Neo3 wallet address can
|
||||
// be directly used as `OwnerID`.
|
||||
//
|
||||
// `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte
|
||||
// followed by 20 bytes of ScrptHash and 4 bytes of checksum.
|
||||
//
|
||||
// String presentation is a [Base58
|
||||
// Check](https://en.bitcoin.it/wiki/Base58Check_encoding) Encoded string.
|
||||
//
|
||||
// JSON value will be data encoded as a string using standard base64
|
||||
// encoding with paddings. Either
|
||||
// [standard](https://tools.ietf.org/html/rfc4648#section-4) or
|
||||
// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding
|
||||
// with/without paddings are accepted.
|
||||
type OwnerID struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Identifier of the container owner in a binary format
|
||||
Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *OwnerID) Reset() {
|
||||
*x = OwnerID{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *OwnerID) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*OwnerID) ProtoMessage() {}
|
||||
|
||||
func (x *OwnerID) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use OwnerID.ProtoReflect.Descriptor instead.
|
||||
func (*OwnerID) Descriptor() ([]byte, []int) {
|
||||
return file_refs_grpc_types_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *OwnerID) GetValue() []byte {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// API version used by a node.
|
||||
//
|
||||
// String presentation is a Semantic Versioning 2.0.0 compatible version string
|
||||
// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor
|
||||
// number.
|
||||
type Version struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Major API version
|
||||
Major uint32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"`
|
||||
// Minor API version
|
||||
Minor uint32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Version) Reset() {
|
||||
*x = Version{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Version) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Version) ProtoMessage() {}
|
||||
|
||||
func (x *Version) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Version.ProtoReflect.Descriptor instead.
|
||||
func (*Version) Descriptor() ([]byte, []int) {
|
||||
return file_refs_grpc_types_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *Version) GetMajor() uint32 {
|
||||
if x != nil {
|
||||
return x.Major
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Version) GetMinor() uint32 {
|
||||
if x != nil {
|
||||
return x.Minor
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Signature of something in NeoFS.
|
||||
type Signature struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Public key used for signing
|
||||
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
// Signature
|
||||
Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature,proto3" json:"sign,omitempty"`
|
||||
// Scheme contains digital signature scheme identifier
|
||||
Scheme SignatureScheme `protobuf:"varint,3,opt,name=scheme,proto3,enum=neo.fs.v2.refs.SignatureScheme" json:"scheme,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Signature) Reset() {
|
||||
*x = Signature{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Signature) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Signature) ProtoMessage() {}
|
||||
|
||||
func (x *Signature) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Signature.ProtoReflect.Descriptor instead.
|
||||
func (*Signature) Descriptor() ([]byte, []int) {
|
||||
return file_refs_grpc_types_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *Signature) GetKey() []byte {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Signature) GetSign() []byte {
|
||||
if x != nil {
|
||||
return x.Sign
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Signature) GetScheme() SignatureScheme {
|
||||
if x != nil {
|
||||
return x.Scheme
|
||||
}
|
||||
return SignatureScheme_ECDSA_SHA512
|
||||
}
|
||||
|
||||
// RFC 6979 signature.
|
||||
type SignatureRFC6979 struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Public key used for signing
|
||||
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
// Deterministic ECDSA with SHA-256 hashing
|
||||
Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature,proto3" json:"sign,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SignatureRFC6979) Reset() {
|
||||
*x = SignatureRFC6979{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SignatureRFC6979) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SignatureRFC6979) ProtoMessage() {}
|
||||
|
||||
func (x *SignatureRFC6979) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SignatureRFC6979.ProtoReflect.Descriptor instead.
|
||||
func (*SignatureRFC6979) Descriptor() ([]byte, []int) {
|
||||
return file_refs_grpc_types_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *SignatureRFC6979) GetKey() []byte {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SignatureRFC6979) GetSign() []byte {
|
||||
if x != nil {
|
||||
return x.Sign
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Checksum message.
|
||||
// Depending on checksum algorithm type, the string presentation may vary:
|
||||
//
|
||||
// - TZ \
|
||||
// Hex encoded string without `0x` prefix
|
||||
// - SHA256 \
|
||||
// Hex encoded string without `0x` prefix
|
||||
type Checksum struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Checksum algorithm type
|
||||
Type ChecksumType `protobuf:"varint,1,opt,name=type,proto3,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"`
|
||||
// Checksum itself
|
||||
Sum []byte `protobuf:"bytes,2,opt,name=sum,proto3" json:"sum,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Checksum) Reset() {
|
||||
*x = Checksum{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Checksum) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Checksum) ProtoMessage() {}
|
||||
|
||||
func (x *Checksum) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_refs_grpc_types_proto_msgTypes[7]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Checksum.ProtoReflect.Descriptor instead.
|
||||
func (*Checksum) Descriptor() ([]byte, []int) {
|
||||
return file_refs_grpc_types_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *Checksum) GetType() ChecksumType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ChecksumType_CHECKSUM_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *Checksum) GetSum() []byte {
|
||||
if x != nil {
|
||||
return x.Sum
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_refs_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_refs_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65,
|
||||
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72,
|
||||
0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72,
|
||||
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e,
|
||||
0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61,
|
||||
0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||
0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44,
|
||||
0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x22, 0x20, 0x0a, 0x08, 0x4f, 0x62,
|
||||
0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x23, 0x0a, 0x0b,
|
||||
0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x22, 0x1f, 0x0a, 0x07, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x22, 0x35, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x61,
|
||||
0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0d, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x6f, 0x0a, 0x09, 0x53, 0x69, 0x67,
|
||||
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
|
||||
0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x0e, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65,
|
||||
0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65,
|
||||
0x6d, 0x65, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x10, 0x53, 0x69,
|
||||
0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79,
|
||||
0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09,
|
||||
0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x4e, 0x0a, 0x08, 0x43, 0x68, 0x65,
|
||||
0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e,
|
||||
0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70,
|
||||
0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x2a, 0x66, 0x0a, 0x0f, 0x53, 0x69, 0x67,
|
||||
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x0c,
|
||||
0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x00, 0x12, 0x18,
|
||||
0x0a, 0x14, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f,
|
||||
0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x45, 0x43, 0x44, 0x53,
|
||||
0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36,
|
||||
0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x10,
|
||||
0x02, 0x2a, 0x41, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70,
|
||||
0x65, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f, 0x54, 0x59,
|
||||
0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
|
||||
0x12, 0x06, 0x0a, 0x02, 0x54, 0x5a, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x32,
|
||||
0x35, 0x36, 0x10, 0x02, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73,
|
||||
0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f,
|
||||
0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70,
|
||||
0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70,
|
||||
0x63, 0x3b, 0x72, 0x65, 0x66, 0x73, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c,
|
||||
0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, 0x66,
|
||||
0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_refs_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_refs_grpc_types_proto_rawDescData = file_refs_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_refs_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_refs_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_refs_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_refs_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_refs_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_refs_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_refs_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
var file_refs_grpc_types_proto_goTypes = []interface{}{
|
||||
(SignatureScheme)(0), // 0: neo.fs.v2.refs.SignatureScheme
|
||||
(ChecksumType)(0), // 1: neo.fs.v2.refs.ChecksumType
|
||||
(*Address)(nil), // 2: neo.fs.v2.refs.Address
|
||||
(*ObjectID)(nil), // 3: neo.fs.v2.refs.ObjectID
|
||||
(*ContainerID)(nil), // 4: neo.fs.v2.refs.ContainerID
|
||||
(*OwnerID)(nil), // 5: neo.fs.v2.refs.OwnerID
|
||||
(*Version)(nil), // 6: neo.fs.v2.refs.Version
|
||||
(*Signature)(nil), // 7: neo.fs.v2.refs.Signature
|
||||
(*SignatureRFC6979)(nil), // 8: neo.fs.v2.refs.SignatureRFC6979
|
||||
(*Checksum)(nil), // 9: neo.fs.v2.refs.Checksum
|
||||
}
|
||||
var file_refs_grpc_types_proto_depIdxs = []int32{
|
||||
4, // 0: neo.fs.v2.refs.Address.container_id:type_name -> neo.fs.v2.refs.ContainerID
|
||||
3, // 1: neo.fs.v2.refs.Address.object_id:type_name -> neo.fs.v2.refs.ObjectID
|
||||
0, // 2: neo.fs.v2.refs.Signature.scheme:type_name -> neo.fs.v2.refs.SignatureScheme
|
||||
1, // 3: neo.fs.v2.refs.Checksum.type:type_name -> neo.fs.v2.refs.ChecksumType
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_refs_grpc_types_proto_init() }
|
||||
func file_refs_grpc_types_proto_init() {
|
||||
if File_refs_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_refs_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Address); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_refs_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ObjectID); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_refs_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ContainerID); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_refs_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*OwnerID); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_refs_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Version); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_refs_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Signature); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_refs_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SignatureRFC6979); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_refs_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Checksum); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_refs_grpc_types_proto_rawDesc,
|
||||
NumEnums: 2,
|
||||
NumMessages: 8,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_refs_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_refs_grpc_types_proto_depIdxs,
|
||||
EnumInfos: file_refs_grpc_types_proto_enumTypes,
|
||||
MessageInfos: file_refs_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_refs_grpc_types_proto = out.File
|
||||
file_refs_grpc_types_proto_rawDesc = nil
|
||||
file_refs_grpc_types_proto_goTypes = nil
|
||||
file_refs_grpc_types_proto_depIdxs = nil
|
||||
}
|
1343
refs/grpc/types_frostfs.pb.go
generated
Normal file
1343
refs/grpc/types_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
159
refs/grpc/types_frostfs_fuzz.go
Normal file
159
refs/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,159 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package refs
|
||||
|
||||
func DoFuzzProtoAddress(data []byte) int {
|
||||
msg := new(Address)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONAddress(data []byte) int {
|
||||
msg := new(Address)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoObjectID(data []byte) int {
|
||||
msg := new(ObjectID)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONObjectID(data []byte) int {
|
||||
msg := new(ObjectID)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoContainerID(data []byte) int {
|
||||
msg := new(ContainerID)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONContainerID(data []byte) int {
|
||||
msg := new(ContainerID)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoOwnerID(data []byte) int {
|
||||
msg := new(OwnerID)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONOwnerID(data []byte) int {
|
||||
msg := new(OwnerID)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoVersion(data []byte) int {
|
||||
msg := new(Version)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONVersion(data []byte) int {
|
||||
msg := new(Version)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSignature(data []byte) int {
|
||||
msg := new(Signature)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSignature(data []byte) int {
|
||||
msg := new(Signature)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSignatureRFC6979(data []byte) int {
|
||||
msg := new(SignatureRFC6979)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSignatureRFC6979(data []byte) int {
|
||||
msg := new(SignatureRFC6979)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoChecksum(data []byte) int {
|
||||
msg := new(Checksum)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONChecksum(data []byte) int {
|
||||
msg := new(Checksum)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
91
refs/grpc/types_frostfs_test.go
Normal file
91
refs/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,91 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package refs
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoAddress(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoAddress(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONAddress(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONAddress(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoObjectID(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoObjectID(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONObjectID(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONObjectID(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoContainerID(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoContainerID(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONContainerID(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONContainerID(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoOwnerID(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoOwnerID(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONOwnerID(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONOwnerID(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoVersion(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoVersion(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONVersion(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONVersion(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSignature(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSignature(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSignature(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSignature(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSignatureRFC6979(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSignatureRFC6979(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSignatureRFC6979(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSignatureRFC6979(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoChecksum(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoChecksum(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONChecksum(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONChecksum(data)
|
||||
})
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
)
|
||||
|
@ -20,6 +21,7 @@ func New(opts ...Option) *Client {
|
|||
opt(&c.cfg)
|
||||
}
|
||||
|
||||
c.grpcDialOpts = append(c.grpcDialOpts, grpc.WithDefaultCallOptions(grpc.ForceCodec(encoding.ProtoCodec{})))
|
||||
if c.tlsCfg != nil {
|
||||
c.grpcDialOpts = append(c.grpcDialOpts, grpc.WithTransportCredentials(credentials.NewTLS(c.tlsCfg)))
|
||||
}
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
package message
|
||||
|
||||
import (
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// GRPCConvertedMessage is an interface
|
||||
// of the gRPC message that is used
|
||||
// for Message encoding/decoding.
|
||||
type GRPCConvertedMessage interface {
|
||||
grpc.Message
|
||||
proto.Message
|
||||
UnmarshalProtobuf([]byte) error
|
||||
}
|
||||
|
||||
// Unmarshal decodes m from its Protobuf binary representation
|
||||
|
@ -19,7 +16,7 @@ type GRPCConvertedMessage interface {
|
|||
//
|
||||
// gm should be tof the same type as the m.ToGRPCMessage() return.
|
||||
func Unmarshal(m Message, data []byte, gm GRPCConvertedMessage) error {
|
||||
if err := proto.Unmarshal(data, gm); err != nil {
|
||||
if err := gm.UnmarshalProtobuf(data); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -28,21 +25,16 @@ func Unmarshal(m Message, data []byte, gm GRPCConvertedMessage) error {
|
|||
|
||||
// MarshalJSON encodes m to Protobuf JSON representation.
|
||||
func MarshalJSON(m Message) ([]byte, error) {
|
||||
return protojson.MarshalOptions{
|
||||
EmitUnpopulated: true,
|
||||
}.Marshal(
|
||||
m.ToGRPCMessage().(proto.Message),
|
||||
)
|
||||
return json.Marshal(m.ToGRPCMessage())
|
||||
}
|
||||
|
||||
// UnmarshalJSON decodes m from its Protobuf JSON representation
|
||||
// via related gRPC message.
|
||||
//
|
||||
// gm should be tof the same type as the m.ToGRPCMessage() return.
|
||||
func UnmarshalJSON(m Message, data []byte, gm GRPCConvertedMessage) error {
|
||||
if err := protojson.Unmarshal(data, gm); err != nil {
|
||||
func UnmarshalJSON(m Message, data []byte, gm any) error {
|
||||
if err := json.Unmarshal(data, gm); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return m.FromGRPCMessage(gm)
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ func NetworkInfo(
|
|||
opts ...client.CallOption,
|
||||
) (*netmap.NetworkInfoResponse, error) {
|
||||
resp := new(netmap.NetworkInfoResponse)
|
||||
|
||||
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceNetmap, rpcNetmapNetInfo), req, resp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -460,7 +460,7 @@ func (r *RequestMetaHeader) FromGRPCMessage(m grpc.Message) error {
|
|||
|
||||
r.epoch = v.GetEpoch()
|
||||
r.ttl = v.GetTtl()
|
||||
r.netMagic = v.GetNetworkMagic()
|
||||
r.netMagic = v.GetMagicNumber()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
package session
|
||||
|
||||
import (
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
)
|
||||
|
||||
// SetOwnerId sets identifier of the session initiator.
|
||||
func (m *CreateRequest_Body) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetExpiration sets lifetime of the session.
|
||||
func (m *CreateRequest_Body) SetExpiration(v uint64) {
|
||||
m.Expiration = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the request.
|
||||
func (m *CreateRequest) SetBody(v *CreateRequest_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the request.
|
||||
func (m *CreateRequest) SetMetaHeader(v *RequestMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the request.
|
||||
func (m *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
||||
|
||||
// SetId sets identifier of the session token.
|
||||
func (m *CreateResponse_Body) SetId(v []byte) {
|
||||
m.Id = v
|
||||
}
|
||||
|
||||
// SetSessionKey sets session public key in a binary format.
|
||||
func (m *CreateResponse_Body) SetSessionKey(v []byte) {
|
||||
m.SessionKey = v
|
||||
}
|
||||
|
||||
// SetBody sets body of the response.
|
||||
func (m *CreateResponse) SetBody(v *CreateResponse_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetMetaHeader sets meta header of the response.
|
||||
func (m *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) {
|
||||
m.MetaHeader = v
|
||||
}
|
||||
|
||||
// SetVerifyHeader sets verification header of the response.
|
||||
func (m *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) {
|
||||
m.VerifyHeader = v
|
||||
}
|
458
session/grpc/service.pb.go
generated
458
session/grpc/service.pb.go
generated
|
@ -1,458 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: session/grpc/service.proto
|
||||
|
||||
package session
|
||||
|
||||
import (
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Information necessary for opening a session.
|
||||
type CreateRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Body of a create session token request message.
|
||||
Body *CreateRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
|
||||
// Carries request meta information. Header data is used only to regulate
|
||||
// message transport and does not affect request execution.
|
||||
MetaHeader *RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"`
|
||||
// Carries request verification information. This header is used to
|
||||
// authenticate the nodes of the message route and check the correctness of
|
||||
// transmission.
|
||||
VerifyHeader *RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CreateRequest) Reset() {
|
||||
*x = CreateRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_session_grpc_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CreateRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CreateRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_session_grpc_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CreateRequest) Descriptor() ([]byte, []int) {
|
||||
return file_session_grpc_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CreateRequest) GetBody() *CreateRequest_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Information about the opened session.
|
||||
type CreateResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Body of create session token response message.
|
||||
Body *CreateResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
|
||||
// Carries response meta information. Header data is used only to regulate
|
||||
// message transport and does not affect request execution.
|
||||
MetaHeader *ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"`
|
||||
// Carries response verification information. This header is used to
|
||||
// authenticate the nodes of the message route and check the correctness of
|
||||
// transmission.
|
||||
VerifyHeader *ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CreateResponse) Reset() {
|
||||
*x = CreateResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_session_grpc_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CreateResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CreateResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_session_grpc_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CreateResponse) Descriptor() ([]byte, []int) {
|
||||
return file_session_grpc_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *CreateResponse) GetBody() *CreateResponse_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Session creation request body
|
||||
type CreateRequest_Body struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Session initiating user's or node's key derived `OwnerID`
|
||||
OwnerId *grpc.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"`
|
||||
// Session expiration `Epoch`
|
||||
Expiration uint64 `protobuf:"varint,2,opt,name=expiration,proto3" json:"expiration,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CreateRequest_Body) Reset() {
|
||||
*x = CreateRequest_Body{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_session_grpc_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CreateRequest_Body) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateRequest_Body) ProtoMessage() {}
|
||||
|
||||
func (x *CreateRequest_Body) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_session_grpc_service_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CreateRequest_Body.ProtoReflect.Descriptor instead.
|
||||
func (*CreateRequest_Body) Descriptor() ([]byte, []int) {
|
||||
return file_session_grpc_service_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID {
|
||||
if x != nil {
|
||||
return x.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CreateRequest_Body) GetExpiration() uint64 {
|
||||
if x != nil {
|
||||
return x.Expiration
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Session creation response body
|
||||
type CreateResponse_Body struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Identifier of a newly created session
|
||||
Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// Public key used for session
|
||||
SessionKey []byte `protobuf:"bytes,2,opt,name=session_key,json=sessionKey,proto3" json:"session_key,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CreateResponse_Body) Reset() {
|
||||
*x = CreateResponse_Body{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_session_grpc_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CreateResponse_Body) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateResponse_Body) ProtoMessage() {}
|
||||
|
||||
func (x *CreateResponse_Body) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_session_grpc_service_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CreateResponse_Body.ProtoReflect.Descriptor instead.
|
||||
func (*CreateResponse_Body) Descriptor() ([]byte, []int) {
|
||||
return file_session_grpc_service_proto_rawDescGZIP(), []int{1, 0}
|
||||
}
|
||||
|
||||
func (x *CreateResponse_Body) GetId() []byte {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CreateResponse_Body) GetSessionKey() []byte {
|
||||
if x != nil {
|
||||
return x.SessionKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_session_grpc_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_session_grpc_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x6e, 0x65,
|
||||
0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a,
|
||||
0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f,
|
||||
0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x22, 0xc0, 0x02, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a,
|
||||
0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73,
|
||||
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65,
|
||||
0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65,
|
||||
0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68,
|
||||
0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65,
|
||||
0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66,
|
||||
0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x5a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12,
|
||||
0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65,
|
||||
0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65,
|
||||
0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x22, 0xa1, 0x02, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32,
|
||||
0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f,
|
||||
0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65,
|
||||
0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73,
|
||||
0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a,
|
||||
0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65,
|
||||
0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65,
|
||||
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65,
|
||||
0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
|
||||
0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x37,
|
||||
0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x73,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x32, 0x5f, 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x43, 0x72, 0x65,
|
||||
0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e,
|
||||
0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76,
|
||||
0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x64, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x2e,
|
||||
0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75,
|
||||
0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66,
|
||||
0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0xaa, 0x02, 0x1b, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61,
|
||||
0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_session_grpc_service_proto_rawDescOnce sync.Once
|
||||
file_session_grpc_service_proto_rawDescData = file_session_grpc_service_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_session_grpc_service_proto_rawDescGZIP() []byte {
|
||||
file_session_grpc_service_proto_rawDescOnce.Do(func() {
|
||||
file_session_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_session_grpc_service_proto_rawDescData)
|
||||
})
|
||||
return file_session_grpc_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_session_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_session_grpc_service_proto_goTypes = []interface{}{
|
||||
(*CreateRequest)(nil), // 0: neo.fs.v2.session.CreateRequest
|
||||
(*CreateResponse)(nil), // 1: neo.fs.v2.session.CreateResponse
|
||||
(*CreateRequest_Body)(nil), // 2: neo.fs.v2.session.CreateRequest.Body
|
||||
(*CreateResponse_Body)(nil), // 3: neo.fs.v2.session.CreateResponse.Body
|
||||
(*RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader
|
||||
(*RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader
|
||||
(*ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader
|
||||
(*ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader
|
||||
(*grpc.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID
|
||||
}
|
||||
var file_session_grpc_service_proto_depIdxs = []int32{
|
||||
2, // 0: neo.fs.v2.session.CreateRequest.body:type_name -> neo.fs.v2.session.CreateRequest.Body
|
||||
4, // 1: neo.fs.v2.session.CreateRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader
|
||||
5, // 2: neo.fs.v2.session.CreateRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader
|
||||
3, // 3: neo.fs.v2.session.CreateResponse.body:type_name -> neo.fs.v2.session.CreateResponse.Body
|
||||
6, // 4: neo.fs.v2.session.CreateResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader
|
||||
7, // 5: neo.fs.v2.session.CreateResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader
|
||||
8, // 6: neo.fs.v2.session.CreateRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID
|
||||
0, // 7: neo.fs.v2.session.SessionService.Create:input_type -> neo.fs.v2.session.CreateRequest
|
||||
1, // 8: neo.fs.v2.session.SessionService.Create:output_type -> neo.fs.v2.session.CreateResponse
|
||||
8, // [8:9] is the sub-list for method output_type
|
||||
7, // [7:8] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_session_grpc_service_proto_init() }
|
||||
func file_session_grpc_service_proto_init() {
|
||||
if File_session_grpc_service_proto != nil {
|
||||
return
|
||||
}
|
||||
file_session_grpc_types_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_session_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CreateRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_session_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CreateResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_session_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CreateRequest_Body); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_session_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CreateResponse_Body); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_session_grpc_service_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_session_grpc_service_proto_goTypes,
|
||||
DependencyIndexes: file_session_grpc_service_proto_depIdxs,
|
||||
MessageInfos: file_session_grpc_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_session_grpc_service_proto = out.File
|
||||
file_session_grpc_service_proto_rawDesc = nil
|
||||
file_session_grpc_service_proto_goTypes = nil
|
||||
file_session_grpc_service_proto_depIdxs = nil
|
||||
}
|
781
session/grpc/service_frostfs.pb.go
generated
Normal file
781
session/grpc/service_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,781 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package session
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
)
|
||||
|
||||
type CreateRequest_Body struct {
|
||||
OwnerId *grpc.OwnerID `json:"ownerId"`
|
||||
Expiration uint64 `json:"expiration"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*CreateRequest_Body)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*CreateRequest_Body)(nil)
|
||||
_ json.Marshaler = (*CreateRequest_Body)(nil)
|
||||
_ json.Unmarshaler = (*CreateRequest_Body)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *CreateRequest_Body) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.OwnerId)
|
||||
size += proto.UInt64Size(2, x.Expiration)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *CreateRequest_Body) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *CreateRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
|
||||
x.OwnerId.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
if x.Expiration != 0 {
|
||||
mm.AppendUint64(2, x.Expiration)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *CreateRequest_Body) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "CreateRequest_Body")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // OwnerId
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "OwnerId")
|
||||
}
|
||||
x.OwnerId = new(grpc.OwnerID)
|
||||
if err := x.OwnerId.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 2: // Expiration
|
||||
data, ok := fc.Uint64()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Expiration")
|
||||
}
|
||||
x.Expiration = data
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID {
|
||||
if x != nil {
|
||||
return x.OwnerId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateRequest_Body) SetOwnerId(v *grpc.OwnerID) {
|
||||
x.OwnerId = v
|
||||
}
|
||||
func (x *CreateRequest_Body) GetExpiration() uint64 {
|
||||
if x != nil {
|
||||
return x.Expiration
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *CreateRequest_Body) SetExpiration(v uint64) {
|
||||
x.Expiration = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *CreateRequest_Body) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"ownerId\":"
|
||||
out.RawString(prefix[1:])
|
||||
x.OwnerId.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"expiration\":"
|
||||
out.RawString(prefix)
|
||||
out.Uint64(x.Expiration)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *CreateRequest_Body) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *CreateRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "ownerId":
|
||||
{
|
||||
var f *grpc.OwnerID
|
||||
f = new(grpc.OwnerID)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.OwnerId = f
|
||||
}
|
||||
case "expiration":
|
||||
{
|
||||
var f uint64
|
||||
f = in.Uint64()
|
||||
x.Expiration = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type CreateRequest struct {
|
||||
Body *CreateRequest_Body `json:"body"`
|
||||
MetaHeader *RequestMetaHeader `json:"metaHeader"`
|
||||
VerifyHeader *RequestVerificationHeader `json:"verifyHeader"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*CreateRequest)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*CreateRequest)(nil)
|
||||
_ json.Marshaler = (*CreateRequest)(nil)
|
||||
_ json.Unmarshaler = (*CreateRequest)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *CreateRequest) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.Body)
|
||||
size += proto.NestedStructureSize(2, x.MetaHeader)
|
||||
size += proto.NestedStructureSize(3, x.VerifyHeader)
|
||||
return size
|
||||
}
|
||||
|
||||
// ReadSignedData fills buf with signed data of x.
|
||||
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
|
||||
//
|
||||
// Returns any error encountered which did not allow writing the data completely.
|
||||
// Otherwise, returns the buffer in which the data is written.
|
||||
//
|
||||
// Structures with the same field values have the same signed data.
|
||||
func (x *CreateRequest) SignedDataSize() int {
|
||||
return x.GetBody().StableSize()
|
||||
}
|
||||
|
||||
// SignedDataSize returns size of the request signed data in bytes.
|
||||
//
|
||||
// Structures with the same field values have the same signed data size.
|
||||
func (x *CreateRequest) ReadSignedData(buf []byte) ([]byte, error) {
|
||||
return x.GetBody().MarshalProtobuf(buf), nil
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *CreateRequest) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *CreateRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Body != nil && x.Body.StableSize() != 0 {
|
||||
x.Body.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
|
||||
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
|
||||
}
|
||||
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
|
||||
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *CreateRequest) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "CreateRequest")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Body
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Body")
|
||||
}
|
||||
x.Body = new(CreateRequest_Body)
|
||||
if err := x.Body.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 2: // MetaHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
|
||||
}
|
||||
x.MetaHeader = new(RequestMetaHeader)
|
||||
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 3: // VerifyHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
|
||||
}
|
||||
x.VerifyHeader = new(RequestVerificationHeader)
|
||||
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateRequest) GetBody() *CreateRequest_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateRequest) SetBody(v *CreateRequest_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateRequest) SetMetaHeader(v *RequestMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *CreateRequest) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"body\":"
|
||||
out.RawString(prefix[1:])
|
||||
x.Body.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"metaHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.MetaHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"verifyHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.VerifyHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *CreateRequest) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *CreateRequest) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "body":
|
||||
{
|
||||
var f *CreateRequest_Body
|
||||
f = new(CreateRequest_Body)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.Body = f
|
||||
}
|
||||
case "metaHeader":
|
||||
{
|
||||
var f *RequestMetaHeader
|
||||
f = new(RequestMetaHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.MetaHeader = f
|
||||
}
|
||||
case "verifyHeader":
|
||||
{
|
||||
var f *RequestVerificationHeader
|
||||
f = new(RequestVerificationHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.VerifyHeader = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type CreateResponse_Body struct {
|
||||
Id []byte `json:"id"`
|
||||
SessionKey []byte `json:"sessionKey"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*CreateResponse_Body)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*CreateResponse_Body)(nil)
|
||||
_ json.Marshaler = (*CreateResponse_Body)(nil)
|
||||
_ json.Unmarshaler = (*CreateResponse_Body)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *CreateResponse_Body) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.BytesSize(1, x.Id)
|
||||
size += proto.BytesSize(2, x.SessionKey)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *CreateResponse_Body) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *CreateResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if len(x.Id) != 0 {
|
||||
mm.AppendBytes(1, x.Id)
|
||||
}
|
||||
if len(x.SessionKey) != 0 {
|
||||
mm.AppendBytes(2, x.SessionKey)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *CreateResponse_Body) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "CreateResponse_Body")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Id
|
||||
data, ok := fc.Bytes()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Id")
|
||||
}
|
||||
x.Id = data
|
||||
case 2: // SessionKey
|
||||
data, ok := fc.Bytes()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "SessionKey")
|
||||
}
|
||||
x.SessionKey = data
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateResponse_Body) GetId() []byte {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateResponse_Body) SetId(v []byte) {
|
||||
x.Id = v
|
||||
}
|
||||
func (x *CreateResponse_Body) GetSessionKey() []byte {
|
||||
if x != nil {
|
||||
return x.SessionKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateResponse_Body) SetSessionKey(v []byte) {
|
||||
x.SessionKey = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *CreateResponse_Body) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"id\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Base64Bytes(x.Id)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"sessionKey\":"
|
||||
out.RawString(prefix)
|
||||
out.Base64Bytes(x.SessionKey)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *CreateResponse_Body) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *CreateResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "id":
|
||||
{
|
||||
var f []byte
|
||||
f = in.Bytes()
|
||||
x.Id = f
|
||||
}
|
||||
case "sessionKey":
|
||||
{
|
||||
var f []byte
|
||||
f = in.Bytes()
|
||||
x.SessionKey = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type CreateResponse struct {
|
||||
Body *CreateResponse_Body `json:"body"`
|
||||
MetaHeader *ResponseMetaHeader `json:"metaHeader"`
|
||||
VerifyHeader *ResponseVerificationHeader `json:"verifyHeader"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*CreateResponse)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*CreateResponse)(nil)
|
||||
_ json.Marshaler = (*CreateResponse)(nil)
|
||||
_ json.Unmarshaler = (*CreateResponse)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *CreateResponse) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.NestedStructureSize(1, x.Body)
|
||||
size += proto.NestedStructureSize(2, x.MetaHeader)
|
||||
size += proto.NestedStructureSize(3, x.VerifyHeader)
|
||||
return size
|
||||
}
|
||||
|
||||
// ReadSignedData fills buf with signed data of x.
|
||||
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
|
||||
//
|
||||
// Returns any error encountered which did not allow writing the data completely.
|
||||
// Otherwise, returns the buffer in which the data is written.
|
||||
//
|
||||
// Structures with the same field values have the same signed data.
|
||||
func (x *CreateResponse) SignedDataSize() int {
|
||||
return x.GetBody().StableSize()
|
||||
}
|
||||
|
||||
// SignedDataSize returns size of the request signed data in bytes.
|
||||
//
|
||||
// Structures with the same field values have the same signed data size.
|
||||
func (x *CreateResponse) ReadSignedData(buf []byte) ([]byte, error) {
|
||||
return x.GetBody().MarshalProtobuf(buf), nil
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *CreateResponse) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *CreateResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Body != nil && x.Body.StableSize() != 0 {
|
||||
x.Body.EmitProtobuf(mm.AppendMessage(1))
|
||||
}
|
||||
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
|
||||
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
|
||||
}
|
||||
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
|
||||
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *CreateResponse) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "CreateResponse")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Body
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Body")
|
||||
}
|
||||
x.Body = new(CreateResponse_Body)
|
||||
if err := x.Body.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 2: // MetaHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
|
||||
}
|
||||
x.MetaHeader = new(ResponseMetaHeader)
|
||||
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
case 3: // VerifyHeader
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
|
||||
}
|
||||
x.VerifyHeader = new(ResponseVerificationHeader)
|
||||
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateResponse) GetBody() *CreateResponse_Body {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateResponse) SetBody(v *CreateResponse_Body) {
|
||||
x.Body = v
|
||||
}
|
||||
func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader {
|
||||
if x != nil {
|
||||
return x.MetaHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) {
|
||||
x.MetaHeader = v
|
||||
}
|
||||
func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader {
|
||||
if x != nil {
|
||||
return x.VerifyHeader
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) {
|
||||
x.VerifyHeader = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *CreateResponse) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"body\":"
|
||||
out.RawString(prefix[1:])
|
||||
x.Body.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"metaHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.MetaHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"verifyHeader\":"
|
||||
out.RawString(prefix)
|
||||
x.VerifyHeader.MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *CreateResponse) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *CreateResponse) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "body":
|
||||
{
|
||||
var f *CreateResponse_Body
|
||||
f = new(CreateResponse_Body)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.Body = f
|
||||
}
|
||||
case "metaHeader":
|
||||
{
|
||||
var f *ResponseMetaHeader
|
||||
f = new(ResponseMetaHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.MetaHeader = f
|
||||
}
|
||||
case "verifyHeader":
|
||||
{
|
||||
var f *ResponseVerificationHeader
|
||||
f = new(ResponseVerificationHeader)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
x.VerifyHeader = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
45
session/grpc/service_frostfs_fuzz.go
Normal file
45
session/grpc/service_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,45 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package session
|
||||
|
||||
func DoFuzzProtoCreateRequest(data []byte) int {
|
||||
msg := new(CreateRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONCreateRequest(data []byte) int {
|
||||
msg := new(CreateRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoCreateResponse(data []byte) int {
|
||||
msg := new(CreateResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONCreateResponse(data []byte) int {
|
||||
msg := new(CreateResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
31
session/grpc/service_frostfs_test.go
Normal file
31
session/grpc/service_frostfs_test.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package session
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoCreateRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoCreateRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONCreateRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONCreateRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoCreateResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoCreateResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONCreateResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONCreateResponse(data)
|
||||
})
|
||||
}
|
|
@ -1,246 +0,0 @@
|
|||
package session
|
||||
|
||||
import (
|
||||
acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc"
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
status "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc"
|
||||
)
|
||||
|
||||
// SetKey sets key to the X-Header.
|
||||
func (m *XHeader) SetKey(v string) {
|
||||
m.Key = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the X-Header.
|
||||
func (m *XHeader) SetValue(v string) {
|
||||
m.Value = v
|
||||
}
|
||||
|
||||
// SetExp sets epoch number of the token expiration.
|
||||
func (m *SessionToken_Body_TokenLifetime) SetExp(v uint64) {
|
||||
m.Exp = v
|
||||
}
|
||||
|
||||
// SetNbf sets starting epoch number of the token.
|
||||
func (m *SessionToken_Body_TokenLifetime) SetNbf(v uint64) {
|
||||
m.Nbf = v
|
||||
}
|
||||
|
||||
// SetIat sets the number of the epoch in which the token was issued.
|
||||
func (m *SessionToken_Body_TokenLifetime) SetIat(v uint64) {
|
||||
m.Iat = v
|
||||
}
|
||||
|
||||
// SetId sets identifier of the session token.
|
||||
func (m *SessionToken_Body) SetId(v []byte) {
|
||||
m.Id = v
|
||||
}
|
||||
|
||||
// SetOwnerId sets identifier of the session token owner.
|
||||
func (m *SessionToken_Body) SetOwnerId(v *refs.OwnerID) {
|
||||
m.OwnerId = v
|
||||
}
|
||||
|
||||
// SetLifetime sets lifetime of the session token.
|
||||
func (m *SessionToken_Body) SetLifetime(v *SessionToken_Body_TokenLifetime) {
|
||||
m.Lifetime = v
|
||||
}
|
||||
|
||||
// SetSessionKey sets public session key in a binary format.
|
||||
func (m *SessionToken_Body) SetSessionKey(v []byte) {
|
||||
m.SessionKey = v
|
||||
}
|
||||
|
||||
// SetObjectAddressContext sets object context of the session token.
|
||||
func (m *SessionToken_Body) SetObject(v *ObjectSessionContext) {
|
||||
m.Context = &SessionToken_Body_Object{
|
||||
Object: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetContainer sets container context of the session token.
|
||||
func (m *SessionToken_Body) SetContainer(v *ContainerSessionContext) {
|
||||
m.Context = &SessionToken_Body_Container{
|
||||
Container: v,
|
||||
}
|
||||
}
|
||||
|
||||
// SetTarget specifies objects involved in the object session.
|
||||
func (m *ObjectSessionContext) SetTarget(tgt *ObjectSessionContext_Target) {
|
||||
m.Target = tgt
|
||||
}
|
||||
|
||||
// SetVerb sets type of request for which the token is issued.
|
||||
func (m *ObjectSessionContext) SetVerb(v ObjectSessionContext_Verb) {
|
||||
m.Verb = v
|
||||
}
|
||||
|
||||
// SetVerb sets type of request for which the token is issued.
|
||||
func (x *ContainerSessionContext) SetVerb(v ContainerSessionContext_Verb) {
|
||||
x.Verb = v
|
||||
}
|
||||
|
||||
// SetWildcard sets wildcard flag of the container session.
|
||||
func (x *ContainerSessionContext) SetWildcard(v bool) {
|
||||
x.Wildcard = v
|
||||
}
|
||||
|
||||
// SetContainerId sets identifier of the container related to the session.
|
||||
func (x *ContainerSessionContext) SetContainerId(v *refs.ContainerID) {
|
||||
x.ContainerId = v
|
||||
}
|
||||
|
||||
// SetBody sets session token body.
|
||||
func (m *SessionToken) SetBody(v *SessionToken_Body) {
|
||||
m.Body = v
|
||||
}
|
||||
|
||||
// SetSignature sets session token signature.
|
||||
func (m *SessionToken) SetSignature(v *refs.Signature) {
|
||||
m.Signature = v
|
||||
}
|
||||
|
||||
// SetVersion sets client protocol version.
|
||||
func (m *RequestMetaHeader) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetEpoch sets client local epoch.
|
||||
func (m *RequestMetaHeader) SetEpoch(v uint64) {
|
||||
m.Epoch = v
|
||||
}
|
||||
|
||||
// SetTtl sets request TTL.
|
||||
func (m *RequestMetaHeader) SetTtl(v uint32) {
|
||||
m.Ttl = v
|
||||
}
|
||||
|
||||
// SetXHeaders sets request X-Headers.
|
||||
func (m *RequestMetaHeader) SetXHeaders(v []*XHeader) {
|
||||
m.XHeaders = v
|
||||
}
|
||||
|
||||
// SetSessionToken sets session token of the request.
|
||||
func (m *RequestMetaHeader) SetSessionToken(v *SessionToken) {
|
||||
m.SessionToken = v
|
||||
}
|
||||
|
||||
// SetBearerToken sets bearer token of the request.
|
||||
func (m *RequestMetaHeader) SetBearerToken(v *acl.BearerToken) {
|
||||
m.BearerToken = v
|
||||
}
|
||||
|
||||
// SetOrigin sets origin request meta header.
|
||||
func (m *RequestMetaHeader) SetOrigin(v *RequestMetaHeader) {
|
||||
m.Origin = v
|
||||
}
|
||||
|
||||
// GetNetworkMagic returns NeoFS network magic.
|
||||
func (m *RequestMetaHeader) GetNetworkMagic() uint64 {
|
||||
if m != nil {
|
||||
return m.MagicNumber
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
// SetMagicNumber sets NeoFS network magic.
|
||||
func (m *RequestMetaHeader) SetMagicNumber(v uint64) {
|
||||
m.MagicNumber = v
|
||||
}
|
||||
|
||||
// SetVersion sets server protocol version.
|
||||
func (m *ResponseMetaHeader) SetVersion(v *refs.Version) {
|
||||
m.Version = v
|
||||
}
|
||||
|
||||
// SetEpoch sets server local epoch.
|
||||
func (m *ResponseMetaHeader) SetEpoch(v uint64) {
|
||||
m.Epoch = v
|
||||
}
|
||||
|
||||
// SetTtl sets response TTL.
|
||||
func (m *ResponseMetaHeader) SetTtl(v uint32) {
|
||||
m.Ttl = v
|
||||
}
|
||||
|
||||
// SetXHeaders sets response X-Headers.
|
||||
func (m *ResponseMetaHeader) SetXHeaders(v []*XHeader) {
|
||||
m.XHeaders = v
|
||||
}
|
||||
|
||||
// SetOrigin sets origin response meta header.
|
||||
func (m *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader) {
|
||||
m.Origin = v
|
||||
}
|
||||
|
||||
// SetStatus sets response status.
|
||||
func (m *ResponseMetaHeader) SetStatus(v *status.Status) {
|
||||
m.Status = v
|
||||
}
|
||||
|
||||
// SetBodySignature sets signature of the request body.
|
||||
func (m *RequestVerificationHeader) SetBodySignature(v *refs.Signature) {
|
||||
m.BodySignature = v
|
||||
}
|
||||
|
||||
// SetMetaSignature sets signature of the request meta.
|
||||
func (m *RequestVerificationHeader) SetMetaSignature(v *refs.Signature) {
|
||||
m.MetaSignature = v
|
||||
}
|
||||
|
||||
// SetOriginSignature sets signature of the origin verification header of the request.
|
||||
func (m *RequestVerificationHeader) SetOriginSignature(v *refs.Signature) {
|
||||
m.OriginSignature = v
|
||||
}
|
||||
|
||||
// SetOrigin sets origin verification header of the request.
|
||||
func (m *RequestVerificationHeader) SetOrigin(v *RequestVerificationHeader) {
|
||||
m.Origin = v
|
||||
}
|
||||
|
||||
// SetBodySignature sets signature of the response body.
|
||||
func (m *ResponseVerificationHeader) SetBodySignature(v *refs.Signature) {
|
||||
m.BodySignature = v
|
||||
}
|
||||
|
||||
// SetMetaSignature sets signature of the response meta.
|
||||
func (m *ResponseVerificationHeader) SetMetaSignature(v *refs.Signature) {
|
||||
m.MetaSignature = v
|
||||
}
|
||||
|
||||
// SetOriginSignature sets signature of the origin verification header of the response.
|
||||
func (m *ResponseVerificationHeader) SetOriginSignature(v *refs.Signature) {
|
||||
m.OriginSignature = v
|
||||
}
|
||||
|
||||
// SetOrigin sets origin verification header of the response.
|
||||
func (m *ResponseVerificationHeader) SetOrigin(v *ResponseVerificationHeader) {
|
||||
m.Origin = v
|
||||
}
|
||||
|
||||
// FromString parses ObjectSessionContext_Verb from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *ObjectSessionContext_Verb) FromString(s string) bool {
|
||||
i, ok := ObjectSessionContext_Verb_value[s]
|
||||
if ok {
|
||||
*x = ObjectSessionContext_Verb(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses ContainerSessionContext_Verb from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *ContainerSessionContext_Verb) FromString(s string) bool {
|
||||
i, ok := ContainerSessionContext_Verb_value[s]
|
||||
if ok {
|
||||
*x = ContainerSessionContext_Verb(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
1451
session/grpc/types.pb.go
generated
1451
session/grpc/types.pb.go
generated
File diff suppressed because it is too large
Load diff
2730
session/grpc/types_frostfs.pb.go
generated
Normal file
2730
session/grpc/types_frostfs.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
159
session/grpc/types_frostfs_fuzz.go
Normal file
159
session/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,159 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package session
|
||||
|
||||
func DoFuzzProtoObjectSessionContext(data []byte) int {
|
||||
msg := new(ObjectSessionContext)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONObjectSessionContext(data []byte) int {
|
||||
msg := new(ObjectSessionContext)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoContainerSessionContext(data []byte) int {
|
||||
msg := new(ContainerSessionContext)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONContainerSessionContext(data []byte) int {
|
||||
msg := new(ContainerSessionContext)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSessionToken(data []byte) int {
|
||||
msg := new(SessionToken)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSessionToken(data []byte) int {
|
||||
msg := new(SessionToken)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoXHeader(data []byte) int {
|
||||
msg := new(XHeader)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONXHeader(data []byte) int {
|
||||
msg := new(XHeader)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoRequestMetaHeader(data []byte) int {
|
||||
msg := new(RequestMetaHeader)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONRequestMetaHeader(data []byte) int {
|
||||
msg := new(RequestMetaHeader)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoResponseMetaHeader(data []byte) int {
|
||||
msg := new(ResponseMetaHeader)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONResponseMetaHeader(data []byte) int {
|
||||
msg := new(ResponseMetaHeader)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoRequestVerificationHeader(data []byte) int {
|
||||
msg := new(RequestVerificationHeader)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONRequestVerificationHeader(data []byte) int {
|
||||
msg := new(RequestVerificationHeader)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoResponseVerificationHeader(data []byte) int {
|
||||
msg := new(ResponseVerificationHeader)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONResponseVerificationHeader(data []byte) int {
|
||||
msg := new(ResponseVerificationHeader)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
91
session/grpc/types_frostfs_test.go
Normal file
91
session/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,91 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package session
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoObjectSessionContext(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoObjectSessionContext(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONObjectSessionContext(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONObjectSessionContext(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoContainerSessionContext(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoContainerSessionContext(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONContainerSessionContext(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONContainerSessionContext(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSessionToken(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSessionToken(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSessionToken(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSessionToken(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoXHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoXHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONXHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONXHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoRequestMetaHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoRequestMetaHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONRequestMetaHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONRequestMetaHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoResponseMetaHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoResponseMetaHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONResponseMetaHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONResponseMetaHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoRequestVerificationHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoRequestVerificationHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONRequestVerificationHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONRequestVerificationHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoResponseVerificationHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoResponseVerificationHeader(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONResponseVerificationHeader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONResponseVerificationHeader(data)
|
||||
})
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package status
|
||||
|
||||
// SetId sets identifier of the Status_Detail.
|
||||
func (x *Status_Detail) SetId(v uint32) {
|
||||
x.Id = v
|
||||
}
|
||||
|
||||
// SetValue sets value of the Status_Detail.
|
||||
func (x *Status_Detail) SetValue(v []byte) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// SetCode sets code of the Status.
|
||||
func (x *Status) SetCode(v uint32) {
|
||||
x.Code = v
|
||||
}
|
||||
|
||||
// SetMessage sets message about the Status.
|
||||
func (x *Status) SetMessage(v string) {
|
||||
x.Message = v
|
||||
}
|
||||
|
||||
// SetDetails sets details of the Status.
|
||||
func (x *Status) SetDetails(v []*Status_Detail) {
|
||||
x.Details = v
|
||||
}
|
721
status/grpc/types.pb.go
generated
721
status/grpc/types.pb.go
generated
|
@ -1,721 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: status/grpc/types.proto
|
||||
|
||||
package status
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Section identifiers.
|
||||
type Section int32
|
||||
|
||||
const (
|
||||
// Successful return codes.
|
||||
Section_SECTION_SUCCESS Section = 0
|
||||
// Failure codes regardless of the operation.
|
||||
Section_SECTION_FAILURE_COMMON Section = 1
|
||||
// Object service-specific errors.
|
||||
Section_SECTION_OBJECT Section = 2
|
||||
// Container service-specific errors.
|
||||
Section_SECTION_CONTAINER Section = 3
|
||||
// Session service-specific errors.
|
||||
Section_SECTION_SESSION Section = 4
|
||||
// Session service-specific errors.
|
||||
Section_SECTION_APE_MANAGER Section = 5
|
||||
)
|
||||
|
||||
// Enum value maps for Section.
|
||||
var (
|
||||
Section_name = map[int32]string{
|
||||
0: "SECTION_SUCCESS",
|
||||
1: "SECTION_FAILURE_COMMON",
|
||||
2: "SECTION_OBJECT",
|
||||
3: "SECTION_CONTAINER",
|
||||
4: "SECTION_SESSION",
|
||||
5: "SECTION_APE_MANAGER",
|
||||
}
|
||||
Section_value = map[string]int32{
|
||||
"SECTION_SUCCESS": 0,
|
||||
"SECTION_FAILURE_COMMON": 1,
|
||||
"SECTION_OBJECT": 2,
|
||||
"SECTION_CONTAINER": 3,
|
||||
"SECTION_SESSION": 4,
|
||||
"SECTION_APE_MANAGER": 5,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Section) Enum() *Section {
|
||||
p := new(Section)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Section) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Section) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_status_grpc_types_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (Section) Type() protoreflect.EnumType {
|
||||
return &file_status_grpc_types_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x Section) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Section.Descriptor instead.
|
||||
func (Section) EnumDescriptor() ([]byte, []int) {
|
||||
return file_status_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// Section of NeoFS successful return codes.
|
||||
type Success int32
|
||||
|
||||
const (
|
||||
// [**0**] Default success. Not detailed.
|
||||
// If the server cannot match successful outcome to the code, it should
|
||||
// use this code.
|
||||
Success_OK Success = 0
|
||||
)
|
||||
|
||||
// Enum value maps for Success.
|
||||
var (
|
||||
Success_name = map[int32]string{
|
||||
0: "OK",
|
||||
}
|
||||
Success_value = map[string]int32{
|
||||
"OK": 0,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Success) Enum() *Success {
|
||||
p := new(Success)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Success) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Success) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_status_grpc_types_proto_enumTypes[1].Descriptor()
|
||||
}
|
||||
|
||||
func (Success) Type() protoreflect.EnumType {
|
||||
return &file_status_grpc_types_proto_enumTypes[1]
|
||||
}
|
||||
|
||||
func (x Success) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Success.Descriptor instead.
|
||||
func (Success) EnumDescriptor() ([]byte, []int) {
|
||||
return file_status_grpc_types_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
// Section of failed statuses independent of the operation.
|
||||
type CommonFail int32
|
||||
|
||||
const (
|
||||
// [**1024**] Internal server error, default failure. Not detailed.
|
||||
// If the server cannot match failed outcome to the code, it should
|
||||
// use this code.
|
||||
CommonFail_INTERNAL CommonFail = 0
|
||||
// [**1025**] Wrong magic of the NeoFS network.
|
||||
// Details:
|
||||
// - [**0**] Magic number of the served NeoFS network (big-endian 64-bit
|
||||
// unsigned integer).
|
||||
CommonFail_WRONG_MAGIC_NUMBER CommonFail = 1
|
||||
// [**1026**] Signature verification failure.
|
||||
CommonFail_SIGNATURE_VERIFICATION_FAIL CommonFail = 2
|
||||
// [**1027**] Node is under maintenance.
|
||||
CommonFail_NODE_UNDER_MAINTENANCE CommonFail = 3
|
||||
// [**1028**] Invalid argument error. If the server fails on validation of a
|
||||
// request parameter as the client sent it incorrectly, then this code should
|
||||
// be used.
|
||||
CommonFail_INVALID_ARGUMENT CommonFail = 4
|
||||
)
|
||||
|
||||
// Enum value maps for CommonFail.
|
||||
var (
|
||||
CommonFail_name = map[int32]string{
|
||||
0: "INTERNAL",
|
||||
1: "WRONG_MAGIC_NUMBER",
|
||||
2: "SIGNATURE_VERIFICATION_FAIL",
|
||||
3: "NODE_UNDER_MAINTENANCE",
|
||||
4: "INVALID_ARGUMENT",
|
||||
}
|
||||
CommonFail_value = map[string]int32{
|
||||
"INTERNAL": 0,
|
||||
"WRONG_MAGIC_NUMBER": 1,
|
||||
"SIGNATURE_VERIFICATION_FAIL": 2,
|
||||
"NODE_UNDER_MAINTENANCE": 3,
|
||||
"INVALID_ARGUMENT": 4,
|
||||
}
|
||||
)
|
||||
|
||||
func (x CommonFail) Enum() *CommonFail {
|
||||
p := new(CommonFail)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x CommonFail) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (CommonFail) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_status_grpc_types_proto_enumTypes[2].Descriptor()
|
||||
}
|
||||
|
||||
func (CommonFail) Type() protoreflect.EnumType {
|
||||
return &file_status_grpc_types_proto_enumTypes[2]
|
||||
}
|
||||
|
||||
func (x CommonFail) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CommonFail.Descriptor instead.
|
||||
func (CommonFail) EnumDescriptor() ([]byte, []int) {
|
||||
return file_status_grpc_types_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
// Section of statuses for object-related operations.
|
||||
type Object int32
|
||||
|
||||
const (
|
||||
// [**2048**] Access denied by ACL.
|
||||
// Details:
|
||||
// - [**0**] Human-readable description (UTF-8 encoded string).
|
||||
Object_ACCESS_DENIED Object = 0
|
||||
// [**2049**] Object not found.
|
||||
Object_OBJECT_NOT_FOUND Object = 1
|
||||
// [**2050**] Operation rejected by the object lock.
|
||||
Object_LOCKED Object = 2
|
||||
// [**2051**] Locking an object with a non-REGULAR type rejected.
|
||||
Object_LOCK_NON_REGULAR_OBJECT Object = 3
|
||||
// [**2052**] Object has been marked deleted.
|
||||
Object_OBJECT_ALREADY_REMOVED Object = 4
|
||||
// [**2053**] Invalid range has been requested for an object.
|
||||
Object_OUT_OF_RANGE Object = 5
|
||||
)
|
||||
|
||||
// Enum value maps for Object.
|
||||
var (
|
||||
Object_name = map[int32]string{
|
||||
0: "ACCESS_DENIED",
|
||||
1: "OBJECT_NOT_FOUND",
|
||||
2: "LOCKED",
|
||||
3: "LOCK_NON_REGULAR_OBJECT",
|
||||
4: "OBJECT_ALREADY_REMOVED",
|
||||
5: "OUT_OF_RANGE",
|
||||
}
|
||||
Object_value = map[string]int32{
|
||||
"ACCESS_DENIED": 0,
|
||||
"OBJECT_NOT_FOUND": 1,
|
||||
"LOCKED": 2,
|
||||
"LOCK_NON_REGULAR_OBJECT": 3,
|
||||
"OBJECT_ALREADY_REMOVED": 4,
|
||||
"OUT_OF_RANGE": 5,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Object) Enum() *Object {
|
||||
p := new(Object)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Object) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Object) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_status_grpc_types_proto_enumTypes[3].Descriptor()
|
||||
}
|
||||
|
||||
func (Object) Type() protoreflect.EnumType {
|
||||
return &file_status_grpc_types_proto_enumTypes[3]
|
||||
}
|
||||
|
||||
func (x Object) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Object.Descriptor instead.
|
||||
func (Object) EnumDescriptor() ([]byte, []int) {
|
||||
return file_status_grpc_types_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
// Section of statuses for container-related operations.
|
||||
type Container int32
|
||||
|
||||
const (
|
||||
// [**3072**] Container not found.
|
||||
Container_CONTAINER_NOT_FOUND Container = 0
|
||||
// [**3073**] eACL table not found.
|
||||
Container_EACL_NOT_FOUND Container = 1
|
||||
// [**3074**] Container access denied.
|
||||
Container_CONTAINER_ACCESS_DENIED Container = 2
|
||||
)
|
||||
|
||||
// Enum value maps for Container.
|
||||
var (
|
||||
Container_name = map[int32]string{
|
||||
0: "CONTAINER_NOT_FOUND",
|
||||
1: "EACL_NOT_FOUND",
|
||||
2: "CONTAINER_ACCESS_DENIED",
|
||||
}
|
||||
Container_value = map[string]int32{
|
||||
"CONTAINER_NOT_FOUND": 0,
|
||||
"EACL_NOT_FOUND": 1,
|
||||
"CONTAINER_ACCESS_DENIED": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Container) Enum() *Container {
|
||||
p := new(Container)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Container) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Container) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_status_grpc_types_proto_enumTypes[4].Descriptor()
|
||||
}
|
||||
|
||||
func (Container) Type() protoreflect.EnumType {
|
||||
return &file_status_grpc_types_proto_enumTypes[4]
|
||||
}
|
||||
|
||||
func (x Container) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Container.Descriptor instead.
|
||||
func (Container) EnumDescriptor() ([]byte, []int) {
|
||||
return file_status_grpc_types_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
// Section of statuses for session-related operations.
|
||||
type Session int32
|
||||
|
||||
const (
|
||||
// [**4096**] Token not found.
|
||||
Session_TOKEN_NOT_FOUND Session = 0
|
||||
// [**4097**] Token has expired.
|
||||
Session_TOKEN_EXPIRED Session = 1
|
||||
)
|
||||
|
||||
// Enum value maps for Session.
|
||||
var (
|
||||
Session_name = map[int32]string{
|
||||
0: "TOKEN_NOT_FOUND",
|
||||
1: "TOKEN_EXPIRED",
|
||||
}
|
||||
Session_value = map[string]int32{
|
||||
"TOKEN_NOT_FOUND": 0,
|
||||
"TOKEN_EXPIRED": 1,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Session) Enum() *Session {
|
||||
p := new(Session)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x Session) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (Session) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_status_grpc_types_proto_enumTypes[5].Descriptor()
|
||||
}
|
||||
|
||||
func (Session) Type() protoreflect.EnumType {
|
||||
return &file_status_grpc_types_proto_enumTypes[5]
|
||||
}
|
||||
|
||||
func (x Session) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Session.Descriptor instead.
|
||||
func (Session) EnumDescriptor() ([]byte, []int) {
|
||||
return file_status_grpc_types_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
// Section of status for APE manager related operations.
|
||||
type APEManager int32
|
||||
|
||||
const (
|
||||
// [**5120**] The operation is denied by APE manager.
|
||||
APEManager_APE_MANAGER_ACCESS_DENIED APEManager = 0
|
||||
)
|
||||
|
||||
// Enum value maps for APEManager.
|
||||
var (
|
||||
APEManager_name = map[int32]string{
|
||||
0: "APE_MANAGER_ACCESS_DENIED",
|
||||
}
|
||||
APEManager_value = map[string]int32{
|
||||
"APE_MANAGER_ACCESS_DENIED": 0,
|
||||
}
|
||||
)
|
||||
|
||||
func (x APEManager) Enum() *APEManager {
|
||||
p := new(APEManager)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x APEManager) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (APEManager) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_status_grpc_types_proto_enumTypes[6].Descriptor()
|
||||
}
|
||||
|
||||
func (APEManager) Type() protoreflect.EnumType {
|
||||
return &file_status_grpc_types_proto_enumTypes[6]
|
||||
}
|
||||
|
||||
func (x APEManager) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use APEManager.Descriptor instead.
|
||||
func (APEManager) EnumDescriptor() ([]byte, []int) {
|
||||
return file_status_grpc_types_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
// Declares the general format of the status returns of the NeoFS RPC protocol.
|
||||
// Status is present in all response messages. Each RPC of NeoFS protocol
|
||||
// describes the possible outcomes and details of the operation.
|
||||
//
|
||||
// Each status is assigned a one-to-one numeric code. Any unique result of an
|
||||
// operation in NeoFS is unambiguously associated with the code value.
|
||||
//
|
||||
// Numerical set of codes is split into 1024-element sections. An enumeration
|
||||
// is defined for each section. Values can be referred to in the following ways:
|
||||
//
|
||||
// * numerical value ranging from 0 to 4,294,967,295 (global code);
|
||||
//
|
||||
// - values from enumeration (local code). The formula for the ratio of the
|
||||
// local code (`L`) of a defined section (`S`) to the global one (`G`):
|
||||
// `G = 1024 * S + L`.
|
||||
//
|
||||
// All outcomes are divided into successful and failed, which corresponds
|
||||
// to the success or failure of the operation. The definition of success
|
||||
// follows the semantics of RPC and the description of its purpose.
|
||||
// The server must not attach code that is the opposite of the outcome type.
|
||||
//
|
||||
// See the set of return codes in the description for calls.
|
||||
//
|
||||
// Each status can carry a developer-facing error message. It should be a human
|
||||
// readable text in English. The server should not transmit (and the client
|
||||
// should not expect) useful information in the message. Field `details`
|
||||
// should make the return more detailed.
|
||||
type Status struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The status code
|
||||
Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
|
||||
// Developer-facing error message
|
||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||
// Data detailing the outcome of the operation. Must be unique by ID.
|
||||
Details []*Status_Detail `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Status) Reset() {
|
||||
*x = Status{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_status_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Status) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Status) ProtoMessage() {}
|
||||
|
||||
func (x *Status) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_status_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Status.ProtoReflect.Descriptor instead.
|
||||
func (*Status) Descriptor() ([]byte, []int) {
|
||||
return file_status_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Status) GetCode() uint32 {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Status) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Status) GetDetails() []*Status_Detail {
|
||||
if x != nil {
|
||||
return x.Details
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Return detail. It contains additional information that can be used to
|
||||
// analyze the response. Each code defines a set of details that can be
|
||||
// attached to a status. Client should not handle details that are not
|
||||
// covered by the code.
|
||||
type Status_Detail struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Detail ID. The identifier is required to determine the binary format
|
||||
// of the detail and how to decode it.
|
||||
Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// Binary status detail. Must follow the format associated with ID.
|
||||
// The possibility of missing a value must be explicitly allowed.
|
||||
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Status_Detail) Reset() {
|
||||
*x = Status_Detail{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_status_grpc_types_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Status_Detail) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Status_Detail) ProtoMessage() {}
|
||||
|
||||
func (x *Status_Detail) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_status_grpc_types_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Status_Detail.ProtoReflect.Descriptor instead.
|
||||
func (*Status_Detail) Descriptor() ([]byte, []int) {
|
||||
return file_status_grpc_types_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (x *Status_Detail) GetId() uint32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Status_Detail) GetValue() []byte {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_status_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_status_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x17, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79,
|
||||
0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, 0x2e, 0x66,
|
||||
0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x06,
|
||||
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65,
|
||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18,
|
||||
0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76,
|
||||
0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e,
|
||||
0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a,
|
||||
0x2e, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a,
|
||||
0x93, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x53,
|
||||
0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00,
|
||||
0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c,
|
||||
0x55, 0x52, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e,
|
||||
0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02,
|
||||
0x12, 0x15, 0x0a, 0x11, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, 0x54,
|
||||
0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x43, 0x54, 0x49,
|
||||
0x4f, 0x4e, 0x5f, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x17, 0x0a, 0x13,
|
||||
0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41,
|
||||
0x47, 0x45, 0x52, 0x10, 0x05, 0x2a, 0x11, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
|
||||
0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x2a, 0x85, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6d,
|
||||
0x6d, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52,
|
||||
0x4e, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x57, 0x52, 0x4f, 0x4e, 0x47, 0x5f, 0x4d,
|
||||
0x41, 0x47, 0x49, 0x43, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1f, 0x0a,
|
||||
0x1b, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46,
|
||||
0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x02, 0x12, 0x1a,
|
||||
0x0a, 0x16, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x4d, 0x41, 0x49,
|
||||
0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4e,
|
||||
0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x04,
|
||||
0x2a, 0x88, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x41,
|
||||
0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14,
|
||||
0x0a, 0x10, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55,
|
||||
0x4e, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02,
|
||||
0x12, 0x1b, 0x0a, 0x17, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x47,
|
||||
0x55, 0x4c, 0x41, 0x52, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x1a, 0x0a,
|
||||
0x16, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f,
|
||||
0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, 0x54,
|
||||
0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x2a, 0x55, 0x0a, 0x09, 0x43,
|
||||
0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x54,
|
||||
0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10,
|
||||
0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x41, 0x43, 0x4c, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f,
|
||||
0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e,
|
||||
0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44,
|
||||
0x10, 0x02, 0x2a, 0x31, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a,
|
||||
0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44,
|
||||
0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49,
|
||||
0x52, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x2b, 0x0a, 0x0a, 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61,
|
||||
0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47,
|
||||
0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44,
|
||||
0x10, 0x00, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66,
|
||||
0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d,
|
||||
0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70,
|
||||
0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46,
|
||||
0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_status_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_status_grpc_types_proto_rawDescData = file_status_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_status_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_status_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_status_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_status_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_status_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 7)
|
||||
var file_status_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_status_grpc_types_proto_goTypes = []interface{}{
|
||||
(Section)(0), // 0: neo.fs.v2.status.Section
|
||||
(Success)(0), // 1: neo.fs.v2.status.Success
|
||||
(CommonFail)(0), // 2: neo.fs.v2.status.CommonFail
|
||||
(Object)(0), // 3: neo.fs.v2.status.Object
|
||||
(Container)(0), // 4: neo.fs.v2.status.Container
|
||||
(Session)(0), // 5: neo.fs.v2.status.Session
|
||||
(APEManager)(0), // 6: neo.fs.v2.status.APEManager
|
||||
(*Status)(nil), // 7: neo.fs.v2.status.Status
|
||||
(*Status_Detail)(nil), // 8: neo.fs.v2.status.Status.Detail
|
||||
}
|
||||
var file_status_grpc_types_proto_depIdxs = []int32{
|
||||
8, // 0: neo.fs.v2.status.Status.details:type_name -> neo.fs.v2.status.Status.Detail
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_status_grpc_types_proto_init() }
|
||||
func file_status_grpc_types_proto_init() {
|
||||
if File_status_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_status_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Status); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_status_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Status_Detail); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_status_grpc_types_proto_rawDesc,
|
||||
NumEnums: 7,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_status_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_status_grpc_types_proto_depIdxs,
|
||||
EnumInfos: file_status_grpc_types_proto_enumTypes,
|
||||
MessageInfos: file_status_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_status_grpc_types_proto = out.File
|
||||
file_status_grpc_types_proto_rawDesc = nil
|
||||
file_status_grpc_types_proto_goTypes = nil
|
||||
file_status_grpc_types_proto_depIdxs = nil
|
||||
}
|
643
status/grpc/types_frostfs.pb.go
generated
Normal file
643
status/grpc/types_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,643 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package status
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
strconv "strconv"
|
||||
)
|
||||
|
||||
type Section int32
|
||||
|
||||
const (
|
||||
Section_SECTION_SUCCESS Section = 0
|
||||
Section_SECTION_FAILURE_COMMON Section = 1
|
||||
Section_SECTION_OBJECT Section = 2
|
||||
Section_SECTION_CONTAINER Section = 3
|
||||
Section_SECTION_SESSION Section = 4
|
||||
Section_SECTION_APE_MANAGER Section = 5
|
||||
)
|
||||
|
||||
var (
|
||||
Section_name = map[int32]string{
|
||||
0: "SECTION_SUCCESS",
|
||||
1: "SECTION_FAILURE_COMMON",
|
||||
2: "SECTION_OBJECT",
|
||||
3: "SECTION_CONTAINER",
|
||||
4: "SECTION_SESSION",
|
||||
5: "SECTION_APE_MANAGER",
|
||||
}
|
||||
Section_value = map[string]int32{
|
||||
"SECTION_SUCCESS": 0,
|
||||
"SECTION_FAILURE_COMMON": 1,
|
||||
"SECTION_OBJECT": 2,
|
||||
"SECTION_CONTAINER": 3,
|
||||
"SECTION_SESSION": 4,
|
||||
"SECTION_APE_MANAGER": 5,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Section) String() string {
|
||||
if v, ok := Section_name[int32(x)]; ok {
|
||||
return v
|
||||
}
|
||||
return strconv.FormatInt(int64(x), 10)
|
||||
}
|
||||
func (x *Section) FromString(s string) bool {
|
||||
if v, ok := Section_value[s]; ok {
|
||||
*x = Section(v)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type Success int32
|
||||
|
||||
const (
|
||||
Success_OK Success = 0
|
||||
)
|
||||
|
||||
var (
|
||||
Success_name = map[int32]string{
|
||||
0: "OK",
|
||||
}
|
||||
Success_value = map[string]int32{
|
||||
"OK": 0,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Success) String() string {
|
||||
if v, ok := Success_name[int32(x)]; ok {
|
||||
return v
|
||||
}
|
||||
return strconv.FormatInt(int64(x), 10)
|
||||
}
|
||||
func (x *Success) FromString(s string) bool {
|
||||
if v, ok := Success_value[s]; ok {
|
||||
*x = Success(v)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type CommonFail int32
|
||||
|
||||
const (
|
||||
CommonFail_INTERNAL CommonFail = 0
|
||||
CommonFail_WRONG_MAGIC_NUMBER CommonFail = 1
|
||||
CommonFail_SIGNATURE_VERIFICATION_FAIL CommonFail = 2
|
||||
CommonFail_NODE_UNDER_MAINTENANCE CommonFail = 3
|
||||
CommonFail_INVALID_ARGUMENT CommonFail = 4
|
||||
)
|
||||
|
||||
var (
|
||||
CommonFail_name = map[int32]string{
|
||||
0: "INTERNAL",
|
||||
1: "WRONG_MAGIC_NUMBER",
|
||||
2: "SIGNATURE_VERIFICATION_FAIL",
|
||||
3: "NODE_UNDER_MAINTENANCE",
|
||||
4: "INVALID_ARGUMENT",
|
||||
}
|
||||
CommonFail_value = map[string]int32{
|
||||
"INTERNAL": 0,
|
||||
"WRONG_MAGIC_NUMBER": 1,
|
||||
"SIGNATURE_VERIFICATION_FAIL": 2,
|
||||
"NODE_UNDER_MAINTENANCE": 3,
|
||||
"INVALID_ARGUMENT": 4,
|
||||
}
|
||||
)
|
||||
|
||||
func (x CommonFail) String() string {
|
||||
if v, ok := CommonFail_name[int32(x)]; ok {
|
||||
return v
|
||||
}
|
||||
return strconv.FormatInt(int64(x), 10)
|
||||
}
|
||||
func (x *CommonFail) FromString(s string) bool {
|
||||
if v, ok := CommonFail_value[s]; ok {
|
||||
*x = CommonFail(v)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type Object int32
|
||||
|
||||
const (
|
||||
Object_ACCESS_DENIED Object = 0
|
||||
Object_OBJECT_NOT_FOUND Object = 1
|
||||
Object_LOCKED Object = 2
|
||||
Object_LOCK_NON_REGULAR_OBJECT Object = 3
|
||||
Object_OBJECT_ALREADY_REMOVED Object = 4
|
||||
Object_OUT_OF_RANGE Object = 5
|
||||
)
|
||||
|
||||
var (
|
||||
Object_name = map[int32]string{
|
||||
0: "ACCESS_DENIED",
|
||||
1: "OBJECT_NOT_FOUND",
|
||||
2: "LOCKED",
|
||||
3: "LOCK_NON_REGULAR_OBJECT",
|
||||
4: "OBJECT_ALREADY_REMOVED",
|
||||
5: "OUT_OF_RANGE",
|
||||
}
|
||||
Object_value = map[string]int32{
|
||||
"ACCESS_DENIED": 0,
|
||||
"OBJECT_NOT_FOUND": 1,
|
||||
"LOCKED": 2,
|
||||
"LOCK_NON_REGULAR_OBJECT": 3,
|
||||
"OBJECT_ALREADY_REMOVED": 4,
|
||||
"OUT_OF_RANGE": 5,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Object) String() string {
|
||||
if v, ok := Object_name[int32(x)]; ok {
|
||||
return v
|
||||
}
|
||||
return strconv.FormatInt(int64(x), 10)
|
||||
}
|
||||
func (x *Object) FromString(s string) bool {
|
||||
if v, ok := Object_value[s]; ok {
|
||||
*x = Object(v)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type Container int32
|
||||
|
||||
const (
|
||||
Container_CONTAINER_NOT_FOUND Container = 0
|
||||
Container_EACL_NOT_FOUND Container = 1
|
||||
Container_CONTAINER_ACCESS_DENIED Container = 2
|
||||
)
|
||||
|
||||
var (
|
||||
Container_name = map[int32]string{
|
||||
0: "CONTAINER_NOT_FOUND",
|
||||
1: "EACL_NOT_FOUND",
|
||||
2: "CONTAINER_ACCESS_DENIED",
|
||||
}
|
||||
Container_value = map[string]int32{
|
||||
"CONTAINER_NOT_FOUND": 0,
|
||||
"EACL_NOT_FOUND": 1,
|
||||
"CONTAINER_ACCESS_DENIED": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Container) String() string {
|
||||
if v, ok := Container_name[int32(x)]; ok {
|
||||
return v
|
||||
}
|
||||
return strconv.FormatInt(int64(x), 10)
|
||||
}
|
||||
func (x *Container) FromString(s string) bool {
|
||||
if v, ok := Container_value[s]; ok {
|
||||
*x = Container(v)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type Session int32
|
||||
|
||||
const (
|
||||
Session_TOKEN_NOT_FOUND Session = 0
|
||||
Session_TOKEN_EXPIRED Session = 1
|
||||
)
|
||||
|
||||
var (
|
||||
Session_name = map[int32]string{
|
||||
0: "TOKEN_NOT_FOUND",
|
||||
1: "TOKEN_EXPIRED",
|
||||
}
|
||||
Session_value = map[string]int32{
|
||||
"TOKEN_NOT_FOUND": 0,
|
||||
"TOKEN_EXPIRED": 1,
|
||||
}
|
||||
)
|
||||
|
||||
func (x Session) String() string {
|
||||
if v, ok := Session_name[int32(x)]; ok {
|
||||
return v
|
||||
}
|
||||
return strconv.FormatInt(int64(x), 10)
|
||||
}
|
||||
func (x *Session) FromString(s string) bool {
|
||||
if v, ok := Session_value[s]; ok {
|
||||
*x = Session(v)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type APEManager int32
|
||||
|
||||
const (
|
||||
APEManager_APE_MANAGER_ACCESS_DENIED APEManager = 0
|
||||
)
|
||||
|
||||
var (
|
||||
APEManager_name = map[int32]string{
|
||||
0: "APE_MANAGER_ACCESS_DENIED",
|
||||
}
|
||||
APEManager_value = map[string]int32{
|
||||
"APE_MANAGER_ACCESS_DENIED": 0,
|
||||
}
|
||||
)
|
||||
|
||||
func (x APEManager) String() string {
|
||||
if v, ok := APEManager_name[int32(x)]; ok {
|
||||
return v
|
||||
}
|
||||
return strconv.FormatInt(int64(x), 10)
|
||||
}
|
||||
func (x *APEManager) FromString(s string) bool {
|
||||
if v, ok := APEManager_value[s]; ok {
|
||||
*x = APEManager(v)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type Status_Detail struct {
|
||||
Id uint32 `json:"id"`
|
||||
Value []byte `json:"value"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Status_Detail)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Status_Detail)(nil)
|
||||
_ json.Marshaler = (*Status_Detail)(nil)
|
||||
_ json.Unmarshaler = (*Status_Detail)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Status_Detail) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.UInt32Size(1, x.Id)
|
||||
size += proto.BytesSize(2, x.Value)
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Status_Detail) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Status_Detail) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Id != 0 {
|
||||
mm.AppendUint32(1, x.Id)
|
||||
}
|
||||
if len(x.Value) != 0 {
|
||||
mm.AppendBytes(2, x.Value)
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Status_Detail) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Status_Detail")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Id
|
||||
data, ok := fc.Uint32()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Id")
|
||||
}
|
||||
x.Id = data
|
||||
case 2: // Value
|
||||
data, ok := fc.Bytes()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Value")
|
||||
}
|
||||
x.Value = data
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Status_Detail) GetId() uint32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *Status_Detail) SetId(v uint32) {
|
||||
x.Id = v
|
||||
}
|
||||
func (x *Status_Detail) GetValue() []byte {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Status_Detail) SetValue(v []byte) {
|
||||
x.Value = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Status_Detail) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Status_Detail) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"id\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Uint32(x.Id)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"value\":"
|
||||
out.RawString(prefix)
|
||||
out.Base64Bytes(x.Value)
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Status_Detail) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Status_Detail) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "id":
|
||||
{
|
||||
var f uint32
|
||||
f = in.Uint32()
|
||||
x.Id = f
|
||||
}
|
||||
case "value":
|
||||
{
|
||||
var f []byte
|
||||
f = in.Bytes()
|
||||
x.Value = f
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
||||
|
||||
type Status struct {
|
||||
Code uint32 `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Details []*Status_Detail `json:"details"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Status)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Status)(nil)
|
||||
_ json.Marshaler = (*Status)(nil)
|
||||
_ json.Unmarshaler = (*Status)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Status) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.UInt32Size(1, x.Code)
|
||||
size += proto.StringSize(2, x.Message)
|
||||
for i := range x.Details {
|
||||
size += proto.NestedStructureSize(3, x.Details[i])
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Status) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Status) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.Code != 0 {
|
||||
mm.AppendUint32(1, x.Code)
|
||||
}
|
||||
if len(x.Message) != 0 {
|
||||
mm.AppendString(2, x.Message)
|
||||
}
|
||||
for i := range x.Details {
|
||||
if x.Details[i] != nil && x.Details[i].StableSize() != 0 {
|
||||
x.Details[i].EmitProtobuf(mm.AppendMessage(3))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Status) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Status")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // Code
|
||||
data, ok := fc.Uint32()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Code")
|
||||
}
|
||||
x.Code = data
|
||||
case 2: // Message
|
||||
data, ok := fc.String()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Message")
|
||||
}
|
||||
x.Message = data
|
||||
case 3: // Details
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Details")
|
||||
}
|
||||
x.Details = append(x.Details, new(Status_Detail))
|
||||
ff := x.Details[len(x.Details)-1]
|
||||
if err := ff.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Status) GetCode() uint32 {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *Status) SetCode(v uint32) {
|
||||
x.Code = v
|
||||
}
|
||||
func (x *Status) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (x *Status) SetMessage(v string) {
|
||||
x.Message = v
|
||||
}
|
||||
func (x *Status) GetDetails() []*Status_Detail {
|
||||
if x != nil {
|
||||
return x.Details
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Status) SetDetails(v []*Status_Detail) {
|
||||
x.Details = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Status) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Status) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"code\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Uint32(x.Code)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"message\":"
|
||||
out.RawString(prefix)
|
||||
out.String(x.Message)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"details\":"
|
||||
out.RawString(prefix)
|
||||
out.RawByte('[')
|
||||
for i := range x.Details {
|
||||
if i != 0 {
|
||||
out.RawByte(',')
|
||||
}
|
||||
x.Details[i].MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte(']')
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Status) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Status) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "code":
|
||||
{
|
||||
var f uint32
|
||||
f = in.Uint32()
|
||||
x.Code = f
|
||||
}
|
||||
case "message":
|
||||
{
|
||||
var f string
|
||||
f = in.String()
|
||||
x.Message = f
|
||||
}
|
||||
case "details":
|
||||
{
|
||||
var f *Status_Detail
|
||||
var list []*Status_Detail
|
||||
in.Delim('[')
|
||||
for !in.IsDelim(']') {
|
||||
f = new(Status_Detail)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
list = append(list, f)
|
||||
in.WantComma()
|
||||
}
|
||||
x.Details = list
|
||||
in.Delim(']')
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
26
status/grpc/types_frostfs_fuzz.go
Normal file
26
status/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package status
|
||||
|
||||
func DoFuzzProtoStatus(data []byte) int {
|
||||
msg := new(Status)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONStatus(data []byte) int {
|
||||
msg := new(Status)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
21
status/grpc/types_frostfs_test.go
Normal file
21
status/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package status
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoStatus(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoStatus(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONStatus(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONStatus(data)
|
||||
})
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package tombstone
|
||||
|
||||
import (
|
||||
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
)
|
||||
|
||||
// SetExpirationEpoch sets number of tombstone expiration epoch.
|
||||
func (x *Tombstone) SetExpirationEpoch(v uint64) {
|
||||
x.ExpirationEpoch = v
|
||||
}
|
||||
|
||||
// SetSplitId sets identifier of split object hierarchy.
|
||||
func (x *Tombstone) SetSplitId(v []byte) {
|
||||
x.SplitId = v
|
||||
}
|
||||
|
||||
// SetMembers sets list of objects to be deleted.
|
||||
func (x *Tombstone) SetMembers(v []*refs.ObjectID) {
|
||||
x.Members = v
|
||||
}
|
187
tombstone/grpc/types.pb.go
generated
187
tombstone/grpc/types.pb.go
generated
|
@ -1,187 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc v5.27.2
|
||||
// source: tombstone/grpc/types.proto
|
||||
|
||||
package tombstone
|
||||
|
||||
import (
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// Tombstone keeps record of deleted objects for a few epochs until they are
|
||||
// purged from the NeoFS network.
|
||||
type Tombstone struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Last NeoFS epoch number of the tombstone lifetime. It's set by the
|
||||
// tombstone creator depending on the current NeoFS network settings. A
|
||||
// tombstone object must have the same expiration epoch value in
|
||||
// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated)
|
||||
// attribute. Otherwise, the tombstone will be rejected by a storage node.
|
||||
ExpirationEpoch uint64 `protobuf:"varint,1,opt,name=expiration_epoch,json=expirationEpoch,proto3" json:"expiration_epoch,omitempty"`
|
||||
// 16 byte UUID used to identify the split object hierarchy parts. Must be
|
||||
// unique inside a container. All objects participating in the split must
|
||||
// have the same `split_id` value.
|
||||
SplitId []byte `protobuf:"bytes,2,opt,name=split_id,json=splitID,proto3" json:"split_id,omitempty"`
|
||||
// List of objects to be deleted.
|
||||
Members []*grpc.ObjectID `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Tombstone) Reset() {
|
||||
*x = Tombstone{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_tombstone_grpc_types_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Tombstone) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Tombstone) ProtoMessage() {}
|
||||
|
||||
func (x *Tombstone) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_tombstone_grpc_types_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Tombstone.ProtoReflect.Descriptor instead.
|
||||
func (*Tombstone) Descriptor() ([]byte, []int) {
|
||||
return file_tombstone_grpc_types_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Tombstone) GetExpirationEpoch() uint64 {
|
||||
if x != nil {
|
||||
return x.ExpirationEpoch
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Tombstone) GetSplitId() []byte {
|
||||
if x != nil {
|
||||
return x.SplitId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Tombstone) GetMembers() []*grpc.ObjectID {
|
||||
if x != nil {
|
||||
return x.Members
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_tombstone_grpc_types_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_tombstone_grpc_types_proto_rawDesc = []byte{
|
||||
0x0a, 0x1a, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63,
|
||||
0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x6e, 0x65,
|
||||
0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e,
|
||||
0x65, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70,
|
||||
0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x01, 0x0a, 0x09, 0x54, 0x6f, 0x6d,
|
||||
0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63,
|
||||
0x68, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x12, 0x32, 0x0a, 0x07,
|
||||
0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
|
||||
0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f,
|
||||
0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73,
|
||||
0x42, 0x6a, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e,
|
||||
0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61,
|
||||
0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f,
|
||||
0x2f, 0x76, 0x32, 0x2f, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x72,
|
||||
0x70, 0x63, 0x3b, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0xaa, 0x02, 0x1d, 0x4e,
|
||||
0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41,
|
||||
0x50, 0x49, 0x2e, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_tombstone_grpc_types_proto_rawDescOnce sync.Once
|
||||
file_tombstone_grpc_types_proto_rawDescData = file_tombstone_grpc_types_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_tombstone_grpc_types_proto_rawDescGZIP() []byte {
|
||||
file_tombstone_grpc_types_proto_rawDescOnce.Do(func() {
|
||||
file_tombstone_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_tombstone_grpc_types_proto_rawDescData)
|
||||
})
|
||||
return file_tombstone_grpc_types_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_tombstone_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_tombstone_grpc_types_proto_goTypes = []interface{}{
|
||||
(*Tombstone)(nil), // 0: neo.fs.v2.tombstone.Tombstone
|
||||
(*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID
|
||||
}
|
||||
var file_tombstone_grpc_types_proto_depIdxs = []int32{
|
||||
1, // 0: neo.fs.v2.tombstone.Tombstone.members:type_name -> neo.fs.v2.refs.ObjectID
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_tombstone_grpc_types_proto_init() }
|
||||
func file_tombstone_grpc_types_proto_init() {
|
||||
if File_tombstone_grpc_types_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_tombstone_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Tombstone); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_tombstone_grpc_types_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_tombstone_grpc_types_proto_goTypes,
|
||||
DependencyIndexes: file_tombstone_grpc_types_proto_depIdxs,
|
||||
MessageInfos: file_tombstone_grpc_types_proto_msgTypes,
|
||||
}.Build()
|
||||
File_tombstone_grpc_types_proto = out.File
|
||||
file_tombstone_grpc_types_proto_rawDesc = nil
|
||||
file_tombstone_grpc_types_proto_goTypes = nil
|
||||
file_tombstone_grpc_types_proto_depIdxs = nil
|
||||
}
|
229
tombstone/grpc/types_frostfs.pb.go
generated
Normal file
229
tombstone/grpc/types_frostfs.pb.go
generated
Normal file
|
@ -0,0 +1,229 @@
|
|||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package tombstone
|
||||
|
||||
import (
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
||||
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
|
||||
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
|
||||
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
|
||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||
jlexer "github.com/mailru/easyjson/jlexer"
|
||||
jwriter "github.com/mailru/easyjson/jwriter"
|
||||
)
|
||||
|
||||
type Tombstone struct {
|
||||
ExpirationEpoch uint64 `json:"expirationEpoch"`
|
||||
SplitId []byte `json:"splitID"`
|
||||
Members []*grpc.ObjectID `json:"members"`
|
||||
}
|
||||
|
||||
var (
|
||||
_ encoding.ProtoMarshaler = (*Tombstone)(nil)
|
||||
_ encoding.ProtoUnmarshaler = (*Tombstone)(nil)
|
||||
_ json.Marshaler = (*Tombstone)(nil)
|
||||
_ json.Unmarshaler = (*Tombstone)(nil)
|
||||
)
|
||||
|
||||
// StableSize returns the size of x in protobuf format.
|
||||
//
|
||||
// Structures with the same field values have the same binary size.
|
||||
func (x *Tombstone) StableSize() (size int) {
|
||||
if x == nil {
|
||||
return 0
|
||||
}
|
||||
size += proto.UInt64Size(1, x.ExpirationEpoch)
|
||||
size += proto.BytesSize(2, x.SplitId)
|
||||
for i := range x.Members {
|
||||
size += proto.NestedStructureSize(3, x.Members[i])
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
|
||||
func (x *Tombstone) MarshalProtobuf(dst []byte) []byte {
|
||||
m := pool.MarshalerPool.Get()
|
||||
defer pool.MarshalerPool.Put(m)
|
||||
x.EmitProtobuf(m.MessageMarshaler())
|
||||
dst = m.Marshal(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (x *Tombstone) EmitProtobuf(mm *easyproto.MessageMarshaler) {
|
||||
if x == nil {
|
||||
return
|
||||
}
|
||||
if x.ExpirationEpoch != 0 {
|
||||
mm.AppendUint64(1, x.ExpirationEpoch)
|
||||
}
|
||||
if len(x.SplitId) != 0 {
|
||||
mm.AppendBytes(2, x.SplitId)
|
||||
}
|
||||
for i := range x.Members {
|
||||
if x.Members[i] != nil && x.Members[i].StableSize() != 0 {
|
||||
x.Members[i].EmitProtobuf(mm.AppendMessage(3))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
|
||||
func (x *Tombstone) UnmarshalProtobuf(src []byte) (err error) {
|
||||
var fc easyproto.FieldContext
|
||||
for len(src) > 0 {
|
||||
src, err = fc.NextField(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read next field in %s", "Tombstone")
|
||||
}
|
||||
switch fc.FieldNum {
|
||||
case 1: // ExpirationEpoch
|
||||
data, ok := fc.Uint64()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "ExpirationEpoch")
|
||||
}
|
||||
x.ExpirationEpoch = data
|
||||
case 2: // SplitId
|
||||
data, ok := fc.Bytes()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "SplitId")
|
||||
}
|
||||
x.SplitId = data
|
||||
case 3: // Members
|
||||
data, ok := fc.MessageData()
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot unmarshal field %s", "Members")
|
||||
}
|
||||
x.Members = append(x.Members, new(grpc.ObjectID))
|
||||
ff := x.Members[len(x.Members)-1]
|
||||
if err := ff.UnmarshalProtobuf(data); err != nil {
|
||||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Tombstone) GetExpirationEpoch() uint64 {
|
||||
if x != nil {
|
||||
return x.ExpirationEpoch
|
||||
}
|
||||
return 0
|
||||
}
|
||||
func (x *Tombstone) SetExpirationEpoch(v uint64) {
|
||||
x.ExpirationEpoch = v
|
||||
}
|
||||
func (x *Tombstone) GetSplitId() []byte {
|
||||
if x != nil {
|
||||
return x.SplitId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Tombstone) SetSplitId(v []byte) {
|
||||
x.SplitId = v
|
||||
}
|
||||
func (x *Tombstone) GetMembers() []*grpc.ObjectID {
|
||||
if x != nil {
|
||||
return x.Members
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (x *Tombstone) SetMembers(v []*grpc.ObjectID) {
|
||||
x.Members = v
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (x *Tombstone) MarshalJSON() ([]byte, error) {
|
||||
w := jwriter.Writer{}
|
||||
x.MarshalEasyJSON(&w)
|
||||
return w.Buffer.BuildBytes(), w.Error
|
||||
}
|
||||
func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) {
|
||||
if x == nil {
|
||||
out.RawString("null")
|
||||
return
|
||||
}
|
||||
out.RawByte('{')
|
||||
{
|
||||
const prefix string = ",\"expirationEpoch\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Uint64(x.ExpirationEpoch)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"splitID\":"
|
||||
out.RawString(prefix)
|
||||
out.Base64Bytes(x.SplitId)
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"members\":"
|
||||
out.RawString(prefix)
|
||||
out.RawByte('[')
|
||||
for i := range x.Members {
|
||||
if i != 0 {
|
||||
out.RawByte(',')
|
||||
}
|
||||
x.Members[i].MarshalEasyJSON(out)
|
||||
}
|
||||
out.RawByte(']')
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (x *Tombstone) UnmarshalJSON(data []byte) error {
|
||||
r := jlexer.Lexer{Data: data}
|
||||
x.UnmarshalEasyJSON(&r)
|
||||
return r.Error()
|
||||
}
|
||||
func (x *Tombstone) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||
isTopLevel := in.IsStart()
|
||||
if in.IsNull() {
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
in.Skip()
|
||||
return
|
||||
}
|
||||
in.Delim('{')
|
||||
for !in.IsDelim('}') {
|
||||
key := in.UnsafeFieldName(false)
|
||||
in.WantColon()
|
||||
if in.IsNull() {
|
||||
in.Skip()
|
||||
in.WantComma()
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "expirationEpoch":
|
||||
{
|
||||
var f uint64
|
||||
f = in.Uint64()
|
||||
x.ExpirationEpoch = f
|
||||
}
|
||||
case "splitID":
|
||||
{
|
||||
var f []byte
|
||||
f = in.Bytes()
|
||||
x.SplitId = f
|
||||
}
|
||||
case "members":
|
||||
{
|
||||
var f *grpc.ObjectID
|
||||
var list []*grpc.ObjectID
|
||||
in.Delim('[')
|
||||
for !in.IsDelim(']') {
|
||||
f = new(grpc.ObjectID)
|
||||
f.UnmarshalEasyJSON(in)
|
||||
list = append(list, f)
|
||||
in.WantComma()
|
||||
}
|
||||
x.Members = list
|
||||
in.Delim(']')
|
||||
}
|
||||
}
|
||||
in.WantComma()
|
||||
}
|
||||
in.Delim('}')
|
||||
if isTopLevel {
|
||||
in.Consumed()
|
||||
}
|
||||
}
|
26
tombstone/grpc/types_frostfs_fuzz.go
Normal file
26
tombstone/grpc/types_frostfs_fuzz.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package tombstone
|
||||
|
||||
func DoFuzzProtoTombstone(data []byte) int {
|
||||
msg := new(Tombstone)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONTombstone(data []byte) int {
|
||||
msg := new(Tombstone)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
21
tombstone/grpc/types_frostfs_test.go
Normal file
21
tombstone/grpc/types_frostfs_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package tombstone
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoTombstone(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoTombstone(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONTombstone(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONTombstone(data)
|
||||
})
|
||||
}
|
7
util/pool/marshal.go
Normal file
7
util/pool/marshal.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package pool
|
||||
|
||||
import (
|
||||
"github.com/VictoriaMetrics/easyproto"
|
||||
)
|
||||
|
||||
var MarshalerPool easyproto.MarshalerPool
|
22
util/proto/encoding/compat.go
Normal file
22
util/proto/encoding/compat.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package encoding
|
||||
|
||||
import (
|
||||
_ "google.golang.org/grpc/encoding/proto" // Ensure default codec is registered before our one.
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/protoadapt"
|
||||
)
|
||||
|
||||
// messageV2Of converts v to a proto.Message.
|
||||
// This is needed for this library to continue working in presence of external gRPC packages,
|
||||
// such as opentelemetry gRPC exporter.
|
||||
// Copied from https://github.com/grpc/grpc-go/blob/e524655becd8d4c7ba9e8687faef456e495e341e/encoding/proto/proto.go#L59.
|
||||
func messageV2Of(v any) proto.Message {
|
||||
switch v := v.(type) {
|
||||
case protoadapt.MessageV1:
|
||||
return protoadapt.MessageV2Of(v)
|
||||
case protoadapt.MessageV2:
|
||||
return v
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
48
util/proto/encoding/json.go
Normal file
48
util/proto/encoding/json.go
Normal file
|
@ -0,0 +1,48 @@
|
|||
package encoding
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"google.golang.org/grpc/encoding"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
// JSONCodec is easyjson codec used for code generated by protogen.
|
||||
// It is binary-level compatible with the standard protojson format, thus uses the same name.
|
||||
type JSONCodec struct{}
|
||||
|
||||
var _ encoding.Codec = JSONCodec{}
|
||||
|
||||
func init() {
|
||||
encoding.RegisterCodec(JSONCodec{})
|
||||
}
|
||||
|
||||
// Name implements the encoding.Codec interface.
|
||||
func (JSONCodec) Name() string { return "json" }
|
||||
|
||||
// Marshal implements the encoding.Codec interface.
|
||||
func (JSONCodec) Marshal(v any) ([]byte, error) {
|
||||
switch v := v.(type) {
|
||||
case json.Marshaler:
|
||||
return json.Marshal(v)
|
||||
default:
|
||||
if v := messageV2Of(v); v != nil {
|
||||
return protojson.Marshal(v)
|
||||
}
|
||||
return nil, fmt.Errorf("failed to marshal, message is %T, want proto.Message", v)
|
||||
}
|
||||
}
|
||||
|
||||
// Unmarshal implements the encoding.Codec interface.
|
||||
func (JSONCodec) Unmarshal(data []byte, v any) error {
|
||||
switch v := v.(type) {
|
||||
case json.Unmarshaler:
|
||||
return json.Unmarshal(data, v)
|
||||
default:
|
||||
if v := messageV2Of(v); v != nil {
|
||||
return protojson.Unmarshal(data, v)
|
||||
}
|
||||
return fmt.Errorf("failed to unmarshal, message is %T, want proto.Message", v)
|
||||
}
|
||||
}
|
57
util/proto/encoding/proto.go
Normal file
57
util/proto/encoding/proto.go
Normal file
|
@ -0,0 +1,57 @@
|
|||
package encoding
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"google.golang.org/grpc/encoding"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// ProtoCodec is easyproto codec used for code generated by protogen.
|
||||
// It is binary-level compatible with the standard proto codec, thus uses the same name.
|
||||
type ProtoCodec struct{}
|
||||
|
||||
// ProtoMarshaler is an interface accepted by ProtoCodec.Marshal.
|
||||
type ProtoMarshaler interface {
|
||||
MarshalProtobuf([]byte) []byte
|
||||
}
|
||||
|
||||
// ProtoUnmarshaler is an interface accepted by ProtoCodec.Unmarshal.
|
||||
type ProtoUnmarshaler interface {
|
||||
UnmarshalProtobuf([]byte) error
|
||||
}
|
||||
|
||||
var _ encoding.Codec = ProtoCodec{}
|
||||
|
||||
func init() {
|
||||
encoding.RegisterCodec(ProtoCodec{})
|
||||
}
|
||||
|
||||
// Name implements the encoding.Codec interface.
|
||||
func (ProtoCodec) Name() string { return "proto" }
|
||||
|
||||
// Marshal implements the encoding.Codec interface.
|
||||
func (ProtoCodec) Marshal(v any) ([]byte, error) {
|
||||
switch v := v.(type) {
|
||||
case ProtoMarshaler:
|
||||
return v.MarshalProtobuf(nil), nil
|
||||
default:
|
||||
if v := messageV2Of(v); v != nil {
|
||||
return proto.Marshal(v)
|
||||
}
|
||||
return nil, fmt.Errorf("failed to marshal, message is %T, want proto.Message", v)
|
||||
}
|
||||
}
|
||||
|
||||
// Unmarshal implements the encoding.Codec interface.
|
||||
func (ProtoCodec) Unmarshal(data []byte, v any) error {
|
||||
switch v := v.(type) {
|
||||
case ProtoUnmarshaler:
|
||||
return v.UnmarshalProtobuf(data)
|
||||
default:
|
||||
if v := messageV2Of(v); v != nil {
|
||||
return proto.Unmarshal(data, v)
|
||||
}
|
||||
return fmt.Errorf("failed to unmarshal, message is %T, want proto.Message", v)
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue