[#317] api: Revert easyproto marshaler usage

It has caused a noticeable degradation in node.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-12-26 10:03:55 +03:00
parent bab4d5a692
commit 328d214d2d
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg
110 changed files with 47773 additions and 37555 deletions

View file

@ -52,13 +52,12 @@ protoc:
make protoc-install; \
fi
# Protoc generate
@for f in `find . -type f -name '*.proto' -not -path './bin/*' -not -path './api/util/proto/test/*'`; do \
@for f in `find . -type f -name '*.proto' -not -path './bin/*'`; do \
echo "⇒ Processing $$f "; \
$(PROTOC_DIR)/bin/protoc \
--proto_path=.:$(PROTOC_DIR)/include:/usr/local/include \
--plugin=protoc-gen-go-frostfs=$(abspath ./bin/protogen) \
--go-frostfs_out=fuzz=true:. \
--go-frostfs_opt=paths=source_relative \
--plugin=protoc-gen-go=$(PROTOC_GEN_GO_DIR)/protoc-gen-go \
--go_out=. --go_opt=paths=source_relative \
--go_opt=default_api_level=API_HYBRID \
--go-grpc_opt=require_unimplemented_servers=false \
--go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \
done

559
api/accounting/grpc/service.pb.go generated Normal file
View file

@ -0,0 +1,559 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/accounting/grpc/service.proto
//go:build !protoopaque
package accounting
import (
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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 `protogen:"hybrid.v1"`
// Body of the balance request message.
Body *BalanceRequest_Body `protobuf:"bytes,1,opt,name=body" 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" 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" json:"verify_header,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BalanceRequest) Reset() {
*x = BalanceRequest{}
mi := &file_api_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_api_accounting_grpc_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
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
}
func (x *BalanceRequest) SetBody(v *BalanceRequest_Body) {
x.Body = v
}
func (x *BalanceRequest) SetMetaHeader(v *grpc.RequestMetaHeader) {
x.MetaHeader = v
}
func (x *BalanceRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) {
x.VerifyHeader = v
}
func (x *BalanceRequest) HasBody() bool {
if x == nil {
return false
}
return x.Body != nil
}
func (x *BalanceRequest) HasMetaHeader() bool {
if x == nil {
return false
}
return x.MetaHeader != nil
}
func (x *BalanceRequest) HasVerifyHeader() bool {
if x == nil {
return false
}
return x.VerifyHeader != nil
}
func (x *BalanceRequest) ClearBody() {
x.Body = nil
}
func (x *BalanceRequest) ClearMetaHeader() {
x.MetaHeader = nil
}
func (x *BalanceRequest) ClearVerifyHeader() {
x.VerifyHeader = nil
}
type BalanceRequest_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Body of the balance request message.
Body *BalanceRequest_Body
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
MetaHeader *grpc.RequestMetaHeader
// 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
}
func (b0 BalanceRequest_builder) Build() *BalanceRequest {
m0 := &BalanceRequest{}
b, x := &b0, m0
_, _ = b, x
x.Body = b.Body
x.MetaHeader = b.MetaHeader
x.VerifyHeader = b.VerifyHeader
return m0
}
// BalanceResponse message
type BalanceResponse struct {
state protoimpl.MessageState `protogen:"hybrid.v1"`
// Body of the balance response message.
Body *BalanceResponse_Body `protobuf:"bytes,1,opt,name=body" 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" 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" json:"verify_header,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BalanceResponse) Reset() {
*x = BalanceResponse{}
mi := &file_api_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_api_accounting_grpc_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
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
}
func (x *BalanceResponse) SetBody(v *BalanceResponse_Body) {
x.Body = v
}
func (x *BalanceResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) {
x.MetaHeader = v
}
func (x *BalanceResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) {
x.VerifyHeader = v
}
func (x *BalanceResponse) HasBody() bool {
if x == nil {
return false
}
return x.Body != nil
}
func (x *BalanceResponse) HasMetaHeader() bool {
if x == nil {
return false
}
return x.MetaHeader != nil
}
func (x *BalanceResponse) HasVerifyHeader() bool {
if x == nil {
return false
}
return x.VerifyHeader != nil
}
func (x *BalanceResponse) ClearBody() {
x.Body = nil
}
func (x *BalanceResponse) ClearMetaHeader() {
x.MetaHeader = nil
}
func (x *BalanceResponse) ClearVerifyHeader() {
x.VerifyHeader = nil
}
type BalanceResponse_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Body of the balance response message.
Body *BalanceResponse_Body
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
MetaHeader *grpc.ResponseMetaHeader
// 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
}
func (b0 BalanceResponse_builder) Build() *BalanceResponse {
m0 := &BalanceResponse{}
b, x := &b0, m0
_, _ = b, x
x.Body = b.Body
x.MetaHeader = b.MetaHeader
x.VerifyHeader = b.VerifyHeader
return m0
}
// To indicate the account for which the balance is requested, its identifier
// is used. It can be any existing account in FrostFS sidechain `Balance`
// smart contract. If omitted, client implementation MUST set it to the
// request's signer `OwnerID`.
type BalanceRequest_Body struct {
state protoimpl.MessageState `protogen:"hybrid.v1"`
// 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" json:"owner_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BalanceRequest_Body) Reset() {
*x = BalanceRequest_Body{}
mi := &file_api_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_api_accounting_grpc_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *BalanceRequest_Body) GetOwnerId() *grpc1.OwnerID {
if x != nil {
return x.OwnerId
}
return nil
}
func (x *BalanceRequest_Body) SetOwnerId(v *grpc1.OwnerID) {
x.OwnerId = v
}
func (x *BalanceRequest_Body) HasOwnerId() bool {
if x == nil {
return false
}
return x.OwnerId != nil
}
func (x *BalanceRequest_Body) ClearOwnerId() {
x.OwnerId = nil
}
type BalanceRequest_Body_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Valid user identifier in `OwnerID` format for which the balance is
// requested. Required field.
OwnerId *grpc1.OwnerID
}
func (b0 BalanceRequest_Body_builder) Build() *BalanceRequest_Body {
m0 := &BalanceRequest_Body{}
b, x := &b0, m0
_, _ = b, x
x.OwnerId = b.OwnerId
return m0
}
// 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 `protogen:"hybrid.v1"`
// Amount of funds in GAS token for the requested account.
Balance *Decimal `protobuf:"bytes,1,opt,name=balance" json:"balance,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BalanceResponse_Body) Reset() {
*x = BalanceResponse_Body{}
mi := &file_api_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_api_accounting_grpc_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *BalanceResponse_Body) GetBalance() *Decimal {
if x != nil {
return x.Balance
}
return nil
}
func (x *BalanceResponse_Body) SetBalance(v *Decimal) {
x.Balance = v
}
func (x *BalanceResponse_Body) HasBalance() bool {
if x == nil {
return false
}
return x.Balance != nil
}
func (x *BalanceResponse_Body) ClearBalance() {
x.Balance = nil
}
type BalanceResponse_Body_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Amount of funds in GAS token for the requested account.
Balance *Decimal
}
func (b0 BalanceResponse_Body_builder) Build() *BalanceResponse_Body {
m0 := &BalanceResponse_Body{}
b, x := &b0, m0
_, _ = b, x
x.Balance = b.Balance
return m0
}
var File_api_accounting_grpc_service_proto protoreflect.FileDescriptor
var file_api_accounting_grpc_service_proto_rawDesc = []byte{
0x0a, 0x21, 0x61, 0x70, 0x69, 0x2f, 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, 0x1f, 0x61, 0x70, 0x69, 0x2f, 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, 0x19, 0x61, 0x70, 0x69, 0x2f,
0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 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, 0x6e, 0x5a, 0x4b, 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, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_accounting_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_api_accounting_grpc_service_proto_goTypes = []any{
(*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_api_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_api_accounting_grpc_service_proto_init() }
func file_api_accounting_grpc_service_proto_init() {
if File_api_accounting_grpc_service_proto != nil {
return
}
file_api_accounting_grpc_types_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_accounting_grpc_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_accounting_grpc_service_proto_goTypes,
DependencyIndexes: file_api_accounting_grpc_service_proto_depIdxs,
MessageInfos: file_api_accounting_grpc_service_proto_msgTypes,
}.Build()
File_api_accounting_grpc_service_proto = out.File
file_api_accounting_grpc_service_proto_rawDesc = nil
file_api_accounting_grpc_service_proto_goTypes = nil
file_api_accounting_grpc_service_proto_depIdxs = nil
}

View file

@ -1,768 +0,0 @@
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
package accounting
import (
json "encoding/json"
fmt "fmt"
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc"
pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool"
proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto"
encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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.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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerId\":"
out.RawString(prefix)
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.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil {
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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
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.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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"balance\":"
out.RawString(prefix)
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.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil {
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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
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()
}
}

View file

@ -1,45 +0,0 @@
//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
}

View file

@ -1,31 +0,0 @@
//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)
})
}

View file

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v5.27.2
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.2
// source: api/accounting/grpc/service.proto
package accounting
@ -15,8 +15,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
AccountingService_Balance_FullMethodName = "/neo.fs.v2.accounting.AccountingService/Balance"
@ -25,6 +25,12 @@ const (
// AccountingServiceClient is the client API for AccountingService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// Accounting service provides methods for interaction with FrostFS sidechain
// via other FrostFS nodes to get information about the account balance. Deposit
// and Withdraw operations can't be implemented here, as they require Mainnet
// FrostFS smart contract invocation. Transfer operations between internal
// FrostFS accounts are possible if both use the same token type.
type AccountingServiceClient interface {
// Returns the amount of funds in GAS token for the requested FrostFS account.
//
@ -44,8 +50,9 @@ func NewAccountingServiceClient(cc grpc.ClientConnInterface) AccountingServiceCl
}
func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(BalanceResponse)
err := c.cc.Invoke(ctx, AccountingService_Balance_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, AccountingService_Balance_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -54,7 +61,13 @@ func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceReques
// AccountingServiceServer is the server API for AccountingService service.
// All implementations should embed UnimplementedAccountingServiceServer
// for forward compatibility
// for forward compatibility.
//
// Accounting service provides methods for interaction with FrostFS sidechain
// via other FrostFS nodes to get information about the account balance. Deposit
// and Withdraw operations can't be implemented here, as they require Mainnet
// FrostFS smart contract invocation. Transfer operations between internal
// FrostFS accounts are possible if both use the same token type.
type AccountingServiceServer interface {
// Returns the amount of funds in GAS token for the requested FrostFS account.
//
@ -65,13 +78,17 @@ type AccountingServiceServer interface {
Balance(context.Context, *BalanceRequest) (*BalanceResponse, error)
}
// UnimplementedAccountingServiceServer should be embedded to have forward compatible implementations.
type UnimplementedAccountingServiceServer struct {
}
// UnimplementedAccountingServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAccountingServiceServer struct{}
func (UnimplementedAccountingServiceServer) Balance(context.Context, *BalanceRequest) (*BalanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented")
}
func (UnimplementedAccountingServiceServer) testEmbeddedByValue() {}
// UnsafeAccountingServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AccountingServiceServer will
@ -81,6 +98,13 @@ type UnsafeAccountingServiceServer interface {
}
func RegisterAccountingServiceServer(s grpc.ServiceRegistrar, srv AccountingServiceServer) {
// If the following call pancis, it indicates UnimplementedAccountingServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&AccountingService_ServiceDesc, srv)
}

View file

@ -0,0 +1,544 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/accounting/grpc/service.proto
//go:build protoopaque
package accounting
import (
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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 `protogen:"opaque.v1"`
xxx_hidden_Body *BalanceRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"`
xxx_hidden_MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"`
xxx_hidden_VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BalanceRequest) Reset() {
*x = BalanceRequest{}
mi := &file_api_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_api_accounting_grpc_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *BalanceRequest) GetBody() *BalanceRequest_Body {
if x != nil {
return x.xxx_hidden_Body
}
return nil
}
func (x *BalanceRequest) GetMetaHeader() *grpc.RequestMetaHeader {
if x != nil {
return x.xxx_hidden_MetaHeader
}
return nil
}
func (x *BalanceRequest) GetVerifyHeader() *grpc.RequestVerificationHeader {
if x != nil {
return x.xxx_hidden_VerifyHeader
}
return nil
}
func (x *BalanceRequest) SetBody(v *BalanceRequest_Body) {
x.xxx_hidden_Body = v
}
func (x *BalanceRequest) SetMetaHeader(v *grpc.RequestMetaHeader) {
x.xxx_hidden_MetaHeader = v
}
func (x *BalanceRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) {
x.xxx_hidden_VerifyHeader = v
}
func (x *BalanceRequest) HasBody() bool {
if x == nil {
return false
}
return x.xxx_hidden_Body != nil
}
func (x *BalanceRequest) HasMetaHeader() bool {
if x == nil {
return false
}
return x.xxx_hidden_MetaHeader != nil
}
func (x *BalanceRequest) HasVerifyHeader() bool {
if x == nil {
return false
}
return x.xxx_hidden_VerifyHeader != nil
}
func (x *BalanceRequest) ClearBody() {
x.xxx_hidden_Body = nil
}
func (x *BalanceRequest) ClearMetaHeader() {
x.xxx_hidden_MetaHeader = nil
}
func (x *BalanceRequest) ClearVerifyHeader() {
x.xxx_hidden_VerifyHeader = nil
}
type BalanceRequest_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Body of the balance request message.
Body *BalanceRequest_Body
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
MetaHeader *grpc.RequestMetaHeader
// 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
}
func (b0 BalanceRequest_builder) Build() *BalanceRequest {
m0 := &BalanceRequest{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Body = b.Body
x.xxx_hidden_MetaHeader = b.MetaHeader
x.xxx_hidden_VerifyHeader = b.VerifyHeader
return m0
}
// BalanceResponse message
type BalanceResponse struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Body *BalanceResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"`
xxx_hidden_MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"`
xxx_hidden_VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BalanceResponse) Reset() {
*x = BalanceResponse{}
mi := &file_api_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_api_accounting_grpc_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *BalanceResponse) GetBody() *BalanceResponse_Body {
if x != nil {
return x.xxx_hidden_Body
}
return nil
}
func (x *BalanceResponse) GetMetaHeader() *grpc.ResponseMetaHeader {
if x != nil {
return x.xxx_hidden_MetaHeader
}
return nil
}
func (x *BalanceResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader {
if x != nil {
return x.xxx_hidden_VerifyHeader
}
return nil
}
func (x *BalanceResponse) SetBody(v *BalanceResponse_Body) {
x.xxx_hidden_Body = v
}
func (x *BalanceResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) {
x.xxx_hidden_MetaHeader = v
}
func (x *BalanceResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) {
x.xxx_hidden_VerifyHeader = v
}
func (x *BalanceResponse) HasBody() bool {
if x == nil {
return false
}
return x.xxx_hidden_Body != nil
}
func (x *BalanceResponse) HasMetaHeader() bool {
if x == nil {
return false
}
return x.xxx_hidden_MetaHeader != nil
}
func (x *BalanceResponse) HasVerifyHeader() bool {
if x == nil {
return false
}
return x.xxx_hidden_VerifyHeader != nil
}
func (x *BalanceResponse) ClearBody() {
x.xxx_hidden_Body = nil
}
func (x *BalanceResponse) ClearMetaHeader() {
x.xxx_hidden_MetaHeader = nil
}
func (x *BalanceResponse) ClearVerifyHeader() {
x.xxx_hidden_VerifyHeader = nil
}
type BalanceResponse_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Body of the balance response message.
Body *BalanceResponse_Body
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
MetaHeader *grpc.ResponseMetaHeader
// 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
}
func (b0 BalanceResponse_builder) Build() *BalanceResponse {
m0 := &BalanceResponse{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Body = b.Body
x.xxx_hidden_MetaHeader = b.MetaHeader
x.xxx_hidden_VerifyHeader = b.VerifyHeader
return m0
}
// To indicate the account for which the balance is requested, its identifier
// is used. It can be any existing account in FrostFS sidechain `Balance`
// smart contract. If omitted, client implementation MUST set it to the
// request's signer `OwnerID`.
type BalanceRequest_Body struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BalanceRequest_Body) Reset() {
*x = BalanceRequest_Body{}
mi := &file_api_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_api_accounting_grpc_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *BalanceRequest_Body) GetOwnerId() *grpc1.OwnerID {
if x != nil {
return x.xxx_hidden_OwnerId
}
return nil
}
func (x *BalanceRequest_Body) SetOwnerId(v *grpc1.OwnerID) {
x.xxx_hidden_OwnerId = v
}
func (x *BalanceRequest_Body) HasOwnerId() bool {
if x == nil {
return false
}
return x.xxx_hidden_OwnerId != nil
}
func (x *BalanceRequest_Body) ClearOwnerId() {
x.xxx_hidden_OwnerId = nil
}
type BalanceRequest_Body_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Valid user identifier in `OwnerID` format for which the balance is
// requested. Required field.
OwnerId *grpc1.OwnerID
}
func (b0 BalanceRequest_Body_builder) Build() *BalanceRequest_Body {
m0 := &BalanceRequest_Body{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_OwnerId = b.OwnerId
return m0
}
// 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 `protogen:"opaque.v1"`
xxx_hidden_Balance *Decimal `protobuf:"bytes,1,opt,name=balance" json:"balance,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *BalanceResponse_Body) Reset() {
*x = BalanceResponse_Body{}
mi := &file_api_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_api_accounting_grpc_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *BalanceResponse_Body) GetBalance() *Decimal {
if x != nil {
return x.xxx_hidden_Balance
}
return nil
}
func (x *BalanceResponse_Body) SetBalance(v *Decimal) {
x.xxx_hidden_Balance = v
}
func (x *BalanceResponse_Body) HasBalance() bool {
if x == nil {
return false
}
return x.xxx_hidden_Balance != nil
}
func (x *BalanceResponse_Body) ClearBalance() {
x.xxx_hidden_Balance = nil
}
type BalanceResponse_Body_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Amount of funds in GAS token for the requested account.
Balance *Decimal
}
func (b0 BalanceResponse_Body_builder) Build() *BalanceResponse_Body {
m0 := &BalanceResponse_Body{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Balance = b.Balance
return m0
}
var File_api_accounting_grpc_service_proto protoreflect.FileDescriptor
var file_api_accounting_grpc_service_proto_rawDesc = []byte{
0x0a, 0x21, 0x61, 0x70, 0x69, 0x2f, 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, 0x1f, 0x61, 0x70, 0x69, 0x2f, 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, 0x19, 0x61, 0x70, 0x69, 0x2f,
0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x61, 0x70, 0x69, 0x2f, 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, 0x6e, 0x5a, 0x4b, 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, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_accounting_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_api_accounting_grpc_service_proto_goTypes = []any{
(*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_api_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_api_accounting_grpc_service_proto_init() }
func file_api_accounting_grpc_service_proto_init() {
if File_api_accounting_grpc_service_proto != nil {
return
}
file_api_accounting_grpc_types_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_accounting_grpc_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_accounting_grpc_service_proto_goTypes,
DependencyIndexes: file_api_accounting_grpc_service_proto_depIdxs,
MessageInfos: file_api_accounting_grpc_service_proto_msgTypes,
}.Build()
File_api_accounting_grpc_service_proto = out.File
file_api_accounting_grpc_service_proto_rawDesc = nil
file_api_accounting_grpc_service_proto_goTypes = nil
file_api_accounting_grpc_service_proto_depIdxs = nil
}

186
api/accounting/grpc/types.pb.go generated Normal file
View file

@ -0,0 +1,186 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/accounting/grpc/types.proto
//go:build !protoopaque
package accounting
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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 FrostFS 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 `protogen:"hybrid.v1"`
// Number in the smallest Token fractions.
Value *int64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
// Precision value indicating how many smallest fractions can be in one
// integer.
Precision *uint32 `protobuf:"varint,2,opt,name=precision" json:"precision,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Decimal) Reset() {
*x = Decimal{}
mi := &file_api_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_api_accounting_grpc_types_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Decimal) GetValue() int64 {
if x != nil && x.Value != nil {
return *x.Value
}
return 0
}
func (x *Decimal) GetPrecision() uint32 {
if x != nil && x.Precision != nil {
return *x.Precision
}
return 0
}
func (x *Decimal) SetValue(v int64) {
x.Value = &v
}
func (x *Decimal) SetPrecision(v uint32) {
x.Precision = &v
}
func (x *Decimal) HasValue() bool {
if x == nil {
return false
}
return x.Value != nil
}
func (x *Decimal) HasPrecision() bool {
if x == nil {
return false
}
return x.Precision != nil
}
func (x *Decimal) ClearValue() {
x.Value = nil
}
func (x *Decimal) ClearPrecision() {
x.Precision = nil
}
type Decimal_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Number in the smallest Token fractions.
Value *int64
// Precision value indicating how many smallest fractions can be in one
// integer.
Precision *uint32
}
func (b0 Decimal_builder) Build() *Decimal {
m0 := &Decimal{}
b, x := &b0, m0
_, _ = b, x
x.Value = b.Value
x.Precision = b.Precision
return m0
}
var File_api_accounting_grpc_types_proto protoreflect.FileDescriptor
var file_api_accounting_grpc_types_proto_rawDesc = []byte{
0x0a, 0x1f, 0x61, 0x70, 0x69, 0x2f, 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, 0x6e, 0x5a, 0x4b, 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,
0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x70, 0xe8, 0x07,
}
var file_api_accounting_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_api_accounting_grpc_types_proto_goTypes = []any{
(*Decimal)(nil), // 0: neo.fs.v2.accounting.Decimal
}
var file_api_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_api_accounting_grpc_types_proto_init() }
func file_api_accounting_grpc_types_proto_init() {
if File_api_accounting_grpc_types_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_accounting_grpc_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_api_accounting_grpc_types_proto_goTypes,
DependencyIndexes: file_api_accounting_grpc_types_proto_depIdxs,
MessageInfos: file_api_accounting_grpc_types_proto_msgTypes,
}.Build()
File_api_accounting_grpc_types_proto = out.File
file_api_accounting_grpc_types_proto_rawDesc = nil
file_api_accounting_grpc_types_proto_goTypes = nil
file_api_accounting_grpc_types_proto_depIdxs = nil
}

View file

@ -1,204 +0,0 @@
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
package accounting
import (
json "encoding/json"
fmt "fmt"
pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool"
proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto"
encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding"
easyproto "github.com/VictoriaMetrics/easyproto"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
strconv "strconv"
)
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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.Value, 10)
out.RawByte('"')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
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
r := in.JsonNumber()
n := r.String()
v, err := strconv.ParseInt(n, 10, 64)
if err != nil {
in.AddError(err)
return
}
pv := int64(v)
f = pv
x.Value = f
}
case "precision":
{
var f uint32
r := in.JsonNumber()
n := r.String()
v, err := strconv.ParseUint(n, 10, 32)
if err != nil {
in.AddError(err)
return
}
pv := uint32(v)
f = pv
x.Precision = f
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}

View file

@ -1,26 +0,0 @@
//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
}

View file

@ -1,21 +0,0 @@
//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)
})
}

View file

@ -0,0 +1,195 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/accounting/grpc/types.proto
//go:build protoopaque
package accounting
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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 FrostFS 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 `protogen:"opaque.v1"`
xxx_hidden_Value int64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
xxx_hidden_Precision uint32 `protobuf:"varint,2,opt,name=precision" json:"precision,omitempty"`
XXX_raceDetectHookData protoimpl.RaceDetectHookData
XXX_presence [1]uint32
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Decimal) Reset() {
*x = Decimal{}
mi := &file_api_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_api_accounting_grpc_types_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Decimal) GetValue() int64 {
if x != nil {
return x.xxx_hidden_Value
}
return 0
}
func (x *Decimal) GetPrecision() uint32 {
if x != nil {
return x.xxx_hidden_Precision
}
return 0
}
func (x *Decimal) SetValue(v int64) {
x.xxx_hidden_Value = v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2)
}
func (x *Decimal) SetPrecision(v uint32) {
x.xxx_hidden_Precision = v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2)
}
func (x *Decimal) HasValue() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 0)
}
func (x *Decimal) HasPrecision() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 1)
}
func (x *Decimal) ClearValue() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)
x.xxx_hidden_Value = 0
}
func (x *Decimal) ClearPrecision() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)
x.xxx_hidden_Precision = 0
}
type Decimal_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Number in the smallest Token fractions.
Value *int64
// Precision value indicating how many smallest fractions can be in one
// integer.
Precision *uint32
}
func (b0 Decimal_builder) Build() *Decimal {
m0 := &Decimal{}
b, x := &b0, m0
_, _ = b, x
if b.Value != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2)
x.xxx_hidden_Value = *b.Value
}
if b.Precision != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2)
x.xxx_hidden_Precision = *b.Precision
}
return m0
}
var File_api_accounting_grpc_types_proto protoreflect.FileDescriptor
var file_api_accounting_grpc_types_proto_rawDesc = []byte{
0x0a, 0x1f, 0x61, 0x70, 0x69, 0x2f, 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, 0x6e, 0x5a, 0x4b, 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,
0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x70, 0xe8, 0x07,
}
var file_api_accounting_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_api_accounting_grpc_types_proto_goTypes = []any{
(*Decimal)(nil), // 0: neo.fs.v2.accounting.Decimal
}
var file_api_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_api_accounting_grpc_types_proto_init() }
func file_api_accounting_grpc_types_proto_init() {
if File_api_accounting_grpc_types_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_accounting_grpc_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_api_accounting_grpc_types_proto_goTypes,
DependencyIndexes: file_api_accounting_grpc_types_proto_depIdxs,
MessageInfos: file_api_accounting_grpc_types_proto_msgTypes,
}.Build()
File_api_accounting_grpc_types_proto = out.File
file_api_accounting_grpc_types_proto_rawDesc = nil
file_api_accounting_grpc_types_proto_goTypes = nil
file_api_accounting_grpc_types_proto_depIdxs = nil
}

View file

@ -187,24 +187,24 @@ func (f *HeaderFilter) FromGRPCMessage(m grpc.Message) error {
return nil
}
func HeaderFiltersToGRPC(fs []HeaderFilter) (res []acl.EACLRecord_Filter) {
func HeaderFiltersToGRPC(fs []HeaderFilter) (res []*acl.EACLRecord_Filter) {
if fs != nil {
res = make([]acl.EACLRecord_Filter, 0, len(fs))
res = make([]*acl.EACLRecord_Filter, 0, len(fs))
for i := range fs {
res = append(res, *fs[i].ToGRPCMessage().(*acl.EACLRecord_Filter))
res = append(res, fs[i].ToGRPCMessage().(*acl.EACLRecord_Filter))
}
}
return
}
func HeaderFiltersFromGRPC(fs []acl.EACLRecord_Filter) (res []HeaderFilter, err error) {
func HeaderFiltersFromGRPC(fs []*acl.EACLRecord_Filter) (res []HeaderFilter, err error) {
if fs != nil {
res = make([]HeaderFilter, len(fs))
for i := range fs {
err = res[i].FromGRPCMessage(&fs[i])
err = res[i].FromGRPCMessage(fs[i])
if err != nil {
return
}
@ -239,24 +239,24 @@ func (t *Target) FromGRPCMessage(m grpc.Message) error {
return nil
}
func TargetsToGRPC(ts []Target) (res []acl.EACLRecord_Target) {
func TargetsToGRPC(ts []Target) (res []*acl.EACLRecord_Target) {
if ts != nil {
res = make([]acl.EACLRecord_Target, 0, len(ts))
res = make([]*acl.EACLRecord_Target, 0, len(ts))
for i := range ts {
res = append(res, *ts[i].ToGRPCMessage().(*acl.EACLRecord_Target))
res = append(res, ts[i].ToGRPCMessage().(*acl.EACLRecord_Target))
}
}
return
}
func TargetsFromGRPC(fs []acl.EACLRecord_Target) (res []Target, err error) {
func TargetsFromGRPC(fs []*acl.EACLRecord_Target) (res []Target, err error) {
if fs != nil {
res = make([]Target, len(fs))
for i := range fs {
err = res[i].FromGRPCMessage(&fs[i])
err = res[i].FromGRPCMessage(fs[i])
if err != nil {
return
}
@ -305,24 +305,24 @@ func (r *Record) FromGRPCMessage(m grpc.Message) error {
return nil
}
func RecordsToGRPC(ts []Record) (res []acl.EACLRecord) {
func RecordsToGRPC(ts []Record) (res []*acl.EACLRecord) {
if ts != nil {
res = make([]acl.EACLRecord, 0, len(ts))
res = make([]*acl.EACLRecord, 0, len(ts))
for i := range ts {
res = append(res, *ts[i].ToGRPCMessage().(*acl.EACLRecord))
res = append(res, ts[i].ToGRPCMessage().(*acl.EACLRecord))
}
}
return
}
func RecordsFromGRPC(fs []acl.EACLRecord) (res []Record, err error) {
func RecordsFromGRPC(fs []*acl.EACLRecord) (res []Record, err error) {
if fs != nil {
res = make([]Record, len(fs))
for i := range fs {
err = res[i].FromGRPCMessage(&fs[i])
err = res[i].FromGRPCMessage(fs[i])
if err != nil {
return
}
@ -423,9 +423,9 @@ func (c *APEOverride) ToGRPCMessage() grpc.Message {
m.SetTarget(c.target.ToGRPCMessage().(*apeGRPC.ChainTarget))
if len(c.chains) > 0 {
apeChains := make([]apeGRPC.Chain, len(c.chains))
apeChains := make([]*apeGRPC.Chain, len(c.chains))
for i := range c.chains {
apeChains[i] = *c.chains[i].ToGRPCMessage().(*apeGRPC.Chain)
apeChains[i] = c.chains[i].ToGRPCMessage().(*apeGRPC.Chain)
}
m.SetChains(apeChains)
}
@ -453,7 +453,7 @@ func (c *APEOverride) FromGRPCMessage(m grpc.Message) error {
c.chains = make([]*ape.Chain, len(apeChains))
for i := range apeChains {
c.chains[i] = new(ape.Chain)
if err := c.chains[i].FromGRPCMessage(&apeChains[i]); err != nil {
if err := c.chains[i].FromGRPCMessage(apeChains[i]); err != nil {
return err
}
}

1534
api/acl/grpc/types.pb.go generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,64 +0,0 @@
//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
}

View file

@ -1,41 +0,0 @@
//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)
})
}

1589
api/acl/grpc/types_protoopaque.pb.go generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -14,12 +14,9 @@ func (x Action) String() string {
//
// Returns true if s was parsed successfully.
func (x *Action) FromString(s string) bool {
var g acl.Action
ok := g.FromString(s)
g, ok := acl.Action_value[s]
if ok {
*x = ActionFromGRPCField(g)
*x = ActionFromGRPCField(acl.Action(g))
}
return ok
@ -35,12 +32,10 @@ func (x Role) String() string {
//
// Returns true if s was parsed successfully.
func (x *Role) FromString(s string) bool {
var g acl.Role
ok := g.FromString(s)
g, ok := acl.Role_value[s]
if ok {
*x = RoleFromGRPCField(g)
*x = RoleFromGRPCField(acl.Role(g))
}
return ok
@ -56,12 +51,9 @@ func (x Operation) String() string {
//
// Returns true if s was parsed successfully.
func (x *Operation) FromString(s string) bool {
var g acl.Operation
ok := g.FromString(s)
g, ok := acl.Operation_value[s]
if ok {
*x = OperationFromGRPCField(g)
*x = OperationFromGRPCField(acl.Operation(g))
}
return ok
@ -77,12 +69,10 @@ func (x MatchType) String() string {
//
// Returns true if s was parsed successfully.
func (x *MatchType) FromString(s string) bool {
var g acl.MatchType
ok := g.FromString(s)
g, ok := acl.MatchType_value[s]
if ok {
*x = MatchTypeFromGRPCField(g)
*x = MatchTypeFromGRPCField(acl.MatchType(g))
}
return ok
@ -98,12 +88,10 @@ func (x HeaderType) String() string {
//
// Returns true if s was parsed successfully.
func (x *HeaderType) FromString(s string) bool {
var g acl.HeaderType
ok := g.FromString(s)
g, ok := acl.HeaderType_value[s]
if ok {
*x = HeaderTypeFromGRPCField(g)
*x = HeaderTypeFromGRPCField(acl.HeaderType(g))
}
return ok

View file

@ -76,8 +76,7 @@ func (v2 *ChainRaw) ToGRPCMessage() grpc.Message {
if v2 != nil {
mgrpc = new(ape.Chain_Raw)
mgrpc.SetRaw(v2.GetRaw())
mgrpc.Raw = v2.GetRaw()
}
return mgrpc
@ -89,7 +88,7 @@ func (v2 *ChainRaw) FromGRPCMessage(m grpc.Message) error {
return message.NewUnexpectedMessageType(m, mgrpc)
}
v2.SetRaw(mgrpc.GetRaw())
v2.SetRaw(mgrpc.Raw)
return nil
}
@ -104,7 +103,7 @@ func (v2 *Chain) ToGRPCMessage() grpc.Message {
default:
panic(fmt.Sprintf("unsupported chain kind: %T", chainKind))
case *ChainRaw:
mgrpc.SetKind(chainKind.ToGRPCMessage().(*ape.Chain_Raw))
mgrpc.SetRaw(chainKind.GetRaw())
}
}

376
api/ape/grpc/types.pb.go generated Normal file
View file

@ -0,0 +1,376 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/ape/grpc/types.proto
//go:build !protoopaque
package ape
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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_api_ape_grpc_types_proto_enumTypes[0].Descriptor()
}
func (TargetType) Type() protoreflect.EnumType {
return &file_api_ape_grpc_types_proto_enumTypes[0]
}
func (x TargetType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// ChainTarget is an object to which a rule chain is defined.
type ChainTarget struct {
state protoimpl.MessageState `protogen:"hybrid.v1"`
Type *TargetType `protobuf:"varint,1,opt,name=type,enum=frostfs.v2.ape.TargetType" json:"type,omitempty"`
Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ChainTarget) Reset() {
*x = ChainTarget{}
mi := &file_api_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_api_ape_grpc_types_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *ChainTarget) GetType() TargetType {
if x != nil && x.Type != nil {
return *x.Type
}
return TargetType_UNDEFINED
}
func (x *ChainTarget) GetName() string {
if x != nil && x.Name != nil {
return *x.Name
}
return ""
}
func (x *ChainTarget) SetType(v TargetType) {
x.Type = &v
}
func (x *ChainTarget) SetName(v string) {
x.Name = &v
}
func (x *ChainTarget) HasType() bool {
if x == nil {
return false
}
return x.Type != nil
}
func (x *ChainTarget) HasName() bool {
if x == nil {
return false
}
return x.Name != nil
}
func (x *ChainTarget) ClearType() {
x.Type = nil
}
func (x *ChainTarget) ClearName() {
x.Name = nil
}
type ChainTarget_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
Type *TargetType
Name *string
}
func (b0 ChainTarget_builder) Build() *ChainTarget {
m0 := &ChainTarget{}
b, x := &b0, m0
_, _ = b, x
x.Type = b.Type
x.Name = b.Name
return m0
}
// Chain is a chain of rules defined for a specific target.
type Chain struct {
state protoimpl.MessageState `protogen:"hybrid.v1"`
// Types that are valid to be assigned to Kind:
//
// *Chain_Raw
Kind isChain_Kind `protobuf_oneof:"kind"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Chain) Reset() {
*x = Chain{}
mi := &file_api_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_api_ape_grpc_types_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Chain) GetKind() isChain_Kind {
if x != nil {
return x.Kind
}
return nil
}
func (x *Chain) GetRaw() []byte {
if x != nil {
if x, ok := x.Kind.(*Chain_Raw); ok {
return x.Raw
}
}
return nil
}
func (x *Chain) SetRaw(v []byte) {
if v == nil {
v = []byte{}
}
x.Kind = &Chain_Raw{v}
}
func (x *Chain) HasKind() bool {
if x == nil {
return false
}
return x.Kind != nil
}
func (x *Chain) HasRaw() bool {
if x == nil {
return false
}
_, ok := x.Kind.(*Chain_Raw)
return ok
}
func (x *Chain) ClearKind() {
x.Kind = nil
}
func (x *Chain) ClearRaw() {
if _, ok := x.Kind.(*Chain_Raw); ok {
x.Kind = nil
}
}
const Chain_Kind_not_set_case case_Chain_Kind = 0
const Chain_Raw_case case_Chain_Kind = 1
func (x *Chain) WhichKind() case_Chain_Kind {
if x == nil {
return Chain_Kind_not_set_case
}
switch x.Kind.(type) {
case *Chain_Raw:
return Chain_Raw_case
default:
return Chain_Kind_not_set_case
}
}
type Chain_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Fields of oneof Kind:
// Raw representation of a serizalized rule chain.
Raw []byte
// -- end of Kind
}
func (b0 Chain_builder) Build() *Chain {
m0 := &Chain{}
b, x := &b0, m0
_, _ = b, x
if b.Raw != nil {
x.Kind = &Chain_Raw{b.Raw}
}
return m0
}
type case_Chain_Kind protoreflect.FieldNumber
func (x case_Chain_Kind) String() string {
md := file_api_ape_grpc_types_proto_msgTypes[1].Descriptor()
if x == 0 {
return "not set"
}
return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))
}
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,oneof"`
}
func (*Chain_Raw) isChain_Kind() {}
var File_api_ape_grpc_types_proto protoreflect.FileDescriptor
var file_api_ape_grpc_types_proto_rawDesc = []byte{
0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 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, 0x3f, 0x5a, 0x3d, 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, 0x73, 0x64, 0x6b, 0x2d,
0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b,
0x61, 0x70, 0x65, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_ape_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_ape_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_api_ape_grpc_types_proto_goTypes = []any{
(TargetType)(0), // 0: frostfs.v2.ape.TargetType
(*ChainTarget)(nil), // 1: frostfs.v2.ape.ChainTarget
(*Chain)(nil), // 2: frostfs.v2.ape.Chain
}
var file_api_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_api_ape_grpc_types_proto_init() }
func file_api_ape_grpc_types_proto_init() {
if File_api_ape_grpc_types_proto != nil {
return
}
file_api_ape_grpc_types_proto_msgTypes[1].OneofWrappers = []any{
(*Chain_Raw)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_ape_grpc_types_proto_rawDesc,
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_api_ape_grpc_types_proto_goTypes,
DependencyIndexes: file_api_ape_grpc_types_proto_depIdxs,
EnumInfos: file_api_ape_grpc_types_proto_enumTypes,
MessageInfos: file_api_ape_grpc_types_proto_msgTypes,
}.Build()
File_api_ape_grpc_types_proto = out.File
file_api_ape_grpc_types_proto_rawDesc = nil
file_api_ape_grpc_types_proto_goTypes = nil
file_api_ape_grpc_types_proto_depIdxs = nil
}

View file

@ -1,430 +0,0 @@
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
package ape
import (
json "encoding/json"
fmt "fmt"
pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool"
proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto"
encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"type\":"
out.RawString(prefix)
v := int32(x.Type)
if vv, ok := TargetType_name[v]; ok {
out.String(vv)
} else {
out.Int32(v)
}
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
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() []byte {
if xx, ok := x.GetKind().(*Chain_Raw); ok {
return xx.Raw
}
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
}
first := true
out.RawByte('{')
switch xx := x.Kind.(type) {
case *Chain_Raw:
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"raw\":"
out.RawString(prefix)
if xx.Raw != nil {
out.Base64Bytes(xx.Raw)
} else {
out.String("")
}
}
}
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
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
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() {}

View file

@ -1,45 +0,0 @@
//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
}

View file

@ -1,31 +0,0 @@
//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)
})
}

383
api/ape/grpc/types_protoopaque.pb.go generated Normal file
View file

@ -0,0 +1,383 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/ape/grpc/types.proto
//go:build protoopaque
package ape
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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_api_ape_grpc_types_proto_enumTypes[0].Descriptor()
}
func (TargetType) Type() protoreflect.EnumType {
return &file_api_ape_grpc_types_proto_enumTypes[0]
}
func (x TargetType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// ChainTarget is an object to which a rule chain is defined.
type ChainTarget struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Type TargetType `protobuf:"varint,1,opt,name=type,enum=frostfs.v2.ape.TargetType" json:"type,omitempty"`
xxx_hidden_Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
XXX_raceDetectHookData protoimpl.RaceDetectHookData
XXX_presence [1]uint32
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ChainTarget) Reset() {
*x = ChainTarget{}
mi := &file_api_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_api_ape_grpc_types_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *ChainTarget) GetType() TargetType {
if x != nil {
if protoimpl.X.Present(&(x.XXX_presence[0]), 0) {
return x.xxx_hidden_Type
}
}
return TargetType_UNDEFINED
}
func (x *ChainTarget) GetName() string {
if x != nil {
if x.xxx_hidden_Name != nil {
return *x.xxx_hidden_Name
}
return ""
}
return ""
}
func (x *ChainTarget) SetType(v TargetType) {
x.xxx_hidden_Type = v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2)
}
func (x *ChainTarget) SetName(v string) {
x.xxx_hidden_Name = &v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2)
}
func (x *ChainTarget) HasType() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 0)
}
func (x *ChainTarget) HasName() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 1)
}
func (x *ChainTarget) ClearType() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)
x.xxx_hidden_Type = TargetType_UNDEFINED
}
func (x *ChainTarget) ClearName() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)
x.xxx_hidden_Name = nil
}
type ChainTarget_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
Type *TargetType
Name *string
}
func (b0 ChainTarget_builder) Build() *ChainTarget {
m0 := &ChainTarget{}
b, x := &b0, m0
_, _ = b, x
if b.Type != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2)
x.xxx_hidden_Type = *b.Type
}
if b.Name != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2)
x.xxx_hidden_Name = b.Name
}
return m0
}
// Chain is a chain of rules defined for a specific target.
type Chain struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Kind isChain_Kind `protobuf_oneof:"kind"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Chain) Reset() {
*x = Chain{}
mi := &file_api_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_api_ape_grpc_types_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Chain) GetRaw() []byte {
if x != nil {
if x, ok := x.xxx_hidden_Kind.(*chain_Raw); ok {
return x.Raw
}
}
return nil
}
func (x *Chain) SetRaw(v []byte) {
if v == nil {
v = []byte{}
}
x.xxx_hidden_Kind = &chain_Raw{v}
}
func (x *Chain) HasKind() bool {
if x == nil {
return false
}
return x.xxx_hidden_Kind != nil
}
func (x *Chain) HasRaw() bool {
if x == nil {
return false
}
_, ok := x.xxx_hidden_Kind.(*chain_Raw)
return ok
}
func (x *Chain) ClearKind() {
x.xxx_hidden_Kind = nil
}
func (x *Chain) ClearRaw() {
if _, ok := x.xxx_hidden_Kind.(*chain_Raw); ok {
x.xxx_hidden_Kind = nil
}
}
const Chain_Kind_not_set_case case_Chain_Kind = 0
const Chain_Raw_case case_Chain_Kind = 1
func (x *Chain) WhichKind() case_Chain_Kind {
if x == nil {
return Chain_Kind_not_set_case
}
switch x.xxx_hidden_Kind.(type) {
case *chain_Raw:
return Chain_Raw_case
default:
return Chain_Kind_not_set_case
}
}
type Chain_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Fields of oneof xxx_hidden_Kind:
// Raw representation of a serizalized rule chain.
Raw []byte
// -- end of xxx_hidden_Kind
}
func (b0 Chain_builder) Build() *Chain {
m0 := &Chain{}
b, x := &b0, m0
_, _ = b, x
if b.Raw != nil {
x.xxx_hidden_Kind = &chain_Raw{b.Raw}
}
return m0
}
type case_Chain_Kind protoreflect.FieldNumber
func (x case_Chain_Kind) String() string {
md := file_api_ape_grpc_types_proto_msgTypes[1].Descriptor()
if x == 0 {
return "not set"
}
return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))
}
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,oneof"`
}
func (*chain_Raw) isChain_Kind() {}
var File_api_ape_grpc_types_proto protoreflect.FileDescriptor
var file_api_ape_grpc_types_proto_rawDesc = []byte{
0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 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, 0x3f, 0x5a, 0x3d, 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, 0x73, 0x64, 0x6b, 0x2d,
0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b,
0x61, 0x70, 0x65, 0x62, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_ape_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_ape_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_api_ape_grpc_types_proto_goTypes = []any{
(TargetType)(0), // 0: frostfs.v2.ape.TargetType
(*ChainTarget)(nil), // 1: frostfs.v2.ape.ChainTarget
(*Chain)(nil), // 2: frostfs.v2.ape.Chain
}
var file_api_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_api_ape_grpc_types_proto_init() }
func file_api_ape_grpc_types_proto_init() {
if File_api_ape_grpc_types_proto != nil {
return
}
file_api_ape_grpc_types_proto_msgTypes[1].OneofWrappers = []any{
(*chain_Raw)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_ape_grpc_types_proto_rawDesc,
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_api_ape_grpc_types_proto_goTypes,
DependencyIndexes: file_api_ape_grpc_types_proto_depIdxs,
EnumInfos: file_api_ape_grpc_types_proto_enumTypes,
MessageInfos: file_api_ape_grpc_types_proto_msgTypes,
}.Build()
File_api_ape_grpc_types_proto = out.File
file_api_ape_grpc_types_proto_rawDesc = nil
file_api_ape_grpc_types_proto_goTypes = nil
file_api_ape_grpc_types_proto_depIdxs = nil
}

View file

@ -296,9 +296,9 @@ func (respBody *ListChainsResponseBody) ToGRPCMessage() grpc.Message {
if respBody != nil {
respBodygrpc = new(apemanager.ListChainsResponse_Body)
chainsgrpc := make([]apeGRPC.Chain, 0, len(respBody.GetChains()))
chainsgrpc := make([]*apeGRPC.Chain, 0, len(respBody.GetChains()))
for _, chain := range respBody.GetChains() {
chainsgrpc = append(chainsgrpc, *chain.ToGRPCMessage().(*apeGRPC.Chain))
chainsgrpc = append(chainsgrpc, chain.ToGRPCMessage().(*apeGRPC.Chain))
}
respBodygrpc.SetChains(chainsgrpc)
@ -317,7 +317,7 @@ func (respBody *ListChainsResponseBody) FromGRPCMessage(m grpc.Message) error {
for _, chaingrpc := range respBodygrpc.GetChains() {
chain := new(ape.Chain)
if err := chain.FromGRPCMessage(&chaingrpc); err != nil {
if err := chain.FromGRPCMessage(chaingrpc); err != nil {
return err
}
chains = append(chains, chain)

1487
api/apemanager/grpc/service.pb.go generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,121 +0,0 @@
//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
}

View file

@ -1,71 +0,0 @@
//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)
})
}

View file

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v5.27.2
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.2
// source: api/apemanager/grpc/service.proto
package apemanager
@ -15,8 +15,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
APEManagerService_AddChain_FullMethodName = "/frostfs.v2.apemanager.APEManagerService/AddChain"
@ -27,6 +27,9 @@ const (
// APEManagerServiceClient is the client API for APEManagerService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// `APEManagerService` provides API to manage rule chains within sidechain's
// `Policy` smart contract.
type APEManagerServiceClient interface {
// Add a rule chain for a specific target to `Policy` smart contract.
//
@ -74,8 +77,9 @@ func NewAPEManagerServiceClient(cc grpc.ClientConnInterface) APEManagerServiceCl
}
func (c *aPEManagerServiceClient) AddChain(ctx context.Context, in *AddChainRequest, opts ...grpc.CallOption) (*AddChainResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AddChainResponse)
err := c.cc.Invoke(ctx, APEManagerService_AddChain_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, APEManagerService_AddChain_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -83,8 +87,9 @@ func (c *aPEManagerServiceClient) AddChain(ctx context.Context, in *AddChainRequ
}
func (c *aPEManagerServiceClient) RemoveChain(ctx context.Context, in *RemoveChainRequest, opts ...grpc.CallOption) (*RemoveChainResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RemoveChainResponse)
err := c.cc.Invoke(ctx, APEManagerService_RemoveChain_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, APEManagerService_RemoveChain_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -92,8 +97,9 @@ func (c *aPEManagerServiceClient) RemoveChain(ctx context.Context, in *RemoveCha
}
func (c *aPEManagerServiceClient) ListChains(ctx context.Context, in *ListChainsRequest, opts ...grpc.CallOption) (*ListChainsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListChainsResponse)
err := c.cc.Invoke(ctx, APEManagerService_ListChains_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, APEManagerService_ListChains_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -102,7 +108,10 @@ func (c *aPEManagerServiceClient) ListChains(ctx context.Context, in *ListChains
// APEManagerServiceServer is the server API for APEManagerService service.
// All implementations should embed UnimplementedAPEManagerServiceServer
// for forward compatibility
// for forward compatibility.
//
// `APEManagerService` provides API to manage rule chains within sidechain's
// `Policy` smart contract.
type APEManagerServiceServer interface {
// Add a rule chain for a specific target to `Policy` smart contract.
//
@ -141,9 +150,12 @@ type APEManagerServiceServer interface {
ListChains(context.Context, *ListChainsRequest) (*ListChainsResponse, error)
}
// UnimplementedAPEManagerServiceServer should be embedded to have forward compatible implementations.
type UnimplementedAPEManagerServiceServer struct {
}
// UnimplementedAPEManagerServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAPEManagerServiceServer struct{}
func (UnimplementedAPEManagerServiceServer) AddChain(context.Context, *AddChainRequest) (*AddChainResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddChain not implemented")
@ -154,6 +166,7 @@ func (UnimplementedAPEManagerServiceServer) RemoveChain(context.Context, *Remove
func (UnimplementedAPEManagerServiceServer) ListChains(context.Context, *ListChainsRequest) (*ListChainsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListChains not implemented")
}
func (UnimplementedAPEManagerServiceServer) testEmbeddedByValue() {}
// UnsafeAPEManagerServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to APEManagerServiceServer will
@ -163,6 +176,13 @@ type UnsafeAPEManagerServiceServer interface {
}
func RegisterAPEManagerServiceServer(s grpc.ServiceRegistrar, srv APEManagerServiceServer) {
// If the following call pancis, it indicates UnimplementedAPEManagerServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&APEManagerService_ServiceDesc, srv)
}

File diff suppressed because it is too large Load diff

View file

@ -37,24 +37,24 @@ func (a *Attribute) FromGRPCMessage(m grpc.Message) error {
return nil
}
func AttributesToGRPC(xs []Attribute) (res []container.Container_Attribute) {
func AttributesToGRPC(xs []Attribute) (res []*container.Container_Attribute) {
if xs != nil {
res = make([]container.Container_Attribute, 0, len(xs))
res = make([]*container.Container_Attribute, 0, len(xs))
for i := range xs {
res = append(res, *xs[i].ToGRPCMessage().(*container.Container_Attribute))
res = append(res, xs[i].ToGRPCMessage().(*container.Container_Attribute))
}
}
return
}
func AttributesFromGRPC(xs []container.Container_Attribute) (res []Attribute, err error) {
func AttributesFromGRPC(xs []*container.Container_Attribute) (res []Attribute, err error) {
if xs != nil {
res = make([]Attribute, len(xs))
for i := range xs {
err = res[i].FromGRPCMessage(&xs[i])
err = res[i].FromGRPCMessage(xs[i])
if err != nil {
return
}

2487
api/container/grpc/service.pb.go generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,197 +0,0 @@
//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 DoFuzzProtoListStreamRequest(data []byte) int {
msg := new(ListStreamRequest)
if err := msg.UnmarshalProtobuf(data); err != nil {
return 0
}
_ = msg.MarshalProtobuf(nil)
return 1
}
func DoFuzzJSONListStreamRequest(data []byte) int {
msg := new(ListStreamRequest)
if err := msg.UnmarshalJSON(data); err != nil {
return 0
}
_, err := msg.MarshalJSON()
if err != nil {
panic(err)
}
return 1
}
func DoFuzzProtoListStreamResponse(data []byte) int {
msg := new(ListStreamResponse)
if err := msg.UnmarshalProtobuf(data); err != nil {
return 0
}
_ = msg.MarshalProtobuf(nil)
return 1
}
func DoFuzzJSONListStreamResponse(data []byte) int {
msg := new(ListStreamResponse)
if err := msg.UnmarshalJSON(data); err != nil {
return 0
}
_, err := msg.MarshalJSON()
if err != nil {
panic(err)
}
return 1
}

View file

@ -1,111 +0,0 @@
//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 FuzzProtoListStreamRequest(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
DoFuzzProtoListStreamRequest(data)
})
}
func FuzzJSONListStreamRequest(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
DoFuzzJSONListStreamRequest(data)
})
}
func FuzzProtoListStreamResponse(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
DoFuzzProtoListStreamResponse(data)
})
}
func FuzzJSONListStreamResponse(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
DoFuzzJSONListStreamResponse(data)
})
}

View file

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v5.27.2
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.2
// source: api/container/grpc/service.proto
package container
@ -15,8 +15,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ContainerService_Put_FullMethodName = "/neo.fs.v2.container.ContainerService/Put"
@ -29,6 +29,11 @@ const (
// ContainerServiceClient is the client API for ContainerService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// `ContainerService` provides API to interact with `Container` smart contract
// in FrostFS sidechain via other FrostFS nodes. All of those actions can be
// done equivalently by directly issuing transactions and RPC calls to sidechain
// nodes.
type ContainerServiceClient interface {
// `Put` invokes `Container` smart contract's `Put` method and returns
// response immediately. After a new block is issued in sidechain, request is
@ -83,7 +88,7 @@ type ContainerServiceClient interface {
// - Common failures (SECTION_FAILURE_COMMON);
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
// container list access denied.
ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (ContainerService_ListStreamClient, error)
ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListStreamResponse], error)
}
type containerServiceClient struct {
@ -95,8 +100,9 @@ func NewContainerServiceClient(cc grpc.ClientConnInterface) ContainerServiceClie
}
func (c *containerServiceClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PutResponse)
err := c.cc.Invoke(ctx, ContainerService_Put_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, ContainerService_Put_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -104,8 +110,9 @@ func (c *containerServiceClient) Put(ctx context.Context, in *PutRequest, opts .
}
func (c *containerServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeleteResponse)
err := c.cc.Invoke(ctx, ContainerService_Delete_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, ContainerService_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -113,8 +120,9 @@ func (c *containerServiceClient) Delete(ctx context.Context, in *DeleteRequest,
}
func (c *containerServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetResponse)
err := c.cc.Invoke(ctx, ContainerService_Get_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, ContainerService_Get_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -122,20 +130,22 @@ func (c *containerServiceClient) Get(ctx context.Context, in *GetRequest, opts .
}
func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListResponse)
err := c.cc.Invoke(ctx, ContainerService_List_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, ContainerService_List_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *containerServiceClient) ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (ContainerService_ListStreamClient, error) {
stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[0], ContainerService_ListStream_FullMethodName, opts...)
func (c *containerServiceClient) ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListStreamResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[0], ContainerService_ListStream_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &containerServiceListStreamClient{stream}
x := &grpc.GenericClientStream[ListStreamRequest, ListStreamResponse]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
@ -145,26 +155,17 @@ func (c *containerServiceClient) ListStream(ctx context.Context, in *ListStreamR
return x, nil
}
type ContainerService_ListStreamClient interface {
Recv() (*ListStreamResponse, error)
grpc.ClientStream
}
type containerServiceListStreamClient struct {
grpc.ClientStream
}
func (x *containerServiceListStreamClient) Recv() (*ListStreamResponse, error) {
m := new(ListStreamResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ContainerService_ListStreamClient = grpc.ServerStreamingClient[ListStreamResponse]
// ContainerServiceServer is the server API for ContainerService service.
// All implementations should embed UnimplementedContainerServiceServer
// for forward compatibility
// for forward compatibility.
//
// `ContainerService` provides API to interact with `Container` smart contract
// in FrostFS sidechain via other FrostFS nodes. All of those actions can be
// done equivalently by directly issuing transactions and RPC calls to sidechain
// nodes.
type ContainerServiceServer interface {
// `Put` invokes `Container` smart contract's `Put` method and returns
// response immediately. After a new block is issued in sidechain, request is
@ -219,12 +220,15 @@ type ContainerServiceServer interface {
// - Common failures (SECTION_FAILURE_COMMON);
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
// container list access denied.
ListStream(*ListStreamRequest, ContainerService_ListStreamServer) error
ListStream(*ListStreamRequest, grpc.ServerStreamingServer[ListStreamResponse]) error
}
// UnimplementedContainerServiceServer should be embedded to have forward compatible implementations.
type UnimplementedContainerServiceServer struct {
}
// UnimplementedContainerServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedContainerServiceServer struct{}
func (UnimplementedContainerServiceServer) Put(context.Context, *PutRequest) (*PutResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Put not implemented")
@ -238,9 +242,10 @@ func (UnimplementedContainerServiceServer) Get(context.Context, *GetRequest) (*G
func (UnimplementedContainerServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedContainerServiceServer) ListStream(*ListStreamRequest, ContainerService_ListStreamServer) error {
func (UnimplementedContainerServiceServer) ListStream(*ListStreamRequest, grpc.ServerStreamingServer[ListStreamResponse]) error {
return status.Errorf(codes.Unimplemented, "method ListStream not implemented")
}
func (UnimplementedContainerServiceServer) testEmbeddedByValue() {}
// UnsafeContainerServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ContainerServiceServer will
@ -250,6 +255,13 @@ type UnsafeContainerServiceServer interface {
}
func RegisterContainerServiceServer(s grpc.ServiceRegistrar, srv ContainerServiceServer) {
// If the following call pancis, it indicates UnimplementedContainerServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ContainerService_ServiceDesc, srv)
}
@ -330,21 +342,11 @@ func _ContainerService_ListStream_Handler(srv interface{}, stream grpc.ServerStr
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ContainerServiceServer).ListStream(m, &containerServiceListStreamServer{stream})
return srv.(ContainerServiceServer).ListStream(m, &grpc.GenericServerStream[ListStreamRequest, ListStreamResponse]{ServerStream: stream})
}
type ContainerService_ListStreamServer interface {
Send(*ListStreamResponse) error
grpc.ServerStream
}
type containerServiceListStreamServer struct {
grpc.ServerStream
}
func (x *containerServiceListStreamServer) Send(m *ListStreamResponse) error {
return x.ServerStream.SendMsg(m)
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ContainerService_ListStreamServer = grpc.ServerStreamingServer[ListStreamResponse]
// ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service.
// It's only intended for direct use with grpc.RegisterService,

File diff suppressed because it is too large Load diff

447
api/container/grpc/types.pb.go generated Normal file
View file

@ -0,0 +1,447 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/container/grpc/types.proto
//go:build !protoopaque
package container
import (
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc"
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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 `protogen:"hybrid.v1"`
// Container format version. Effectively, the version of API library used to
// create the container.
Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"`
// Identifier of the container owner
OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID" 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" 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" json:"basic_acl,omitempty"`
// Attributes represent immutable container's meta data
Attributes []*Container_Attribute `protobuf:"bytes,5,rep,name=attributes" json:"attributes,omitempty"`
// Placement policy for the object inside the container
PlacementPolicy *grpc1.PlacementPolicy `protobuf:"bytes,6,opt,name=placement_policy,json=placementPolicy" json:"placement_policy,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Container) Reset() {
*x = Container{}
mi := &file_api_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_api_container_grpc_types_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
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 && x.BasicAcl != 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
}
func (x *Container) SetVersion(v *grpc.Version) {
x.Version = v
}
func (x *Container) SetOwnerId(v *grpc.OwnerID) {
x.OwnerId = v
}
func (x *Container) SetNonce(v []byte) {
if v == nil {
v = []byte{}
}
x.Nonce = v
}
func (x *Container) SetBasicAcl(v uint32) {
x.BasicAcl = &v
}
func (x *Container) SetAttributes(v []*Container_Attribute) {
x.Attributes = v
}
func (x *Container) SetPlacementPolicy(v *grpc1.PlacementPolicy) {
x.PlacementPolicy = v
}
func (x *Container) HasVersion() bool {
if x == nil {
return false
}
return x.Version != nil
}
func (x *Container) HasOwnerId() bool {
if x == nil {
return false
}
return x.OwnerId != nil
}
func (x *Container) HasNonce() bool {
if x == nil {
return false
}
return x.Nonce != nil
}
func (x *Container) HasBasicAcl() bool {
if x == nil {
return false
}
return x.BasicAcl != nil
}
func (x *Container) HasPlacementPolicy() bool {
if x == nil {
return false
}
return x.PlacementPolicy != nil
}
func (x *Container) ClearVersion() {
x.Version = nil
}
func (x *Container) ClearOwnerId() {
x.OwnerId = nil
}
func (x *Container) ClearNonce() {
x.Nonce = nil
}
func (x *Container) ClearBasicAcl() {
x.BasicAcl = nil
}
func (x *Container) ClearPlacementPolicy() {
x.PlacementPolicy = nil
}
type Container_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Container format version. Effectively, the version of API library used to
// create the container.
Version *grpc.Version
// Identifier of the container owner
OwnerId *grpc.OwnerID
// Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s
Nonce []byte
// `BasicACL` contains access control rules for the owner, system and others
// groups, as well as permission bits for `BearerToken` and `Extended ACL`
BasicAcl *uint32
// Attributes represent immutable container's meta data
Attributes []*Container_Attribute
// Placement policy for the object inside the container
PlacementPolicy *grpc1.PlacementPolicy
}
func (b0 Container_builder) Build() *Container {
m0 := &Container{}
b, x := &b0, m0
_, _ = b, x
x.Version = b.Version
x.OwnerId = b.OwnerId
x.Nonce = b.Nonce
x.BasicAcl = b.BasicAcl
x.Attributes = b.Attributes
x.PlacementPolicy = b.PlacementPolicy
return m0
}
// `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 FrostFS 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 `protogen:"hybrid.v1"`
// Attribute name key
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
// Attribute value
Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Container_Attribute) Reset() {
*x = Container_Attribute{}
mi := &file_api_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_api_container_grpc_types_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Container_Attribute) GetKey() string {
if x != nil && x.Key != nil {
return *x.Key
}
return ""
}
func (x *Container_Attribute) GetValue() string {
if x != nil && x.Value != nil {
return *x.Value
}
return ""
}
func (x *Container_Attribute) SetKey(v string) {
x.Key = &v
}
func (x *Container_Attribute) SetValue(v string) {
x.Value = &v
}
func (x *Container_Attribute) HasKey() bool {
if x == nil {
return false
}
return x.Key != nil
}
func (x *Container_Attribute) HasValue() bool {
if x == nil {
return false
}
return x.Value != nil
}
func (x *Container_Attribute) ClearKey() {
x.Key = nil
}
func (x *Container_Attribute) ClearValue() {
x.Value = nil
}
type Container_Attribute_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Attribute name key
Key *string
// Attribute value
Value *string
}
func (b0 Container_Attribute_builder) Build() *Container_Attribute {
m0 := &Container_Attribute{}
b, x := &b0, m0
_, _ = b, x
x.Key = b.Key
x.Value = b.Value
return m0
}
var File_api_container_grpc_types_proto protoreflect.FileDescriptor
var file_api_container_grpc_types_proto_rawDesc = []byte{
0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 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, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61,
0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 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, 0x6b, 0x5a, 0x49, 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, 0x73, 0x64, 0x6b, 0x2d,
0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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,
0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_container_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_api_container_grpc_types_proto_goTypes = []any{
(*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_api_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_api_container_grpc_types_proto_init() }
func file_api_container_grpc_types_proto_init() {
if File_api_container_grpc_types_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_container_grpc_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_api_container_grpc_types_proto_goTypes,
DependencyIndexes: file_api_container_grpc_types_proto_depIdxs,
MessageInfos: file_api_container_grpc_types_proto_msgTypes,
}.Build()
File_api_container_grpc_types_proto = out.File
file_api_container_grpc_types_proto_rawDesc = nil
file_api_container_grpc_types_proto_goTypes = nil
file_api_container_grpc_types_proto_depIdxs = nil
}

View file

@ -1,554 +0,0 @@
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
package container
import (
json "encoding/json"
fmt "fmt"
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc"
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool"
proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto"
encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding"
easyproto "github.com/VictoriaMetrics/easyproto"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
strconv "strconv"
)
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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"key\":"
out.RawString(prefix)
out.String(x.Key)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
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.NestedStructureSizeUnchecked(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.EmitProtobuf(mm.AppendMessage(1))
}
if x.OwnerId != nil {
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 {
x.Attributes[i].EmitProtobuf(mm.AppendMessage(5))
}
if x.PlacementPolicy != nil {
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, 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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"version\":"
out.RawString(prefix)
x.Version.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerID\":"
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"nonce\":"
out.RawString(prefix)
if x.Nonce != nil {
out.Base64Bytes(x.Nonce)
} else {
out.String("")
}
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"basicACL\":"
out.RawString(prefix)
out.Uint32(x.BasicAcl)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
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(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
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
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
x.Nonce = f
}
case "basicACL":
{
var f uint32
r := in.JsonNumber()
n := r.String()
v, err := strconv.ParseUint(n, 10, 32)
if err != nil {
in.AddError(err)
return
}
pv := uint32(v)
f = pv
x.BasicAcl = f
}
case "attributes":
{
var f Container_Attribute
var list []Container_Attribute
in.Delim('[')
for !in.IsDelim(']') {
f = 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()
}
}

View file

@ -1,26 +0,0 @@
//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
}

View file

@ -1,21 +0,0 @@
//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)
})
}

469
api/container/grpc/types_protoopaque.pb.go generated Normal file
View file

@ -0,0 +1,469 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/container/grpc/types.proto
//go:build protoopaque
package container
import (
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/netmap/grpc"
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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 `protogen:"opaque.v1"`
xxx_hidden_Version *grpc.Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"`
xxx_hidden_OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID" json:"owner_id,omitempty"`
xxx_hidden_Nonce []byte `protobuf:"bytes,3,opt,name=nonce" json:"nonce,omitempty"`
xxx_hidden_BasicAcl uint32 `protobuf:"varint,4,opt,name=basic_acl,json=basicACL" json:"basic_acl,omitempty"`
xxx_hidden_Attributes *[]*Container_Attribute `protobuf:"bytes,5,rep,name=attributes" json:"attributes,omitempty"`
xxx_hidden_PlacementPolicy *grpc1.PlacementPolicy `protobuf:"bytes,6,opt,name=placement_policy,json=placementPolicy" json:"placement_policy,omitempty"`
XXX_raceDetectHookData protoimpl.RaceDetectHookData
XXX_presence [1]uint32
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Container) Reset() {
*x = Container{}
mi := &file_api_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_api_container_grpc_types_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Container) GetVersion() *grpc.Version {
if x != nil {
return x.xxx_hidden_Version
}
return nil
}
func (x *Container) GetOwnerId() *grpc.OwnerID {
if x != nil {
return x.xxx_hidden_OwnerId
}
return nil
}
func (x *Container) GetNonce() []byte {
if x != nil {
return x.xxx_hidden_Nonce
}
return nil
}
func (x *Container) GetBasicAcl() uint32 {
if x != nil {
return x.xxx_hidden_BasicAcl
}
return 0
}
func (x *Container) GetAttributes() []*Container_Attribute {
if x != nil {
if x.xxx_hidden_Attributes != nil {
return *x.xxx_hidden_Attributes
}
}
return nil
}
func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy {
if x != nil {
return x.xxx_hidden_PlacementPolicy
}
return nil
}
func (x *Container) SetVersion(v *grpc.Version) {
x.xxx_hidden_Version = v
}
func (x *Container) SetOwnerId(v *grpc.OwnerID) {
x.xxx_hidden_OwnerId = v
}
func (x *Container) SetNonce(v []byte) {
if v == nil {
v = []byte{}
}
x.xxx_hidden_Nonce = v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 6)
}
func (x *Container) SetBasicAcl(v uint32) {
x.xxx_hidden_BasicAcl = v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 6)
}
func (x *Container) SetAttributes(v []*Container_Attribute) {
x.xxx_hidden_Attributes = &v
}
func (x *Container) SetPlacementPolicy(v *grpc1.PlacementPolicy) {
x.xxx_hidden_PlacementPolicy = v
}
func (x *Container) HasVersion() bool {
if x == nil {
return false
}
return x.xxx_hidden_Version != nil
}
func (x *Container) HasOwnerId() bool {
if x == nil {
return false
}
return x.xxx_hidden_OwnerId != nil
}
func (x *Container) HasNonce() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 2)
}
func (x *Container) HasBasicAcl() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 3)
}
func (x *Container) HasPlacementPolicy() bool {
if x == nil {
return false
}
return x.xxx_hidden_PlacementPolicy != nil
}
func (x *Container) ClearVersion() {
x.xxx_hidden_Version = nil
}
func (x *Container) ClearOwnerId() {
x.xxx_hidden_OwnerId = nil
}
func (x *Container) ClearNonce() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)
x.xxx_hidden_Nonce = nil
}
func (x *Container) ClearBasicAcl() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3)
x.xxx_hidden_BasicAcl = 0
}
func (x *Container) ClearPlacementPolicy() {
x.xxx_hidden_PlacementPolicy = nil
}
type Container_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Container format version. Effectively, the version of API library used to
// create the container.
Version *grpc.Version
// Identifier of the container owner
OwnerId *grpc.OwnerID
// Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s
Nonce []byte
// `BasicACL` contains access control rules for the owner, system and others
// groups, as well as permission bits for `BearerToken` and `Extended ACL`
BasicAcl *uint32
// Attributes represent immutable container's meta data
Attributes []*Container_Attribute
// Placement policy for the object inside the container
PlacementPolicy *grpc1.PlacementPolicy
}
func (b0 Container_builder) Build() *Container {
m0 := &Container{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Version = b.Version
x.xxx_hidden_OwnerId = b.OwnerId
if b.Nonce != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 6)
x.xxx_hidden_Nonce = b.Nonce
}
if b.BasicAcl != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 6)
x.xxx_hidden_BasicAcl = *b.BasicAcl
}
x.xxx_hidden_Attributes = &b.Attributes
x.xxx_hidden_PlacementPolicy = b.PlacementPolicy
return m0
}
// `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 FrostFS 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 `protogen:"opaque.v1"`
xxx_hidden_Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
xxx_hidden_Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
XXX_raceDetectHookData protoimpl.RaceDetectHookData
XXX_presence [1]uint32
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Container_Attribute) Reset() {
*x = Container_Attribute{}
mi := &file_api_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_api_container_grpc_types_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Container_Attribute) GetKey() string {
if x != nil {
if x.xxx_hidden_Key != nil {
return *x.xxx_hidden_Key
}
return ""
}
return ""
}
func (x *Container_Attribute) GetValue() string {
if x != nil {
if x.xxx_hidden_Value != nil {
return *x.xxx_hidden_Value
}
return ""
}
return ""
}
func (x *Container_Attribute) SetKey(v string) {
x.xxx_hidden_Key = &v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2)
}
func (x *Container_Attribute) SetValue(v string) {
x.xxx_hidden_Value = &v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2)
}
func (x *Container_Attribute) HasKey() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 0)
}
func (x *Container_Attribute) HasValue() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 1)
}
func (x *Container_Attribute) ClearKey() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)
x.xxx_hidden_Key = nil
}
func (x *Container_Attribute) ClearValue() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)
x.xxx_hidden_Value = nil
}
type Container_Attribute_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Attribute name key
Key *string
// Attribute value
Value *string
}
func (b0 Container_Attribute_builder) Build() *Container_Attribute {
m0 := &Container_Attribute{}
b, x := &b0, m0
_, _ = b, x
if b.Key != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2)
x.xxx_hidden_Key = b.Key
}
if b.Value != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2)
x.xxx_hidden_Value = b.Value
}
return m0
}
var File_api_container_grpc_types_proto protoreflect.FileDescriptor
var file_api_container_grpc_types_proto_rawDesc = []byte{
0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 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, 0x1b, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61,
0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x19, 0x61, 0x70, 0x69, 0x2f, 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, 0x6b, 0x5a, 0x49, 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, 0x73, 0x64, 0x6b, 0x2d,
0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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,
0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_container_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_api_container_grpc_types_proto_goTypes = []any{
(*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_api_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_api_container_grpc_types_proto_init() }
func file_api_container_grpc_types_proto_init() {
if File_api_container_grpc_types_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_container_grpc_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_api_container_grpc_types_proto_goTypes,
DependencyIndexes: file_api_container_grpc_types_proto_depIdxs,
MessageInfos: file_api_container_grpc_types_proto_msgTypes,
}.Build()
File_api_container_grpc_types_proto = out.File
file_api_container_grpc_types_proto_rawDesc = nil
file_api_container_grpc_types_proto_goTypes = nil
file_api_container_grpc_types_proto_depIdxs = nil
}

148
api/lock/grpc/types.pb.go generated Normal file
View file

@ -0,0 +1,148 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/lock/grpc/types.proto
//go:build !protoopaque
package lock
import (
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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 `protogen:"hybrid.v1"`
// 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" json:"members,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Lock) Reset() {
*x = Lock{}
mi := &file_api_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_api_lock_grpc_types_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Lock) GetMembers() []*grpc.ObjectID {
if x != nil {
return x.Members
}
return nil
}
func (x *Lock) SetMembers(v []*grpc.ObjectID) {
x.Members = v
}
type Lock_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// List of objects to lock. Must not be empty or carry empty IDs.
// All members must be of the `REGULAR` type.
Members []*grpc.ObjectID
}
func (b0 Lock_builder) Build() *Lock {
m0 := &Lock{}
b, x := &b0, m0
_, _ = b, x
x.Members = b.Members
return m0
}
var File_api_lock_grpc_types_proto protoreflect.FileDescriptor
var file_api_lock_grpc_types_proto_rawDesc = []byte{
0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 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, 0x19, 0x61, 0x70, 0x69,
0x2f, 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, 0x5c, 0x5a, 0x3f, 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, 0x73, 0x64, 0x6b, 0x2d,
0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_lock_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_api_lock_grpc_types_proto_goTypes = []any{
(*Lock)(nil), // 0: neo.fs.v2.lock.Lock
(*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID
}
var file_api_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_api_lock_grpc_types_proto_init() }
func file_api_lock_grpc_types_proto_init() {
if File_api_lock_grpc_types_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_lock_grpc_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_api_lock_grpc_types_proto_goTypes,
DependencyIndexes: file_api_lock_grpc_types_proto_depIdxs,
MessageInfos: file_api_lock_grpc_types_proto_msgTypes,
}.Build()
File_api_lock_grpc_types_proto = out.File
file_api_lock_grpc_types_proto_rawDesc = nil
file_api_lock_grpc_types_proto_goTypes = nil
file_api_lock_grpc_types_proto_depIdxs = nil
}

View file

@ -1,171 +0,0 @@
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
package lock
import (
json "encoding/json"
fmt "fmt"
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool"
proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto"
encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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.NestedStructureSizeUnchecked(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 {
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, 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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
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 *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 = grpc.ObjectID{}
f.UnmarshalEasyJSON(in)
list = append(list, f)
in.WantComma()
}
x.Members = list
in.Delim(']')
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}

View file

@ -1,26 +0,0 @@
//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
}

View file

@ -1,21 +0,0 @@
//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)
})
}

148
api/lock/grpc/types_protoopaque.pb.go generated Normal file
View file

@ -0,0 +1,148 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/lock/grpc/types.proto
//go:build protoopaque
package lock
import (
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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 `protogen:"opaque.v1"`
xxx_hidden_Members *[]*grpc.ObjectID `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Lock) Reset() {
*x = Lock{}
mi := &file_api_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_api_lock_grpc_types_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Lock) GetMembers() []*grpc.ObjectID {
if x != nil {
if x.xxx_hidden_Members != nil {
return *x.xxx_hidden_Members
}
}
return nil
}
func (x *Lock) SetMembers(v []*grpc.ObjectID) {
x.xxx_hidden_Members = &v
}
type Lock_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// List of objects to lock. Must not be empty or carry empty IDs.
// All members must be of the `REGULAR` type.
Members []*grpc.ObjectID
}
func (b0 Lock_builder) Build() *Lock {
m0 := &Lock{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Members = &b.Members
return m0
}
var File_api_lock_grpc_types_proto protoreflect.FileDescriptor
var file_api_lock_grpc_types_proto_rawDesc = []byte{
0x0a, 0x19, 0x61, 0x70, 0x69, 0x2f, 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, 0x19, 0x61, 0x70, 0x69,
0x2f, 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, 0x5c, 0x5a, 0x3f, 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, 0x73, 0x64, 0x6b, 0x2d,
0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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, 0x08, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_lock_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_api_lock_grpc_types_proto_goTypes = []any{
(*Lock)(nil), // 0: neo.fs.v2.lock.Lock
(*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID
}
var file_api_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_api_lock_grpc_types_proto_init() }
func file_api_lock_grpc_types_proto_init() {
if File_api_lock_grpc_types_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_lock_grpc_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_api_lock_grpc_types_proto_goTypes,
DependencyIndexes: file_api_lock_grpc_types_proto_depIdxs,
MessageInfos: file_api_lock_grpc_types_proto_msgTypes,
}.Build()
File_api_lock_grpc_types_proto = out.File
file_api_lock_grpc_types_proto_rawDesc = nil
file_api_lock_grpc_types_proto_goTypes = nil
file_api_lock_grpc_types_proto_depIdxs = nil
}

View file

@ -45,24 +45,24 @@ func (f *Filter) FromGRPCMessage(m grpc.Message) error {
return nil
}
func FiltersToGRPC(fs []Filter) (res []netmap.Filter) {
func FiltersToGRPC(fs []Filter) (res []*netmap.Filter) {
if fs != nil {
res = make([]netmap.Filter, 0, len(fs))
res = make([]*netmap.Filter, 0, len(fs))
for i := range fs {
res = append(res, *fs[i].ToGRPCMessage().(*netmap.Filter))
res = append(res, fs[i].ToGRPCMessage().(*netmap.Filter))
}
}
return
}
func FiltersFromGRPC(fs []netmap.Filter) (res []Filter, err error) {
func FiltersFromGRPC(fs []*netmap.Filter) (res []Filter, err error) {
if fs != nil {
res = make([]Filter, len(fs))
for i := range fs {
err = res[i].FromGRPCMessage(&fs[i])
err = res[i].FromGRPCMessage(fs[i])
if err != nil {
return
}
@ -103,24 +103,24 @@ func (s *Selector) FromGRPCMessage(m grpc.Message) error {
return nil
}
func SelectorsToGRPC(ss []Selector) (res []netmap.Selector) {
func SelectorsToGRPC(ss []Selector) (res []*netmap.Selector) {
if ss != nil {
res = make([]netmap.Selector, 0, len(ss))
res = make([]*netmap.Selector, 0, len(ss))
for i := range ss {
res = append(res, *ss[i].ToGRPCMessage().(*netmap.Selector))
res = append(res, ss[i].ToGRPCMessage().(*netmap.Selector))
}
}
return
}
func SelectorsFromGRPC(ss []netmap.Selector) (res []Selector, err error) {
func SelectorsFromGRPC(ss []*netmap.Selector) (res []Selector, err error) {
if ss != nil {
res = make([]Selector, len(ss))
for i := range ss {
err = res[i].FromGRPCMessage(&ss[i])
err = res[i].FromGRPCMessage(ss[i])
if err != nil {
return
}
@ -138,8 +138,8 @@ func (r *Replica) ToGRPCMessage() grpc.Message {
m.SetSelector(r.selector)
m.SetCount(r.count)
m.EcDataCount = r.ecDataCount
m.EcParityCount = r.ecParityCount
m.SetEcDataCount(r.ecDataCount)
m.SetEcParityCount(r.ecParityCount)
}
return m
@ -159,24 +159,24 @@ func (r *Replica) FromGRPCMessage(m grpc.Message) error {
return nil
}
func ReplicasToGRPC(rs []Replica) (res []netmap.Replica) {
func ReplicasToGRPC(rs []Replica) (res []*netmap.Replica) {
if rs != nil {
res = make([]netmap.Replica, 0, len(rs))
res = make([]*netmap.Replica, 0, len(rs))
for i := range rs {
res = append(res, *rs[i].ToGRPCMessage().(*netmap.Replica))
res = append(res, rs[i].ToGRPCMessage().(*netmap.Replica))
}
}
return
}
func ReplicasFromGRPC(rs []netmap.Replica) (res []Replica, err error) {
func ReplicasFromGRPC(rs []*netmap.Replica) (res []Replica, err error) {
if rs != nil {
res = make([]Replica, len(rs))
for i := range rs {
err = res[i].FromGRPCMessage(&rs[i])
err = res[i].FromGRPCMessage(rs[i])
if err != nil {
return
}
@ -283,24 +283,24 @@ func (a *Attribute) FromGRPCMessage(m grpc.Message) error {
return nil
}
func AttributesToGRPC(as []Attribute) (res []netmap.NodeInfo_Attribute) {
func AttributesToGRPC(as []Attribute) (res []*netmap.NodeInfo_Attribute) {
if as != nil {
res = make([]netmap.NodeInfo_Attribute, 0, len(as))
res = make([]*netmap.NodeInfo_Attribute, 0, len(as))
for i := range as {
res = append(res, *as[i].ToGRPCMessage().(*netmap.NodeInfo_Attribute))
res = append(res, as[i].ToGRPCMessage().(*netmap.NodeInfo_Attribute))
}
}
return
}
func AttributesFromGRPC(as []netmap.NodeInfo_Attribute) (res []Attribute, err error) {
func AttributesFromGRPC(as []*netmap.NodeInfo_Attribute) (res []Attribute, err error) {
if as != nil {
res = make([]Attribute, len(as))
for i := range as {
err = res[i].FromGRPCMessage(&as[i])
err = res[i].FromGRPCMessage(as[i])
if err != nil {
return
}
@ -520,13 +520,13 @@ func (x *NetworkConfig) ToGRPCMessage() grpc.Message {
if x != nil {
m = new(netmap.NetworkConfig)
var ps []netmap.NetworkConfig_Parameter
var ps []*netmap.NetworkConfig_Parameter
if ln := len(x.ps); ln > 0 {
ps = make([]netmap.NetworkConfig_Parameter, 0, ln)
ps = make([]*netmap.NetworkConfig_Parameter, 0, ln)
for i := range ln {
ps = append(ps, *x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter))
ps = append(ps, x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter))
}
}
@ -553,7 +553,7 @@ func (x *NetworkConfig) FromGRPCMessage(m grpc.Message) error {
ps = make([]NetworkParameter, ln)
for i := range ln {
if err := ps[i].FromGRPCMessage(&psV2[i]); err != nil {
if err := ps[i].FromGRPCMessage(psV2[i]); err != nil {
return err
}
}
@ -746,10 +746,10 @@ func (x *NetMap) ToGRPCMessage() grpc.Message {
m.SetEpoch(x.epoch)
if x.nodes != nil {
nodes := make([]netmap.NodeInfo, len(x.nodes))
nodes := make([]*netmap.NodeInfo, len(x.nodes))
for i := range x.nodes {
nodes[i] = *x.nodes[i].ToGRPCMessage().(*netmap.NodeInfo)
nodes[i] = x.nodes[i].ToGRPCMessage().(*netmap.NodeInfo)
}
m.SetNodes(nodes)
@ -774,7 +774,7 @@ func (x *NetMap) FromGRPCMessage(m grpc.Message) error {
x.nodes = make([]NodeInfo, len(nodes))
for i := range nodes {
err = x.nodes[i].FromGRPCMessage(&nodes[i])
err = x.nodes[i].FromGRPCMessage(nodes[i])
if err != nil {
return err
}

1417
api/netmap/grpc/service.pb.go generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,121 +0,0 @@
//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
}

View file

@ -1,71 +0,0 @@
//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)
})
}

View file

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v5.27.2
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.2
// source: api/netmap/grpc/service.proto
package netmap
@ -15,8 +15,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
NetmapService_LocalNodeInfo_FullMethodName = "/neo.fs.v2.netmap.NetmapService/LocalNodeInfo"
@ -27,6 +27,11 @@ const (
// NetmapServiceClient is the client API for NetmapService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// `NetmapService` provides methods to work with `Network Map` and the
// information required to build it. The resulting `Network Map` is stored in
// sidechain `Netmap` smart contract, while related information can be obtained
// from other FrostFS nodes.
type NetmapServiceClient interface {
// Get NodeInfo structure from the particular node directly.
// Node information can be taken from `Netmap` smart contract. In some cases,
@ -65,8 +70,9 @@ func NewNetmapServiceClient(cc grpc.ClientConnInterface) NetmapServiceClient {
}
func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LocalNodeInfoResponse)
err := c.cc.Invoke(ctx, NetmapService_LocalNodeInfo_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, NetmapService_LocalNodeInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -74,8 +80,9 @@ func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeIn
}
func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(NetworkInfoResponse)
err := c.cc.Invoke(ctx, NetmapService_NetworkInfo_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, NetmapService_NetworkInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -83,8 +90,9 @@ func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRe
}
func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnapshotRequest, opts ...grpc.CallOption) (*NetmapSnapshotResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(NetmapSnapshotResponse)
err := c.cc.Invoke(ctx, NetmapService_NetmapSnapshot_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, NetmapService_NetmapSnapshot_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -93,7 +101,12 @@ func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnap
// NetmapServiceServer is the server API for NetmapService service.
// All implementations should embed UnimplementedNetmapServiceServer
// for forward compatibility
// for forward compatibility.
//
// `NetmapService` provides methods to work with `Network Map` and the
// information required to build it. The resulting `Network Map` is stored in
// sidechain `Netmap` smart contract, while related information can be obtained
// from other FrostFS nodes.
type NetmapServiceServer interface {
// Get NodeInfo structure from the particular node directly.
// Node information can be taken from `Netmap` smart contract. In some cases,
@ -123,9 +136,12 @@ type NetmapServiceServer interface {
NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error)
}
// UnimplementedNetmapServiceServer should be embedded to have forward compatible implementations.
type UnimplementedNetmapServiceServer struct {
}
// UnimplementedNetmapServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedNetmapServiceServer struct{}
func (UnimplementedNetmapServiceServer) LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LocalNodeInfo not implemented")
@ -136,6 +152,7 @@ func (UnimplementedNetmapServiceServer) NetworkInfo(context.Context, *NetworkInf
func (UnimplementedNetmapServiceServer) NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NetmapSnapshot not implemented")
}
func (UnimplementedNetmapServiceServer) testEmbeddedByValue() {}
// UnsafeNetmapServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to NetmapServiceServer will
@ -145,6 +162,13 @@ type UnsafeNetmapServiceServer interface {
}
func RegisterNetmapServiceServer(s grpc.ServiceRegistrar, srv NetmapServiceServer) {
// If the following call pancis, it indicates UnimplementedNetmapServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&NetmapService_ServiceDesc, srv)
}

1377
api/netmap/grpc/service_protoopaque.pb.go generated Normal file

File diff suppressed because it is too large Load diff

1857
api/netmap/grpc/types.pb.go generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,159 +0,0 @@
//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
}

View file

@ -1,91 +0,0 @@
//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)
})
}

2001
api/netmap/grpc/types_protoopaque.pb.go generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -14,12 +14,10 @@ func (x Clause) String() string {
//
// Returns true if s was parsed successfully.
func (x *Clause) FromString(s string) bool {
var g netmap.Clause
ok := g.FromString(s)
g, ok := netmap.Clause_value[s]
if ok {
*x = ClauseFromGRPCMessage(g)
*x = ClauseFromGRPCMessage(netmap.Clause(g))
}
return ok
@ -35,12 +33,10 @@ func (x Operation) String() string {
//
// Returns true if s was parsed successfully.
func (x *Operation) FromString(s string) bool {
var g netmap.Operation
ok := g.FromString(s)
g, ok := netmap.Operation_value[s]
if ok {
*x = OperationFromGRPCMessage(g)
*x = OperationFromGRPCMessage(netmap.Operation(g))
}
return ok
@ -56,12 +52,10 @@ func (x NodeState) String() string {
//
// Returns true if s was parsed successfully.
func (x *NodeState) FromString(s string) bool {
var g netmap.NodeInfo_State
ok := g.FromString(s)
g, ok := netmap.NodeInfo_State_value[s]
if ok {
*x = NodeStateFromRPCMessage(g)
*x = NodeStateFromRPCMessage(netmap.NodeInfo_State(g))
}
return ok

View file

@ -142,24 +142,24 @@ func (a *Attribute) FromGRPCMessage(m grpc.Message) error {
return nil
}
func AttributesToGRPC(xs []Attribute) (res []object.Header_Attribute) {
func AttributesToGRPC(xs []Attribute) (res []*object.Header_Attribute) {
if xs != nil {
res = make([]object.Header_Attribute, 0, len(xs))
res = make([]*object.Header_Attribute, 0, len(xs))
for i := range xs {
res = append(res, *xs[i].ToGRPCMessage().(*object.Header_Attribute))
res = append(res, xs[i].ToGRPCMessage().(*object.Header_Attribute))
}
}
return
}
func AttributesFromGRPC(xs []object.Header_Attribute) (res []Attribute, err error) {
func AttributesFromGRPC(xs []*object.Header_Attribute) (res []Attribute, err error) {
if xs != nil {
res = make([]Attribute, len(xs))
for i := range xs {
err = res[i].FromGRPCMessage(&xs[i])
err = res[i].FromGRPCMessage(xs[i])
if err != nil {
return
}
@ -266,14 +266,14 @@ func (h *ECHeader) ToGRPCMessage() grpc.Message {
if h != nil {
m = new(object.Header_EC)
m.Parent = h.Parent.ToGRPCMessage().(*refsGRPC.ObjectID)
m.ParentSplitId = h.ParentSplitID
m.ParentSplitParentId = h.ParentSplitParentID.ToGRPCMessage().(*refsGRPC.ObjectID)
m.ParentAttributes = AttributesToGRPC(h.ParentAttributes)
m.Index = h.Index
m.Total = h.Total
m.Header = h.Header
m.HeaderLength = h.HeaderLength
m.SetParent(h.Parent.ToGRPCMessage().(*refsGRPC.ObjectID))
m.SetParentSplitId(h.ParentSplitID)
m.SetParentSplitParentId(h.ParentSplitParentID.ToGRPCMessage().(*refsGRPC.ObjectID))
m.SetParentAttributes(AttributesToGRPC(h.ParentAttributes))
m.SetIndex(h.Index)
m.SetTotal(h.Total)
m.SetHeader(h.Header)
m.SetHeaderLength(h.HeaderLength)
}
return m
@ -681,9 +681,9 @@ func (s *ECInfo) ToGRPCMessage() grpc.Message {
m = new(object.ECInfo)
if s.Chunks != nil {
chunks := make([]object.ECInfo_Chunk, len(s.Chunks))
chunks := make([]*object.ECInfo_Chunk, len(s.Chunks))
for i := range chunks {
chunks[i] = *s.Chunks[i].ToGRPCMessage().(*object.ECInfo_Chunk)
chunks[i] = s.Chunks[i].ToGRPCMessage().(*object.ECInfo_Chunk)
}
m.Chunks = chunks
}
@ -704,7 +704,7 @@ func (s *ECInfo) FromGRPCMessage(m grpc.Message) error {
} else {
s.Chunks = make([]ECChunk, len(chunks))
for i := range chunks {
if err := s.Chunks[i].FromGRPCMessage(&chunks[i]); err != nil {
if err := s.Chunks[i].FromGRPCMessage(chunks[i]); err != nil {
return err
}
}
@ -718,9 +718,9 @@ func (c *ECChunk) ToGRPCMessage() grpc.Message {
if c != nil {
m = new(object.ECInfo_Chunk)
m.Total = c.Total
m.Index = c.Index
m.Id = c.ID.ToGRPCMessage().(*refsGRPC.ObjectID)
m.SetTotal(c.Total)
m.SetIndex(c.Index)
m.SetId(c.ID.ToGRPCMessage().(*refsGRPC.ObjectID))
}
return m
@ -735,8 +735,8 @@ func (c *ECChunk) FromGRPCMessage(m grpc.Message) error {
if err := c.ID.FromGRPCMessage(v.GetId()); err != nil {
return err
}
c.Index = v.Index
c.Total = v.Total
c.Index = v.GetIndex()
c.Total = v.GetTotal()
return nil
}
@ -888,8 +888,7 @@ func (r *GetObjectPartChunk) ToGRPCMessage() grpc.Message {
if r != nil {
m = new(object.GetResponse_Body_Chunk)
m.SetChunk(r.chunk)
m.Chunk = r.chunk
}
return m
@ -901,7 +900,7 @@ func (r *GetObjectPartChunk) FromGRPCMessage(m grpc.Message) error {
return message.NewUnexpectedMessageType(m, v)
}
r.chunk = v.GetChunk()
r.chunk = v.Chunk
return nil
}
@ -918,7 +917,7 @@ func (r *GetResponseBody) ToGRPCMessage() grpc.Message {
case *GetObjectPartInit:
m.SetInit(t.ToGRPCMessage().(*object.GetResponse_Body_Init))
case *GetObjectPartChunk:
m.SetChunk(t.ToGRPCMessage().(*object.GetResponse_Body_Chunk))
m.SetChunk(t.ToGRPCMessage().(*object.GetResponse_Body_Chunk).Chunk)
case *SplitInfo:
m.SetSplitInfo(t.ToGRPCMessage().(*object.SplitInfo))
case *ECInfo:
@ -1088,7 +1087,7 @@ func (r *PutObjectPartChunk) ToGRPCMessage() grpc.Message {
if r != nil {
m = new(object.PutRequest_Body_Chunk)
m.SetChunk(r.chunk)
m.Chunk = r.chunk
}
return m
@ -1100,7 +1099,7 @@ func (r *PutObjectPartChunk) FromGRPCMessage(m grpc.Message) error {
return message.NewUnexpectedMessageType(m, v)
}
r.chunk = v.GetChunk()
r.chunk = v.Chunk
return nil
}
@ -1117,7 +1116,7 @@ func (r *PutRequestBody) ToGRPCMessage() grpc.Message {
case *PutObjectPartInit:
m.SetInit(t.ToGRPCMessage().(*object.PutRequest_Body_Init))
case *PutObjectPartChunk:
m.SetChunk(t.ToGRPCMessage().(*object.PutRequest_Body_Chunk))
m.SetChunk(t.ToGRPCMessage().(*object.PutRequest_Body_Chunk).Chunk)
default:
panic(fmt.Sprintf("unknown put object part %T", t))
}
@ -1624,24 +1623,24 @@ func (f *SearchFilter) FromGRPCMessage(m grpc.Message) error {
return nil
}
func SearchFiltersToGRPC(fs []SearchFilter) (res []object.SearchRequest_Body_Filter) {
func SearchFiltersToGRPC(fs []SearchFilter) (res []*object.SearchRequest_Body_Filter) {
if fs != nil {
res = make([]object.SearchRequest_Body_Filter, 0, len(fs))
res = make([]*object.SearchRequest_Body_Filter, 0, len(fs))
for i := range fs {
res = append(res, *fs[i].ToGRPCMessage().(*object.SearchRequest_Body_Filter))
res = append(res, fs[i].ToGRPCMessage().(*object.SearchRequest_Body_Filter))
}
}
return
}
func SearchFiltersFromGRPC(fs []object.SearchRequest_Body_Filter) (res []SearchFilter, err error) {
func SearchFiltersFromGRPC(fs []*object.SearchRequest_Body_Filter) (res []SearchFilter, err error) {
if fs != nil {
res = make([]SearchFilter, len(fs))
for i := range fs {
err = res[i].FromGRPCMessage(&fs[i])
err = res[i].FromGRPCMessage(fs[i])
if err != nil {
return
}
@ -1823,24 +1822,24 @@ func (r *Range) FromGRPCMessage(m grpc.Message) error {
return nil
}
func RangesToGRPC(rs []Range) (res []object.Range) {
func RangesToGRPC(rs []Range) (res []*object.Range) {
if rs != nil {
res = make([]object.Range, 0, len(rs))
res = make([]*object.Range, 0, len(rs))
for i := range rs {
res = append(res, *rs[i].ToGRPCMessage().(*object.Range))
res = append(res, rs[i].ToGRPCMessage().(*object.Range))
}
}
return
}
func RangesFromGRPC(rs []object.Range) (res []Range, err error) {
func RangesFromGRPC(rs []*object.Range) (res []Range, err error) {
if rs != nil {
res = make([]Range, len(rs))
for i := range rs {
err = res[i].FromGRPCMessage(&rs[i])
err = res[i].FromGRPCMessage(rs[i])
if err != nil {
return
}
@ -1949,7 +1948,7 @@ func (r *GetRangePartChunk) ToGRPCMessage() grpc.Message {
if r != nil {
m = new(object.GetRangeResponse_Body_Chunk)
m.SetChunk(r.chunk)
m.Chunk = r.chunk
}
return m
@ -1961,7 +1960,7 @@ func (r *GetRangePartChunk) FromGRPCMessage(m grpc.Message) error {
return message.NewUnexpectedMessageType(m, v)
}
r.chunk = v.GetChunk()
r.chunk = v.Chunk
return nil
}
@ -1976,7 +1975,7 @@ func (r *GetRangeResponseBody) ToGRPCMessage() grpc.Message {
case nil:
m.RangePart = nil
case *GetRangePartChunk:
m.SetChunk(v.ToGRPCMessage().(*object.GetRangeResponse_Body_Chunk))
m.SetChunk(v.ToGRPCMessage().(*object.GetRangeResponse_Body_Chunk).Chunk)
case *SplitInfo:
m.SetSplitInfo(v.ToGRPCMessage().(*object.SplitInfo))
case *ECInfo:

6239
api/object/grpc/service.pb.go generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,387 +0,0 @@
//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
}

View file

@ -1,211 +0,0 @@
//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)
})
}

View file

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v5.27.2
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.2
// source: api/object/grpc/service.proto
package object
@ -15,8 +15,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ObjectService_Get_FullMethodName = "/neo.fs.v2.object.ObjectService/Get"
@ -33,6 +33,9 @@ const (
// ObjectServiceClient is the client API for ObjectService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// `ObjectService` provides API for manipulating objects. Object operations do
// not affect the sidechain and are only served by nodes in p2p style.
type ObjectServiceClient interface {
// Receive full object structure, including Headers and payload. Response uses
// gRPC stream. First response message carries the object with the requested
@ -71,7 +74,7 @@ type ObjectServiceClient interface {
// access to container is denied;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
// provided session token has expired.
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error)
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetResponse], error)
// Put the object into container. Request uses gRPC stream. First message
// SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object
// SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see
@ -110,7 +113,7 @@ type ObjectServiceClient interface {
// been deleted;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
// provided session token has expired.
Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error)
Put(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PutRequest, PutResponse], error)
// Delete the object from a container. There is no immediate removal
// guarantee. Object will be marked for removal and deleted eventually.
//
@ -193,7 +196,7 @@ type ObjectServiceClient interface {
// access to container is denied;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
// provided session token has expired.
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, error)
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SearchResponse], error)
// Get byte range of data payload. Range is set as an (offset, length) tuple.
// Like in `Get` method, the response uses gRPC stream. Requested range can be
// restored by concatenation of all received payload chunks keeping the
@ -229,7 +232,7 @@ type ObjectServiceClient interface {
// access to container is denied;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
// provided session token has expired.
GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error)
GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetRangeResponse], error)
// Returns homomorphic or regular hash of object's payload range after
// applying XOR operation with the provided `salt`. Ranges are set of (offset,
// length) tuples. Hashes order in response corresponds to the ranges order in
@ -347,7 +350,7 @@ type ObjectServiceClient interface {
// has been deleted;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
// provided session token has expired.
Patch(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PatchClient, error)
Patch(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PatchRequest, PatchResponse], error)
}
type objectServiceClient struct {
@ -358,12 +361,13 @@ func NewObjectServiceClient(cc grpc.ClientConnInterface) ObjectServiceClient {
return &objectServiceClient{cc}
}
func (c *objectServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) {
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[0], ObjectService_Get_FullMethodName, opts...)
func (c *objectServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[0], ObjectService_Get_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &objectServiceGetClient{stream}
x := &grpc.GenericClientStream[GetRequest, GetResponse]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
@ -373,60 +377,26 @@ func (c *objectServiceClient) Get(ctx context.Context, in *GetRequest, opts ...g
return x, nil
}
type ObjectService_GetClient interface {
Recv() (*GetResponse, error)
grpc.ClientStream
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ObjectService_GetClient = grpc.ServerStreamingClient[GetResponse]
type objectServiceGetClient struct {
grpc.ClientStream
}
func (x *objectServiceGetClient) Recv() (*GetResponse, error) {
m := new(GetResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *objectServiceClient) Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) {
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[1], ObjectService_Put_FullMethodName, opts...)
func (c *objectServiceClient) Put(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PutRequest, PutResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[1], ObjectService_Put_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &objectServicePutClient{stream}
x := &grpc.GenericClientStream[PutRequest, PutResponse]{ClientStream: stream}
return x, nil
}
type ObjectService_PutClient interface {
Send(*PutRequest) error
CloseAndRecv() (*PutResponse, error)
grpc.ClientStream
}
type objectServicePutClient struct {
grpc.ClientStream
}
func (x *objectServicePutClient) Send(m *PutRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *objectServicePutClient) CloseAndRecv() (*PutResponse, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(PutResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ObjectService_PutClient = grpc.ClientStreamingClient[PutRequest, PutResponse]
func (c *objectServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeleteResponse)
err := c.cc.Invoke(ctx, ObjectService_Delete_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, ObjectService_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -434,20 +404,22 @@ func (c *objectServiceClient) Delete(ctx context.Context, in *DeleteRequest, opt
}
func (c *objectServiceClient) Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(HeadResponse)
err := c.cc.Invoke(ctx, ObjectService_Head_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, ObjectService_Head_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *objectServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, error) {
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[2], ObjectService_Search_FullMethodName, opts...)
func (c *objectServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SearchResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[2], ObjectService_Search_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &objectServiceSearchClient{stream}
x := &grpc.GenericClientStream[SearchRequest, SearchResponse]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
@ -457,29 +429,16 @@ func (c *objectServiceClient) Search(ctx context.Context, in *SearchRequest, opt
return x, nil
}
type ObjectService_SearchClient interface {
Recv() (*SearchResponse, error)
grpc.ClientStream
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ObjectService_SearchClient = grpc.ServerStreamingClient[SearchResponse]
type objectServiceSearchClient struct {
grpc.ClientStream
}
func (x *objectServiceSearchClient) Recv() (*SearchResponse, error) {
m := new(SearchResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *objectServiceClient) GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) {
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[3], ObjectService_GetRange_FullMethodName, opts...)
func (c *objectServiceClient) GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetRangeResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[3], ObjectService_GetRange_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &objectServiceGetRangeClient{stream}
x := &grpc.GenericClientStream[GetRangeRequest, GetRangeResponse]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
@ -489,26 +448,13 @@ func (c *objectServiceClient) GetRange(ctx context.Context, in *GetRangeRequest,
return x, nil
}
type ObjectService_GetRangeClient interface {
Recv() (*GetRangeResponse, error)
grpc.ClientStream
}
type objectServiceGetRangeClient struct {
grpc.ClientStream
}
func (x *objectServiceGetRangeClient) Recv() (*GetRangeResponse, error) {
m := new(GetRangeResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ObjectService_GetRangeClient = grpc.ServerStreamingClient[GetRangeResponse]
func (c *objectServiceClient) GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetRangeHashResponse)
err := c.cc.Invoke(ctx, ObjectService_GetRangeHash_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, ObjectService_GetRangeHash_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -516,51 +462,34 @@ func (c *objectServiceClient) GetRangeHash(ctx context.Context, in *GetRangeHash
}
func (c *objectServiceClient) PutSingle(ctx context.Context, in *PutSingleRequest, opts ...grpc.CallOption) (*PutSingleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PutSingleResponse)
err := c.cc.Invoke(ctx, ObjectService_PutSingle_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, ObjectService_PutSingle_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *objectServiceClient) Patch(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PatchClient, error) {
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[4], ObjectService_Patch_FullMethodName, opts...)
func (c *objectServiceClient) Patch(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PatchRequest, PatchResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[4], ObjectService_Patch_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &objectServicePatchClient{stream}
x := &grpc.GenericClientStream[PatchRequest, PatchResponse]{ClientStream: stream}
return x, nil
}
type ObjectService_PatchClient interface {
Send(*PatchRequest) error
CloseAndRecv() (*PatchResponse, error)
grpc.ClientStream
}
type objectServicePatchClient struct {
grpc.ClientStream
}
func (x *objectServicePatchClient) Send(m *PatchRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *objectServicePatchClient) CloseAndRecv() (*PatchResponse, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(PatchResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ObjectService_PatchClient = grpc.ClientStreamingClient[PatchRequest, PatchResponse]
// ObjectServiceServer is the server API for ObjectService service.
// All implementations should embed UnimplementedObjectServiceServer
// for forward compatibility
// for forward compatibility.
//
// `ObjectService` provides API for manipulating objects. Object operations do
// not affect the sidechain and are only served by nodes in p2p style.
type ObjectServiceServer interface {
// Receive full object structure, including Headers and payload. Response uses
// gRPC stream. First response message carries the object with the requested
@ -599,7 +528,7 @@ type ObjectServiceServer interface {
// access to container is denied;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
// provided session token has expired.
Get(*GetRequest, ObjectService_GetServer) error
Get(*GetRequest, grpc.ServerStreamingServer[GetResponse]) error
// Put the object into container. Request uses gRPC stream. First message
// SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object
// SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see
@ -638,7 +567,7 @@ type ObjectServiceServer interface {
// been deleted;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
// provided session token has expired.
Put(ObjectService_PutServer) error
Put(grpc.ClientStreamingServer[PutRequest, PutResponse]) error
// Delete the object from a container. There is no immediate removal
// guarantee. Object will be marked for removal and deleted eventually.
//
@ -721,7 +650,7 @@ type ObjectServiceServer interface {
// access to container is denied;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
// provided session token has expired.
Search(*SearchRequest, ObjectService_SearchServer) error
Search(*SearchRequest, grpc.ServerStreamingServer[SearchResponse]) error
// Get byte range of data payload. Range is set as an (offset, length) tuple.
// Like in `Get` method, the response uses gRPC stream. Requested range can be
// restored by concatenation of all received payload chunks keeping the
@ -757,7 +686,7 @@ type ObjectServiceServer interface {
// access to container is denied;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
// provided session token has expired.
GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error
GetRange(*GetRangeRequest, grpc.ServerStreamingServer[GetRangeResponse]) error
// Returns homomorphic or regular hash of object's payload range after
// applying XOR operation with the provided `salt`. Ranges are set of (offset,
// length) tuples. Hashes order in response corresponds to the ranges order in
@ -875,17 +804,20 @@ type ObjectServiceServer interface {
// has been deleted;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
// provided session token has expired.
Patch(ObjectService_PatchServer) error
Patch(grpc.ClientStreamingServer[PatchRequest, PatchResponse]) error
}
// UnimplementedObjectServiceServer should be embedded to have forward compatible implementations.
type UnimplementedObjectServiceServer struct {
}
// UnimplementedObjectServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedObjectServiceServer struct{}
func (UnimplementedObjectServiceServer) Get(*GetRequest, ObjectService_GetServer) error {
func (UnimplementedObjectServiceServer) Get(*GetRequest, grpc.ServerStreamingServer[GetResponse]) error {
return status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedObjectServiceServer) Put(ObjectService_PutServer) error {
func (UnimplementedObjectServiceServer) Put(grpc.ClientStreamingServer[PutRequest, PutResponse]) error {
return status.Errorf(codes.Unimplemented, "method Put not implemented")
}
func (UnimplementedObjectServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) {
@ -894,10 +826,10 @@ func (UnimplementedObjectServiceServer) Delete(context.Context, *DeleteRequest)
func (UnimplementedObjectServiceServer) Head(context.Context, *HeadRequest) (*HeadResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Head not implemented")
}
func (UnimplementedObjectServiceServer) Search(*SearchRequest, ObjectService_SearchServer) error {
func (UnimplementedObjectServiceServer) Search(*SearchRequest, grpc.ServerStreamingServer[SearchResponse]) error {
return status.Errorf(codes.Unimplemented, "method Search not implemented")
}
func (UnimplementedObjectServiceServer) GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error {
func (UnimplementedObjectServiceServer) GetRange(*GetRangeRequest, grpc.ServerStreamingServer[GetRangeResponse]) error {
return status.Errorf(codes.Unimplemented, "method GetRange not implemented")
}
func (UnimplementedObjectServiceServer) GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) {
@ -906,9 +838,10 @@ func (UnimplementedObjectServiceServer) GetRangeHash(context.Context, *GetRangeH
func (UnimplementedObjectServiceServer) PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PutSingle not implemented")
}
func (UnimplementedObjectServiceServer) Patch(ObjectService_PatchServer) error {
func (UnimplementedObjectServiceServer) Patch(grpc.ClientStreamingServer[PatchRequest, PatchResponse]) error {
return status.Errorf(codes.Unimplemented, "method Patch not implemented")
}
func (UnimplementedObjectServiceServer) testEmbeddedByValue() {}
// UnsafeObjectServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ObjectServiceServer will
@ -918,6 +851,13 @@ type UnsafeObjectServiceServer interface {
}
func RegisterObjectServiceServer(s grpc.ServiceRegistrar, srv ObjectServiceServer) {
// If the following call pancis, it indicates UnimplementedObjectServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ObjectService_ServiceDesc, srv)
}
@ -926,47 +866,18 @@ func _ObjectService_Get_Handler(srv interface{}, stream grpc.ServerStream) error
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ObjectServiceServer).Get(m, &objectServiceGetServer{stream})
return srv.(ObjectServiceServer).Get(m, &grpc.GenericServerStream[GetRequest, GetResponse]{ServerStream: stream})
}
type ObjectService_GetServer interface {
Send(*GetResponse) error
grpc.ServerStream
}
type objectServiceGetServer struct {
grpc.ServerStream
}
func (x *objectServiceGetServer) Send(m *GetResponse) error {
return x.ServerStream.SendMsg(m)
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ObjectService_GetServer = grpc.ServerStreamingServer[GetResponse]
func _ObjectService_Put_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ObjectServiceServer).Put(&objectServicePutServer{stream})
return srv.(ObjectServiceServer).Put(&grpc.GenericServerStream[PutRequest, PutResponse]{ServerStream: stream})
}
type ObjectService_PutServer interface {
SendAndClose(*PutResponse) error
Recv() (*PutRequest, error)
grpc.ServerStream
}
type objectServicePutServer struct {
grpc.ServerStream
}
func (x *objectServicePutServer) SendAndClose(m *PutResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *objectServicePutServer) Recv() (*PutRequest, error) {
m := new(PutRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ObjectService_PutServer = grpc.ClientStreamingServer[PutRequest, PutResponse]
func _ObjectService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteRequest)
@ -1009,42 +920,22 @@ func _ObjectService_Search_Handler(srv interface{}, stream grpc.ServerStream) er
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ObjectServiceServer).Search(m, &objectServiceSearchServer{stream})
return srv.(ObjectServiceServer).Search(m, &grpc.GenericServerStream[SearchRequest, SearchResponse]{ServerStream: stream})
}
type ObjectService_SearchServer interface {
Send(*SearchResponse) error
grpc.ServerStream
}
type objectServiceSearchServer struct {
grpc.ServerStream
}
func (x *objectServiceSearchServer) Send(m *SearchResponse) error {
return x.ServerStream.SendMsg(m)
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ObjectService_SearchServer = grpc.ServerStreamingServer[SearchResponse]
func _ObjectService_GetRange_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(GetRangeRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ObjectServiceServer).GetRange(m, &objectServiceGetRangeServer{stream})
return srv.(ObjectServiceServer).GetRange(m, &grpc.GenericServerStream[GetRangeRequest, GetRangeResponse]{ServerStream: stream})
}
type ObjectService_GetRangeServer interface {
Send(*GetRangeResponse) error
grpc.ServerStream
}
type objectServiceGetRangeServer struct {
grpc.ServerStream
}
func (x *objectServiceGetRangeServer) Send(m *GetRangeResponse) error {
return x.ServerStream.SendMsg(m)
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ObjectService_GetRangeServer = grpc.ServerStreamingServer[GetRangeResponse]
func _ObjectService_GetRangeHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetRangeHashRequest)
@ -1083,30 +974,11 @@ func _ObjectService_PutSingle_Handler(srv interface{}, ctx context.Context, dec
}
func _ObjectService_Patch_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ObjectServiceServer).Patch(&objectServicePatchServer{stream})
return srv.(ObjectServiceServer).Patch(&grpc.GenericServerStream[PatchRequest, PatchResponse]{ServerStream: stream})
}
type ObjectService_PatchServer interface {
SendAndClose(*PatchResponse) error
Recv() (*PatchRequest, error)
grpc.ServerStream
}
type objectServicePatchServer struct {
grpc.ServerStream
}
func (x *objectServicePatchServer) SendAndClose(m *PatchResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *objectServicePatchServer) Recv() (*PatchRequest, error) {
m := new(PatchRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ObjectService_PatchServer = grpc.ClientStreamingServer[PatchRequest, PatchResponse]
// ObjectService_ServiceDesc is the grpc.ServiceDesc for ObjectService service.
// It's only intended for direct use with grpc.RegisterService,

6116
api/object/grpc/service_protoopaque.pb.go generated Normal file

File diff suppressed because it is too large Load diff

2093
api/object/grpc/types.pb.go generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,102 +0,0 @@
//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
}

View file

@ -1,61 +0,0 @@
//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)
})
}

2156
api/object/grpc/types_protoopaque.pb.go generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -89,13 +89,13 @@ func (x *Lock) ToGRPCMessage() grpc.Message {
if x != nil {
m = new(lock.Lock)
var members []refsGRPC.ObjectID
var members []*refsGRPC.ObjectID
if x.members != nil {
members = make([]refsGRPC.ObjectID, len(x.members))
members = make([]*refsGRPC.ObjectID, len(x.members))
for i := range x.members {
members[i] = *x.members[i].ToGRPCMessage().(*refsGRPC.ObjectID)
members[i] = x.members[i].ToGRPCMessage().(*refsGRPC.ObjectID)
}
}
@ -119,7 +119,7 @@ func (x *Lock) FromGRPCMessage(m grpc.Message) error {
var err error
for i := range x.members {
err = x.members[i].FromGRPCMessage(&members[i])
err = x.members[i].FromGRPCMessage(members[i])
if err != nil {
return err
}

View file

@ -14,12 +14,10 @@ func (t Type) String() string {
//
// Returns true if s was parsed successfully.
func (t *Type) FromString(s string) bool {
var g object.ObjectType
ok := g.FromString(s)
g, ok := object.ObjectType_value[s]
if ok {
*t = TypeFromGRPCField(g)
*t = TypeFromGRPCField(object.ObjectType(g))
}
return ok
@ -43,12 +41,10 @@ func (t MatchType) String() string {
//
// Returns true if s was parsed successfully.
func (t *MatchType) FromString(s string) bool {
var g object.MatchType
ok := g.FromString(s)
g, ok := object.MatchType_value[s]
if ok {
*t = MatchTypeFromGRPCField(g)
*t = MatchTypeFromGRPCField(object.MatchType(g))
}
return ok

View file

@ -52,24 +52,24 @@ func (c *ContainerID) FromGRPCMessage(m grpc.Message) error {
return nil
}
func ContainerIDsToGRPCMessage(ids []ContainerID) (res []refs.ContainerID) {
func ContainerIDsToGRPCMessage(ids []ContainerID) (res []*refs.ContainerID) {
if ids != nil {
res = make([]refs.ContainerID, 0, len(ids))
res = make([]*refs.ContainerID, 0, len(ids))
for i := range ids {
res = append(res, *ids[i].ToGRPCMessage().(*refs.ContainerID))
res = append(res, ids[i].ToGRPCMessage().(*refs.ContainerID))
}
}
return
}
func ContainerIDsFromGRPCMessage(idsV2 []refs.ContainerID) (res []ContainerID, err error) {
func ContainerIDsFromGRPCMessage(idsV2 []*refs.ContainerID) (res []ContainerID, err error) {
if idsV2 != nil {
res = make([]ContainerID, len(idsV2))
for i := range idsV2 {
err = res[i].FromGRPCMessage(&idsV2[i])
err = res[i].FromGRPCMessage(idsV2[i])
if err != nil {
return
}
@ -102,24 +102,24 @@ func (o *ObjectID) FromGRPCMessage(m grpc.Message) error {
return nil
}
func ObjectIDListToGRPCMessage(ids []ObjectID) (res []refs.ObjectID) {
func ObjectIDListToGRPCMessage(ids []ObjectID) (res []*refs.ObjectID) {
if ids != nil {
res = make([]refs.ObjectID, 0, len(ids))
res = make([]*refs.ObjectID, 0, len(ids))
for i := range ids {
res = append(res, *ids[i].ToGRPCMessage().(*refs.ObjectID))
res = append(res, ids[i].ToGRPCMessage().(*refs.ObjectID))
}
}
return
}
func ObjectIDListFromGRPCMessage(idsV2 []refs.ObjectID) (res []ObjectID, err error) {
func ObjectIDListFromGRPCMessage(idsV2 []*refs.ObjectID) (res []ObjectID, err error) {
if idsV2 != nil {
res = make([]ObjectID, len(idsV2))
for i := range idsV2 {
err = res[i].FromGRPCMessage(&idsV2[i])
err = res[i].FromGRPCMessage(idsV2[i])
if err != nil {
return
}

1043
api/refs/grpc/types.pb.go generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,159 +0,0 @@
//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
}

View file

@ -1,91 +0,0 @@
//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)
})
}

1107
api/refs/grpc/types_protoopaque.pb.go generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -14,12 +14,10 @@ func (t ChecksumType) String() string {
//
// Returns true if s was parsed successfully.
func (t *ChecksumType) FromString(s string) bool {
var g refs.ChecksumType
ok := g.FromString(s)
g, ok := refs.ChecksumType_value[s]
if ok {
*t = ChecksumTypeFromGRPC(g)
*t = ChecksumTypeFromGRPC(refs.ChecksumType(g))
}
return ok
@ -35,12 +33,10 @@ func (t SignatureScheme) String() string {
//
// Returns true if s was parsed successfully.
func (t *SignatureScheme) FromString(s string) bool {
var g refs.SignatureScheme
ok := g.FromString(s)
g, ok := refs.SignatureScheme_value[s]
if ok {
*t = SignatureScheme(g)
*t = SignatureScheme(refs.SignatureScheme(g))
}
return ok

View file

@ -1,14 +1,17 @@
package message
import (
"encoding/json"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
)
// GRPCConvertedMessage is an interface
// of the gRPC message that is used
// for Message encoding/decoding.
type GRPCConvertedMessage interface {
UnmarshalProtobuf([]byte) error
grpc.Message
proto.Message
}
// Unmarshal decodes m from its Protobuf binary representation
@ -16,7 +19,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 := gm.UnmarshalProtobuf(data); err != nil {
if err := proto.Unmarshal(data, gm); err != nil {
return err
}
@ -25,16 +28,21 @@ func Unmarshal(m Message, data []byte, gm GRPCConvertedMessage) error {
// MarshalJSON encodes m to Protobuf JSON representation.
func MarshalJSON(m Message) ([]byte, error) {
return json.Marshal(m.ToGRPCMessage())
return protojson.MarshalOptions{
EmitUnpopulated: true,
}.Marshal(
m.ToGRPCMessage().(proto.Message),
)
}
// 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 any) error {
if err := json.Unmarshal(data, gm); err != nil {
func UnmarshalJSON(m Message, data []byte, gm GRPCConvertedMessage) error {
if err := protojson.Unmarshal(data, gm); err != nil {
return err
}
return m.FromGRPCMessage(gm)
}

View file

@ -70,6 +70,7 @@ func TestRPCMessage(t *testing.T, msgGens ...func(empty bool) message.Message) {
})
}
t.Run("compatibility", func(t *testing.T) {
t.Skip()
testCompatibility(t, msgGen)
})
})

View file

@ -207,24 +207,24 @@ func (x *XHeader) FromGRPCMessage(m grpc.Message) error {
return nil
}
func XHeadersToGRPC(xs []XHeader) (res []session.XHeader) {
func XHeadersToGRPC(xs []XHeader) (res []*session.XHeader) {
if xs != nil {
res = make([]session.XHeader, 0, len(xs))
res = make([]*session.XHeader, 0, len(xs))
for i := range xs {
res = append(res, *xs[i].ToGRPCMessage().(*session.XHeader))
res = append(res, xs[i].ToGRPCMessage().(*session.XHeader))
}
}
return
}
func XHeadersFromGRPC(xs []session.XHeader) (res []XHeader, err error) {
func XHeadersFromGRPC(xs []*session.XHeader) (res []XHeader, err error) {
if xs != nil {
res = make([]XHeader, len(xs))
for i := range xs {
err = res[i].FromGRPCMessage(&xs[i])
err = res[i].FromGRPCMessage(xs[i])
if err != nil {
return
}

606
api/session/grpc/service.pb.go generated Normal file
View file

@ -0,0 +1,606 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/session/grpc/service.proto
//go:build !protoopaque
package session
import (
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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 `protogen:"hybrid.v1"`
// Body of a create session token request message.
Body *CreateRequest_Body `protobuf:"bytes,1,opt,name=body" 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" 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" json:"verify_header,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateRequest) Reset() {
*x = CreateRequest{}
mi := &file_api_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_api_session_grpc_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
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
}
func (x *CreateRequest) SetBody(v *CreateRequest_Body) {
x.Body = v
}
func (x *CreateRequest) SetMetaHeader(v *RequestMetaHeader) {
x.MetaHeader = v
}
func (x *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) {
x.VerifyHeader = v
}
func (x *CreateRequest) HasBody() bool {
if x == nil {
return false
}
return x.Body != nil
}
func (x *CreateRequest) HasMetaHeader() bool {
if x == nil {
return false
}
return x.MetaHeader != nil
}
func (x *CreateRequest) HasVerifyHeader() bool {
if x == nil {
return false
}
return x.VerifyHeader != nil
}
func (x *CreateRequest) ClearBody() {
x.Body = nil
}
func (x *CreateRequest) ClearMetaHeader() {
x.MetaHeader = nil
}
func (x *CreateRequest) ClearVerifyHeader() {
x.VerifyHeader = nil
}
type CreateRequest_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Body of a create session token request message.
Body *CreateRequest_Body
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
MetaHeader *RequestMetaHeader
// Carries request verification information. This header is used to
// authenticate the nodes of the message route and check the correctness of
// transmission.
VerifyHeader *RequestVerificationHeader
}
func (b0 CreateRequest_builder) Build() *CreateRequest {
m0 := &CreateRequest{}
b, x := &b0, m0
_, _ = b, x
x.Body = b.Body
x.MetaHeader = b.MetaHeader
x.VerifyHeader = b.VerifyHeader
return m0
}
// Information about the opened session.
type CreateResponse struct {
state protoimpl.MessageState `protogen:"hybrid.v1"`
// Body of create session token response message.
Body *CreateResponse_Body `protobuf:"bytes,1,opt,name=body" 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" 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" json:"verify_header,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateResponse) Reset() {
*x = CreateResponse{}
mi := &file_api_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_api_session_grpc_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
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
}
func (x *CreateResponse) SetBody(v *CreateResponse_Body) {
x.Body = v
}
func (x *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) {
x.MetaHeader = v
}
func (x *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) {
x.VerifyHeader = v
}
func (x *CreateResponse) HasBody() bool {
if x == nil {
return false
}
return x.Body != nil
}
func (x *CreateResponse) HasMetaHeader() bool {
if x == nil {
return false
}
return x.MetaHeader != nil
}
func (x *CreateResponse) HasVerifyHeader() bool {
if x == nil {
return false
}
return x.VerifyHeader != nil
}
func (x *CreateResponse) ClearBody() {
x.Body = nil
}
func (x *CreateResponse) ClearMetaHeader() {
x.MetaHeader = nil
}
func (x *CreateResponse) ClearVerifyHeader() {
x.VerifyHeader = nil
}
type CreateResponse_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Body of create session token response message.
Body *CreateResponse_Body
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
MetaHeader *ResponseMetaHeader
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness of
// transmission.
VerifyHeader *ResponseVerificationHeader
}
func (b0 CreateResponse_builder) Build() *CreateResponse {
m0 := &CreateResponse{}
b, x := &b0, m0
_, _ = b, x
x.Body = b.Body
x.MetaHeader = b.MetaHeader
x.VerifyHeader = b.VerifyHeader
return m0
}
// Session creation request body
type CreateRequest_Body struct {
state protoimpl.MessageState `protogen:"hybrid.v1"`
// Session initiating user's or node's key derived `OwnerID`
OwnerId *grpc.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"`
// Session expiration `Epoch`
Expiration *uint64 `protobuf:"varint,2,opt,name=expiration" json:"expiration,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateRequest_Body) Reset() {
*x = CreateRequest_Body{}
mi := &file_api_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_api_session_grpc_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID {
if x != nil {
return x.OwnerId
}
return nil
}
func (x *CreateRequest_Body) GetExpiration() uint64 {
if x != nil && x.Expiration != nil {
return *x.Expiration
}
return 0
}
func (x *CreateRequest_Body) SetOwnerId(v *grpc.OwnerID) {
x.OwnerId = v
}
func (x *CreateRequest_Body) SetExpiration(v uint64) {
x.Expiration = &v
}
func (x *CreateRequest_Body) HasOwnerId() bool {
if x == nil {
return false
}
return x.OwnerId != nil
}
func (x *CreateRequest_Body) HasExpiration() bool {
if x == nil {
return false
}
return x.Expiration != nil
}
func (x *CreateRequest_Body) ClearOwnerId() {
x.OwnerId = nil
}
func (x *CreateRequest_Body) ClearExpiration() {
x.Expiration = nil
}
type CreateRequest_Body_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Session initiating user's or node's key derived `OwnerID`
OwnerId *grpc.OwnerID
// Session expiration `Epoch`
Expiration *uint64
}
func (b0 CreateRequest_Body_builder) Build() *CreateRequest_Body {
m0 := &CreateRequest_Body{}
b, x := &b0, m0
_, _ = b, x
x.OwnerId = b.OwnerId
x.Expiration = b.Expiration
return m0
}
// Session creation response body
type CreateResponse_Body struct {
state protoimpl.MessageState `protogen:"hybrid.v1"`
// Identifier of a newly created session
Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
// Public key used for session
SessionKey []byte `protobuf:"bytes,2,opt,name=session_key,json=sessionKey" json:"session_key,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateResponse_Body) Reset() {
*x = CreateResponse_Body{}
mi := &file_api_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_api_session_grpc_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
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
}
func (x *CreateResponse_Body) SetId(v []byte) {
if v == nil {
v = []byte{}
}
x.Id = v
}
func (x *CreateResponse_Body) SetSessionKey(v []byte) {
if v == nil {
v = []byte{}
}
x.SessionKey = v
}
func (x *CreateResponse_Body) HasId() bool {
if x == nil {
return false
}
return x.Id != nil
}
func (x *CreateResponse_Body) HasSessionKey() bool {
if x == nil {
return false
}
return x.SessionKey != nil
}
func (x *CreateResponse_Body) ClearId() {
x.Id = nil
}
func (x *CreateResponse_Body) ClearSessionKey() {
x.SessionKey = nil
}
type CreateResponse_Body_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Identifier of a newly created session
Id []byte
// Public key used for session
SessionKey []byte
}
func (b0 CreateResponse_Body_builder) Build() *CreateResponse_Body {
m0 := &CreateResponse_Body{}
b, x := &b0, m0
_, _ = b, x
x.Id = b.Id
x.SessionKey = b.SessionKey
return m0
}
var File_api_session_grpc_service_proto protoreflect.FileDescriptor
var file_api_session_grpc_service_proto_rawDesc = []byte{
0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 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, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72,
0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c,
0x61, 0x70, 0x69, 0x2f, 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, 0x65, 0x5a, 0x45, 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, 0x73, 0x64,
0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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, 0x08, 0x65, 0x64, 0x69,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_session_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_api_session_grpc_service_proto_goTypes = []any{
(*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_api_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_api_session_grpc_service_proto_init() }
func file_api_session_grpc_service_proto_init() {
if File_api_session_grpc_service_proto != nil {
return
}
file_api_session_grpc_types_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_session_grpc_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_session_grpc_service_proto_goTypes,
DependencyIndexes: file_api_session_grpc_service_proto_depIdxs,
MessageInfos: file_api_session_grpc_service_proto_msgTypes,
}.Build()
File_api_session_grpc_service_proto = out.File
file_api_session_grpc_service_proto_rawDesc = nil
file_api_session_grpc_service_proto_goTypes = nil
file_api_session_grpc_service_proto_depIdxs = nil
}

View file

@ -1,866 +0,0 @@
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
package session
import (
json "encoding/json"
fmt "fmt"
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
pool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/pool"
proto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto"
encoding "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/util/proto/encoding"
easyproto "github.com/VictoriaMetrics/easyproto"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
strconv "strconv"
)
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.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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerId\":"
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"expiration\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Expiration, 10)
out.RawByte('"')
}
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
r := in.JsonNumber()
n := r.String()
v, err := strconv.ParseUint(n, 10, 64)
if err != nil {
in.AddError(err)
return
}
pv := uint64(v)
f = pv
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.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil {
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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"id\":"
out.RawString(prefix)
if x.Id != nil {
out.Base64Bytes(x.Id)
} else {
out.String("")
}
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"sessionKey\":"
out.RawString(prefix)
if x.SessionKey != nil {
out.Base64Bytes(x.SessionKey)
} else {
out.String("")
}
}
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
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
x.Id = f
}
case "sessionKey":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
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.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil {
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
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
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()
}
}

View file

@ -1,45 +0,0 @@
//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
}

View file

@ -1,31 +0,0 @@
//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)
})
}

View file

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v5.27.2
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.2
// source: api/session/grpc/service.proto
package session
@ -15,8 +15,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
SessionService_Create_FullMethodName = "/neo.fs.v2.session.SessionService/Create"
@ -25,6 +25,11 @@ const (
// SessionServiceClient is the client API for SessionService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// `SessionService` allows to establish a temporary trust relationship between
// two peer nodes and generate a `SessionToken` as the proof of trust to be
// attached in requests for further verification. Please see corresponding
// section of FrostFS Technical Specification for details.
type SessionServiceClient interface {
// Open a new session between two peers.
//
@ -44,8 +49,9 @@ func NewSessionServiceClient(cc grpc.ClientConnInterface) SessionServiceClient {
}
func (c *sessionServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateResponse)
err := c.cc.Invoke(ctx, SessionService_Create_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, SessionService_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@ -54,7 +60,12 @@ func (c *sessionServiceClient) Create(ctx context.Context, in *CreateRequest, op
// SessionServiceServer is the server API for SessionService service.
// All implementations should embed UnimplementedSessionServiceServer
// for forward compatibility
// for forward compatibility.
//
// `SessionService` allows to establish a temporary trust relationship between
// two peer nodes and generate a `SessionToken` as the proof of trust to be
// attached in requests for further verification. Please see corresponding
// section of FrostFS Technical Specification for details.
type SessionServiceServer interface {
// Open a new session between two peers.
//
@ -65,13 +76,17 @@ type SessionServiceServer interface {
Create(context.Context, *CreateRequest) (*CreateResponse, error)
}
// UnimplementedSessionServiceServer should be embedded to have forward compatible implementations.
type UnimplementedSessionServiceServer struct {
}
// UnimplementedSessionServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedSessionServiceServer struct{}
func (UnimplementedSessionServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedSessionServiceServer) testEmbeddedByValue() {}
// UnsafeSessionServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SessionServiceServer will
@ -81,6 +96,13 @@ type UnsafeSessionServiceServer interface {
}
func RegisterSessionServiceServer(s grpc.ServiceRegistrar, srv SessionServiceServer) {
// If the following call pancis, it indicates UnimplementedSessionServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&SessionService_ServiceDesc, srv)
}

609
api/session/grpc/service_protoopaque.pb.go generated Normal file
View file

@ -0,0 +1,609 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/session/grpc/service.proto
//go:build protoopaque
package session
import (
grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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 `protogen:"opaque.v1"`
xxx_hidden_Body *CreateRequest_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"`
xxx_hidden_MetaHeader *RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"`
xxx_hidden_VerifyHeader *RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateRequest) Reset() {
*x = CreateRequest{}
mi := &file_api_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_api_session_grpc_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *CreateRequest) GetBody() *CreateRequest_Body {
if x != nil {
return x.xxx_hidden_Body
}
return nil
}
func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader {
if x != nil {
return x.xxx_hidden_MetaHeader
}
return nil
}
func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader {
if x != nil {
return x.xxx_hidden_VerifyHeader
}
return nil
}
func (x *CreateRequest) SetBody(v *CreateRequest_Body) {
x.xxx_hidden_Body = v
}
func (x *CreateRequest) SetMetaHeader(v *RequestMetaHeader) {
x.xxx_hidden_MetaHeader = v
}
func (x *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) {
x.xxx_hidden_VerifyHeader = v
}
func (x *CreateRequest) HasBody() bool {
if x == nil {
return false
}
return x.xxx_hidden_Body != nil
}
func (x *CreateRequest) HasMetaHeader() bool {
if x == nil {
return false
}
return x.xxx_hidden_MetaHeader != nil
}
func (x *CreateRequest) HasVerifyHeader() bool {
if x == nil {
return false
}
return x.xxx_hidden_VerifyHeader != nil
}
func (x *CreateRequest) ClearBody() {
x.xxx_hidden_Body = nil
}
func (x *CreateRequest) ClearMetaHeader() {
x.xxx_hidden_MetaHeader = nil
}
func (x *CreateRequest) ClearVerifyHeader() {
x.xxx_hidden_VerifyHeader = nil
}
type CreateRequest_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Body of a create session token request message.
Body *CreateRequest_Body
// Carries request meta information. Header data is used only to regulate
// message transport and does not affect request execution.
MetaHeader *RequestMetaHeader
// Carries request verification information. This header is used to
// authenticate the nodes of the message route and check the correctness of
// transmission.
VerifyHeader *RequestVerificationHeader
}
func (b0 CreateRequest_builder) Build() *CreateRequest {
m0 := &CreateRequest{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Body = b.Body
x.xxx_hidden_MetaHeader = b.MetaHeader
x.xxx_hidden_VerifyHeader = b.VerifyHeader
return m0
}
// Information about the opened session.
type CreateResponse struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Body *CreateResponse_Body `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"`
xxx_hidden_MetaHeader *ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader" json:"meta_header,omitempty"`
xxx_hidden_VerifyHeader *ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader" json:"verify_header,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateResponse) Reset() {
*x = CreateResponse{}
mi := &file_api_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_api_session_grpc_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *CreateResponse) GetBody() *CreateResponse_Body {
if x != nil {
return x.xxx_hidden_Body
}
return nil
}
func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader {
if x != nil {
return x.xxx_hidden_MetaHeader
}
return nil
}
func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader {
if x != nil {
return x.xxx_hidden_VerifyHeader
}
return nil
}
func (x *CreateResponse) SetBody(v *CreateResponse_Body) {
x.xxx_hidden_Body = v
}
func (x *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) {
x.xxx_hidden_MetaHeader = v
}
func (x *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) {
x.xxx_hidden_VerifyHeader = v
}
func (x *CreateResponse) HasBody() bool {
if x == nil {
return false
}
return x.xxx_hidden_Body != nil
}
func (x *CreateResponse) HasMetaHeader() bool {
if x == nil {
return false
}
return x.xxx_hidden_MetaHeader != nil
}
func (x *CreateResponse) HasVerifyHeader() bool {
if x == nil {
return false
}
return x.xxx_hidden_VerifyHeader != nil
}
func (x *CreateResponse) ClearBody() {
x.xxx_hidden_Body = nil
}
func (x *CreateResponse) ClearMetaHeader() {
x.xxx_hidden_MetaHeader = nil
}
func (x *CreateResponse) ClearVerifyHeader() {
x.xxx_hidden_VerifyHeader = nil
}
type CreateResponse_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Body of create session token response message.
Body *CreateResponse_Body
// Carries response meta information. Header data is used only to regulate
// message transport and does not affect request execution.
MetaHeader *ResponseMetaHeader
// Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness of
// transmission.
VerifyHeader *ResponseVerificationHeader
}
func (b0 CreateResponse_builder) Build() *CreateResponse {
m0 := &CreateResponse{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Body = b.Body
x.xxx_hidden_MetaHeader = b.MetaHeader
x.xxx_hidden_VerifyHeader = b.VerifyHeader
return m0
}
// Session creation request body
type CreateRequest_Body struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_OwnerId *grpc.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId" json:"owner_id,omitempty"`
xxx_hidden_Expiration uint64 `protobuf:"varint,2,opt,name=expiration" json:"expiration,omitempty"`
XXX_raceDetectHookData protoimpl.RaceDetectHookData
XXX_presence [1]uint32
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateRequest_Body) Reset() {
*x = CreateRequest_Body{}
mi := &file_api_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_api_session_grpc_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID {
if x != nil {
return x.xxx_hidden_OwnerId
}
return nil
}
func (x *CreateRequest_Body) GetExpiration() uint64 {
if x != nil {
return x.xxx_hidden_Expiration
}
return 0
}
func (x *CreateRequest_Body) SetOwnerId(v *grpc.OwnerID) {
x.xxx_hidden_OwnerId = v
}
func (x *CreateRequest_Body) SetExpiration(v uint64) {
x.xxx_hidden_Expiration = v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2)
}
func (x *CreateRequest_Body) HasOwnerId() bool {
if x == nil {
return false
}
return x.xxx_hidden_OwnerId != nil
}
func (x *CreateRequest_Body) HasExpiration() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 1)
}
func (x *CreateRequest_Body) ClearOwnerId() {
x.xxx_hidden_OwnerId = nil
}
func (x *CreateRequest_Body) ClearExpiration() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)
x.xxx_hidden_Expiration = 0
}
type CreateRequest_Body_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Session initiating user's or node's key derived `OwnerID`
OwnerId *grpc.OwnerID
// Session expiration `Epoch`
Expiration *uint64
}
func (b0 CreateRequest_Body_builder) Build() *CreateRequest_Body {
m0 := &CreateRequest_Body{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_OwnerId = b.OwnerId
if b.Expiration != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2)
x.xxx_hidden_Expiration = *b.Expiration
}
return m0
}
// Session creation response body
type CreateResponse_Body struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
xxx_hidden_SessionKey []byte `protobuf:"bytes,2,opt,name=session_key,json=sessionKey" json:"session_key,omitempty"`
XXX_raceDetectHookData protoimpl.RaceDetectHookData
XXX_presence [1]uint32
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateResponse_Body) Reset() {
*x = CreateResponse_Body{}
mi := &file_api_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_api_session_grpc_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *CreateResponse_Body) GetId() []byte {
if x != nil {
return x.xxx_hidden_Id
}
return nil
}
func (x *CreateResponse_Body) GetSessionKey() []byte {
if x != nil {
return x.xxx_hidden_SessionKey
}
return nil
}
func (x *CreateResponse_Body) SetId(v []byte) {
if v == nil {
v = []byte{}
}
x.xxx_hidden_Id = v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2)
}
func (x *CreateResponse_Body) SetSessionKey(v []byte) {
if v == nil {
v = []byte{}
}
x.xxx_hidden_SessionKey = v
protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2)
}
func (x *CreateResponse_Body) HasId() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 0)
}
func (x *CreateResponse_Body) HasSessionKey() bool {
if x == nil {
return false
}
return protoimpl.X.Present(&(x.XXX_presence[0]), 1)
}
func (x *CreateResponse_Body) ClearId() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)
x.xxx_hidden_Id = nil
}
func (x *CreateResponse_Body) ClearSessionKey() {
protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)
x.xxx_hidden_SessionKey = nil
}
type CreateResponse_Body_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Identifier of a newly created session
Id []byte
// Public key used for session
SessionKey []byte
}
func (b0 CreateResponse_Body_builder) Build() *CreateResponse_Body {
m0 := &CreateResponse_Body{}
b, x := &b0, m0
_, _ = b, x
if b.Id != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2)
x.xxx_hidden_Id = b.Id
}
if b.SessionKey != nil {
protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2)
x.xxx_hidden_SessionKey = b.SessionKey
}
return m0
}
var File_api_session_grpc_service_proto protoreflect.FileDescriptor
var file_api_session_grpc_service_proto_rawDesc = []byte{
0x0a, 0x1e, 0x61, 0x70, 0x69, 0x2f, 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, 0x19, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72,
0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c,
0x61, 0x70, 0x69, 0x2f, 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, 0x65, 0x5a, 0x45, 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, 0x73, 0x64,
0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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, 0x08, 0x65, 0x64, 0x69,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_session_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_api_session_grpc_service_proto_goTypes = []any{
(*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_api_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_api_session_grpc_service_proto_init() }
func file_api_session_grpc_service_proto_init() {
if File_api_session_grpc_service_proto != nil {
return
}
file_api_session_grpc_types_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_session_grpc_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_session_grpc_service_proto_goTypes,
DependencyIndexes: file_api_session_grpc_service_proto_depIdxs,
MessageInfos: file_api_session_grpc_service_proto_msgTypes,
}.Build()
File_api_session_grpc_service_proto = out.File
file_api_session_grpc_service_proto_rawDesc = nil
file_api_session_grpc_service_proto_goTypes = nil
file_api_session_grpc_service_proto_depIdxs = nil
}

2145
api/session/grpc/types.pb.go generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,159 +0,0 @@
//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
}

View file

@ -1,91 +0,0 @@
//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)
})
}

2187
api/session/grpc/types_protoopaque.pb.go generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -14,12 +14,10 @@ func (x ObjectSessionVerb) String() string {
//
// Returns true if s was parsed successfully.
func (x *ObjectSessionVerb) FromString(s string) bool {
var g session.ObjectSessionContext_Verb
ok := g.FromString(s)
g, ok := session.ObjectSessionContext_Verb_value[s]
if ok {
*x = ObjectSessionVerbFromGRPCField(g)
*x = ObjectSessionVerbFromGRPCField(session.ObjectSessionContext_Verb(g))
}
return ok
@ -35,12 +33,10 @@ func (x ContainerSessionVerb) String() string {
//
// Returns true if s was parsed successfully.
func (x *ContainerSessionVerb) FromString(s string) bool {
var g session.ContainerSessionContext_Verb
ok := g.FromString(s)
g, ok := session.ContainerSessionContext_Verb_value[s]
if ok {
*x = ContainerSessionVerbFromGRPCField(g)
*x = ContainerSessionVerbFromGRPCField(session.ContainerSessionContext_Verb(g))
}
return ok

View file

@ -48,13 +48,13 @@ func (x *Status) ToGRPCMessage() grpc.Message {
m.SetCode(CodeToGRPC(x.code))
m.SetMessage(x.msg)
var ds []status.Status_Detail
var ds []*status.Status_Detail
if ln := len(x.details); ln > 0 {
ds = make([]status.Status_Detail, 0, ln)
ds = make([]*status.Status_Detail, 0, ln)
for i := range ln {
ds = append(ds, *x.details[i].ToGRPCMessage().(*status.Status_Detail))
ds = append(ds, x.details[i].ToGRPCMessage().(*status.Status_Detail))
}
}
@ -81,7 +81,7 @@ func (x *Status) FromGRPCMessage(m grpc.Message) error {
ds = make([]Detail, ln)
for i := range ln {
if err := ds[i].FromGRPCMessage(&dsV2[i]); err != nil {
if err := ds[i].FromGRPCMessage(dsV2[i]); err != nil {
return err
}
}

742
api/status/grpc/types.pb.go generated Normal file
View file

@ -0,0 +1,742 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.2
// source: api/status/grpc/types.proto
//go:build !protoopaque
package status
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
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_api_status_grpc_types_proto_enumTypes[0].Descriptor()
}
func (Section) Type() protoreflect.EnumType {
return &file_api_status_grpc_types_proto_enumTypes[0]
}
func (x Section) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Section of FrostFS 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_api_status_grpc_types_proto_enumTypes[1].Descriptor()
}
func (Success) Type() protoreflect.EnumType {
return &file_api_status_grpc_types_proto_enumTypes[1]
}
func (x Success) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// 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 FrostFS network.
// Details:
// - [**0**] Magic number of the served FrostFS 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_api_status_grpc_types_proto_enumTypes[2].Descriptor()
}
func (CommonFail) Type() protoreflect.EnumType {
return &file_api_status_grpc_types_proto_enumTypes[2]
}
func (x CommonFail) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// 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_api_status_grpc_types_proto_enumTypes[3].Descriptor()
}
func (Object) Type() protoreflect.EnumType {
return &file_api_status_grpc_types_proto_enumTypes[3]
}
func (x Object) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// 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_api_status_grpc_types_proto_enumTypes[4].Descriptor()
}
func (Container) Type() protoreflect.EnumType {
return &file_api_status_grpc_types_proto_enumTypes[4]
}
func (x Container) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// 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_api_status_grpc_types_proto_enumTypes[5].Descriptor()
}
func (Session) Type() protoreflect.EnumType {
return &file_api_status_grpc_types_proto_enumTypes[5]
}
func (x Session) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// 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_api_status_grpc_types_proto_enumTypes[6].Descriptor()
}
func (APEManager) Type() protoreflect.EnumType {
return &file_api_status_grpc_types_proto_enumTypes[6]
}
func (x APEManager) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Declares the general format of the status returns of the FrostFS RPC
// protocol. Status is present in all response messages. Each RPC of FrostFS
// 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 FrostFS 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 `protogen:"hybrid.v1"`
// The status code
Code *uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
// Developer-facing error message
Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
// Data detailing the outcome of the operation. Must be unique by ID.
Details []*Status_Detail `protobuf:"bytes,3,rep,name=details" json:"details,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Status) Reset() {
*x = Status{}
mi := &file_api_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_api_status_grpc_types_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Status) GetCode() uint32 {
if x != nil && x.Code != nil {
return *x.Code
}
return 0
}
func (x *Status) GetMessage() string {
if x != nil && x.Message != nil {
return *x.Message
}
return ""
}
func (x *Status) GetDetails() []*Status_Detail {
if x != nil {
return x.Details
}
return nil
}
func (x *Status) SetCode(v uint32) {
x.Code = &v
}
func (x *Status) SetMessage(v string) {
x.Message = &v
}
func (x *Status) SetDetails(v []*Status_Detail) {
x.Details = v
}
func (x *Status) HasCode() bool {
if x == nil {
return false
}
return x.Code != nil
}
func (x *Status) HasMessage() bool {
if x == nil {
return false
}
return x.Message != nil
}
func (x *Status) ClearCode() {
x.Code = nil
}
func (x *Status) ClearMessage() {
x.Message = nil
}
type Status_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The status code
Code *uint32
// Developer-facing error message
Message *string
// Data detailing the outcome of the operation. Must be unique by ID.
Details []*Status_Detail
}
func (b0 Status_builder) Build() *Status {
m0 := &Status{}
b, x := &b0, m0
_, _ = b, x
x.Code = b.Code
x.Message = b.Message
x.Details = b.Details
return m0
}
// 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 `protogen:"hybrid.v1"`
// 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" 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" json:"value,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Status_Detail) Reset() {
*x = Status_Detail{}
mi := &file_api_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_api_status_grpc_types_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Status_Detail) GetId() uint32 {
if x != nil && x.Id != nil {
return *x.Id
}
return 0
}
func (x *Status_Detail) GetValue() []byte {
if x != nil {
return x.Value
}
return nil
}
func (x *Status_Detail) SetId(v uint32) {
x.Id = &v
}
func (x *Status_Detail) SetValue(v []byte) {
if v == nil {
v = []byte{}
}
x.Value = v
}
func (x *Status_Detail) HasId() bool {
if x == nil {
return false
}
return x.Id != nil
}
func (x *Status_Detail) HasValue() bool {
if x == nil {
return false
}
return x.Value != nil
}
func (x *Status_Detail) ClearId() {
x.Id = nil
}
func (x *Status_Detail) ClearValue() {
x.Value = nil
}
type Status_Detail_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Detail ID. The identifier is required to determine the binary format
// of the detail and how to decode it.
Id *uint32
// Binary status detail. Must follow the format associated with ID.
// The possibility of missing a value must be explicitly allowed.
Value []byte
}
func (b0 Status_Detail_builder) Build() *Status_Detail {
m0 := &Status_Detail{}
b, x := &b0, m0
_, _ = b, x
x.Id = b.Id
x.Value = b.Value
return m0
}
var File_api_status_grpc_types_proto protoreflect.FileDescriptor
var file_api_status_grpc_types_proto_rawDesc = []byte{
0x0a, 0x1b, 0x61, 0x70, 0x69, 0x2f, 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, 0x62, 0x5a, 0x43, 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,
0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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, 0x08, 0x65, 0x64, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x70, 0xe8, 0x07,
}
var file_api_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 7)
var file_api_status_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_api_status_grpc_types_proto_goTypes = []any{
(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_api_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_api_status_grpc_types_proto_init() }
func file_api_status_grpc_types_proto_init() {
if File_api_status_grpc_types_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_status_grpc_types_proto_rawDesc,
NumEnums: 7,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_api_status_grpc_types_proto_goTypes,
DependencyIndexes: file_api_status_grpc_types_proto_depIdxs,
EnumInfos: file_api_status_grpc_types_proto_enumTypes,
MessageInfos: file_api_status_grpc_types_proto_msgTypes,
}.Build()
File_api_status_grpc_types_proto = out.File
file_api_status_grpc_types_proto_rawDesc = nil
file_api_status_grpc_types_proto_goTypes = nil
file_api_status_grpc_types_proto_depIdxs = nil
}

Some files were not shown because too many files have changed in this diff Show more