From 196241c4e79a823249282a3ee42b4b87a4ab7aa9 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 28 Feb 2023 16:20:59 +0300 Subject: [PATCH 001/169] [TrueCloudLab#5] .github: Fix CODEOWNERS Signed-off-by: Evgenii Stratonikov --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..b3c6cfa --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @TrueCloudLab/storage-core @TrueCloudLab/storage-services @TrueCloudLab/committers From f69d2ad83c517f13d26ca3cb96bbb115601c675a Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 7 Mar 2023 13:38:56 +0300 Subject: [PATCH 002/169] Rename package name Due to source code relocation from GitHub. Signed-off-by: Alex Vanin --- accounting/accounting.go | 4 +- accounting/convert.go | 10 +- accounting/grpc/service.go | 4 +- accounting/grpc/service.pb.go | 20 +- accounting/grpc/types.pb.go | 16 +- accounting/json.go | 4 +- accounting/marshal.go | 6 +- accounting/message_test.go | 6 +- accounting/test/generate.go | 6 +- acl/bench_test.go | 6 +- acl/convert.go | 10 +- acl/grpc/types.go | 2 +- acl/grpc/types.pb.go | 16 +- acl/json.go | 4 +- acl/marshal.go | 6 +- acl/message_test.go | 6 +- acl/string.go | 2 +- acl/test/generate.go | 4 +- acl/types.go | 2 +- audit/convert.go | 10 +- audit/grpc/types.go | 2 +- audit/grpc/types.pb.go | 16 +- audit/json.go | 4 +- audit/marshal.go | 8 +- audit/message_test.go | 6 +- audit/test/generate.go | 4 +- audit/types.go | 2 +- container/attributes_test.go | 4 +- container/convert.go | 22 +- container/grpc/service.go | 6 +- container/grpc/service.pb.go | 22 +- container/grpc/service_grpc.pb.go | 108 +++--- container/grpc/types.go | 4 +- container/grpc/types.pb.go | 20 +- container/json.go | 4 +- container/marshal.go | 6 +- container/message_test.go | 6 +- container/status.go | 4 +- container/status_test.go | 4 +- container/test/generate.go | 10 +- container/types.go | 8 +- go.mod | 6 +- go.sum | 8 +- lock/grpc/types.go | 2 +- lock/grpc/types.pb.go | 16 +- netmap/attributes.go | 2 +- netmap/attributes_test.go | 6 +- netmap/convert.go | 10 +- netmap/grpc/service.go | 4 +- netmap/grpc/service.pb.go | 20 +- netmap/grpc/types.go | 2 +- netmap/grpc/types.pb.go | 16 +- netmap/json.go | 4 +- netmap/marshal.go | 6 +- netmap/message_test.go | 6 +- netmap/string.go | 2 +- netmap/test/generate.go | 6 +- netmap/types.go | 4 +- object/convert.go | 14 +- object/grpc/service.go | 4 +- object/grpc/service.pb.go | 19 +- object/grpc/service_grpc.pb.go | 490 ++++++++++++++------------- object/grpc/status.pb.go | 2 +- object/grpc/types.go | 4 +- object/grpc/types.pb.go | 18 +- object/json.go | 4 +- object/lock.go | 12 +- object/lock_test.go | 4 +- object/marshal.go | 8 +- object/message_test.go | 6 +- object/status.go | 4 +- object/status_test.go | 6 +- object/string.go | 2 +- object/test/generate.go | 10 +- object/types.go | 4 +- refs/convert.go | 6 +- refs/grpc/types.pb.go | 14 +- refs/json.go | 4 +- refs/marshal.go | 6 +- refs/message_test.go | 6 +- refs/string.go | 2 +- refs/test/generate.go | 2 +- refs/types_test.go | 2 +- reputation/convert.go | 10 +- reputation/grpc/service.go | 2 +- reputation/grpc/service.pb.go | 18 +- reputation/grpc/types.go | 2 +- reputation/grpc/types.pb.go | 18 +- reputation/json.go | 4 +- reputation/marshal.go | 6 +- reputation/message_test.go | 6 +- reputation/test/generate.go | 6 +- reputation/types.go | 4 +- rpc/accounting.go | 6 +- rpc/client/flows.go | 4 +- rpc/client/init.go | 4 +- rpc/client/stream_wrapper.go | 2 +- rpc/client/util.go | 2 +- rpc/common/call_test.go | 2 +- rpc/container.go | 6 +- rpc/message/encoding.go | 2 +- rpc/message/message.go | 2 +- rpc/message/test/message.go | 2 +- rpc/netmap.go | 6 +- rpc/object.go | 8 +- rpc/reputation.go | 6 +- rpc/session.go | 6 +- session/convert.go | 18 +- session/grpc/service.go | 2 +- session/grpc/service.pb.go | 17 +- session/grpc/types.go | 6 +- session/grpc/types.pb.go | 21 +- session/json.go | 4 +- session/marshal.go | 6 +- session/message_test.go | 6 +- session/status.go | 4 +- session/status_test.go | 4 +- session/string.go | 2 +- session/test/generate.go | 10 +- session/types.go | 8 +- session/util.go | 2 +- signature/sign.go | 16 +- signature/sign_test.go | 6 +- status/convert.go | 6 +- status/grpc/types.pb.go | 15 +- status/marshal.go | 6 +- status/message_test.go | 6 +- status/test/codes.go | 2 +- status/test/generate.go | 2 +- storagegroup/convert.go | 10 +- storagegroup/grpc/types.go | 2 +- storagegroup/grpc/types.pb.go | 19 +- storagegroup/json.go | 4 +- storagegroup/marshal.go | 8 +- storagegroup/message_test.go | 6 +- storagegroup/test/generate.go | 4 +- storagegroup/types.go | 2 +- subnet/encoding_test.go | 6 +- subnet/grpc/types.go | 2 +- subnet/grpc/types.pb.go | 17 +- subnet/info.go | 12 +- subnet/test/generate.go | 4 +- tombstone/convert.go | 8 +- tombstone/grpc/types.go | 2 +- tombstone/grpc/types.pb.go | 17 +- tombstone/json.go | 4 +- tombstone/marshal.go | 6 +- tombstone/message_test.go | 6 +- tombstone/test/generate.go | 4 +- tombstone/types.go | 2 +- util/proto/marshal_test.go | 4 +- util/protogen/main.go | 2 +- util/signature/data.go | 4 +- util/signature/options.go | 6 +- util/signature/sign_test.go | 2 +- util/signature/walletconnect/sign.go | 2 +- 156 files changed, 832 insertions(+), 823 deletions(-) diff --git a/accounting/accounting.go b/accounting/accounting.go index 25d6199..af14a1a 100644 --- a/accounting/accounting.go +++ b/accounting/accounting.go @@ -1,8 +1,8 @@ package accounting import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" ) type BalanceRequestBody struct { diff --git a/accounting/convert.go b/accounting/convert.go index d37fd1e..7a7f250 100644 --- a/accounting/convert.go +++ b/accounting/convert.go @@ -1,11 +1,11 @@ package accounting import ( - accounting "github.com/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + accounting "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (b *BalanceRequestBody) ToGRPCMessage() grpc.Message { diff --git a/accounting/grpc/service.go b/accounting/grpc/service.go index 0570cd3..fa292bf 100644 --- a/accounting/grpc/service.go +++ b/accounting/grpc/service.go @@ -1,8 +1,8 @@ package accounting import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) // SetOwnerId sets identifier of the account owner. diff --git a/accounting/grpc/service.pb.go b/accounting/grpc/service.pb.go index d0783f2..196c7ab 100644 --- a/accounting/grpc/service.pb.go +++ b/accounting/grpc/service.pb.go @@ -7,8 +7,8 @@ package accounting import ( - grpc1 "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -320,14 +320,14 @@ var file_accounting_grpc_service_proto_rawDesc = []byte{ 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, 0x67, 0x5a, 0x44, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, - 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, - 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, - 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, - 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, + 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/accounting/grpc/types.pb.go b/accounting/grpc/types.pb.go index 89a8c76..322a56c 100644 --- a/accounting/grpc/types.pb.go +++ b/accounting/grpc/types.pb.go @@ -95,14 +95,14 @@ var file_accounting_grpc_types_proto_rawDesc = []byte{ 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, 0x67, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, + 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, + 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/accounting/json.go b/accounting/json.go index b0738f6..9ed5620 100644 --- a/accounting/json.go +++ b/accounting/json.go @@ -1,8 +1,8 @@ package accounting import ( - accounting "github.com/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + accounting "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (d *Decimal) MarshalJSON() ([]byte, error) { diff --git a/accounting/marshal.go b/accounting/marshal.go index 06a1299..6961b3e 100644 --- a/accounting/marshal.go +++ b/accounting/marshal.go @@ -1,9 +1,9 @@ package accounting import ( - accounting "github.com/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - protoutil "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + accounting "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/accounting/message_test.go b/accounting/message_test.go index cdbac36..d193558 100644 --- a/accounting/message_test.go +++ b/accounting/message_test.go @@ -3,9 +3,9 @@ package accounting_test import ( "testing" - accountingtest "github.com/TrueCloudLab/frostfs-api-go/v2/accounting/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + accountingtest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" ) func TestMessage(t *testing.T) { diff --git a/accounting/test/generate.go b/accounting/test/generate.go index 171693d..1eaf9f4 100644 --- a/accounting/test/generate.go +++ b/accounting/test/generate.go @@ -1,9 +1,9 @@ package accountingtest import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/accounting" - accountingtest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" - sessiontest "github.com/TrueCloudLab/frostfs-api-go/v2/session/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + accountingtest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/test" ) func GenerateBalanceRequest(empty bool) *accounting.BalanceRequest { diff --git a/acl/bench_test.go b/acl/bench_test.go index 0196176..8d6352b 100644 --- a/acl/bench_test.go +++ b/acl/bench_test.go @@ -3,9 +3,9 @@ package acl_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/acl" - aclGrpc "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - acltest "github.com/TrueCloudLab/frostfs-api-go/v2/acl/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + aclGrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + acltest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/test" ) func BenchmarkTable_ToGRPCMessage(b *testing.B) { diff --git a/acl/convert.go b/acl/convert.go index 697f699..d42aebd 100644 --- a/acl/convert.go +++ b/acl/convert.go @@ -1,11 +1,11 @@ package acl import ( - acl "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) // RoleToGRPCField converts unified role enum into grpc enum. diff --git a/acl/grpc/types.go b/acl/grpc/types.go index 436ae58..e1e5336 100644 --- a/acl/grpc/types.go +++ b/acl/grpc/types.go @@ -1,7 +1,7 @@ package acl import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) // SetVersion sets version of EACL rules in table. diff --git a/acl/grpc/types.pb.go b/acl/grpc/types.pb.go index 6e9ac46..3581b88 100644 --- a/acl/grpc/types.pb.go +++ b/acl/grpc/types.pb.go @@ -7,7 +7,7 @@ package acl import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -932,13 +932,13 @@ var file_acl_grpc_types_proto_rawDesc = []byte{ 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, - 0x49, 0x43, 0x45, 0x10, 0x03, 0x42, 0x52, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, - 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, - 0x76, 0x32, 0x2f, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x6c, 0xaa, - 0x02, 0x17, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x49, 0x43, 0x45, 0x10, 0x03, 0x42, 0x58, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, + 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, + 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, + 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x3b, 0x61, 0x63, 0x6c, 0xaa, 0x02, 0x17, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x6c, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/acl/json.go b/acl/json.go index 7a50e90..0e2078b 100644 --- a/acl/json.go +++ b/acl/json.go @@ -1,8 +1,8 @@ package acl import ( - acl "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (f *HeaderFilter) MarshalJSON() ([]byte, error) { diff --git a/acl/marshal.go b/acl/marshal.go index 1ecdb70..c56b90f 100644 --- a/acl/marshal.go +++ b/acl/marshal.go @@ -1,9 +1,9 @@ package acl import ( - acl "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - protoutil "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/acl/message_test.go b/acl/message_test.go index d3e70cf..8f340f1 100644 --- a/acl/message_test.go +++ b/acl/message_test.go @@ -3,9 +3,9 @@ package acl_test import ( "testing" - acltest "github.com/TrueCloudLab/frostfs-api-go/v2/acl/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + acltest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" ) func TestMessageConvert(t *testing.T) { diff --git a/acl/string.go b/acl/string.go index 76c0345..6dab037 100644 --- a/acl/string.go +++ b/acl/string.go @@ -1,7 +1,7 @@ package acl import ( - acl "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" ) // String returns string representation of Action. diff --git a/acl/test/generate.go b/acl/test/generate.go index 67098cf..3151c52 100644 --- a/acl/test/generate.go +++ b/acl/test/generate.go @@ -1,8 +1,8 @@ package acltest import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/acl" - accountingtest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + accountingtest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" ) func GenerateBearerToken(empty bool) *acl.BearerToken { diff --git a/acl/types.go b/acl/types.go index f360af6..71d83ce 100644 --- a/acl/types.go +++ b/acl/types.go @@ -1,6 +1,6 @@ package acl -import "github.com/TrueCloudLab/frostfs-api-go/v2/refs" +import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" // HeaderFilter is a unified structure of FilterInfo // message from proto definition. diff --git a/audit/convert.go b/audit/convert.go index 23a5ce6..a841928 100644 --- a/audit/convert.go +++ b/audit/convert.go @@ -1,11 +1,11 @@ package audit import ( - audit "github.com/TrueCloudLab/frostfs-api-go/v2/audit/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + audit "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (a *DataAuditResult) ToGRPCMessage() grpc.Message { diff --git a/audit/grpc/types.go b/audit/grpc/types.go index 206fc88..59bb184 100644 --- a/audit/grpc/types.go +++ b/audit/grpc/types.go @@ -1,7 +1,7 @@ package audit import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) // SetVersion is a Version field setter. diff --git a/audit/grpc/types.pb.go b/audit/grpc/types.pb.go index ceb0955..b542ec2 100644 --- a/audit/grpc/types.pb.go +++ b/audit/grpc/types.pb.go @@ -7,7 +7,7 @@ package audit import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -231,13 +231,13 @@ var file_audit_grpc_types_proto_rawDesc = []byte{ 0x73, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x61, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x66, 0x61, - 0x69, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x58, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, - 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, - 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, - 0x61, 0x75, 0x64, 0x69, 0x74, 0xaa, 0x02, 0x19, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x75, 0x64, 0x69, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x5e, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, + 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x75, 0x64, 0x69, 0x74, 0xaa, 0x02, 0x19, 0x4e, 0x65, + 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, + 0x49, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/audit/json.go b/audit/json.go index 550977c..cbcf41f 100644 --- a/audit/json.go +++ b/audit/json.go @@ -1,8 +1,8 @@ package audit import ( - audit "github.com/TrueCloudLab/frostfs-api-go/v2/audit/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + audit "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (a *DataAuditResult) MarshalJSON() ([]byte, error) { diff --git a/audit/marshal.go b/audit/marshal.go index 1560b21..a039baf 100644 --- a/audit/marshal.go +++ b/audit/marshal.go @@ -1,10 +1,10 @@ package audit import ( - audit "github.com/TrueCloudLab/frostfs-api-go/v2/audit/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + audit "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/audit/message_test.go b/audit/message_test.go index efbbca7..02c7f78 100644 --- a/audit/message_test.go +++ b/audit/message_test.go @@ -3,9 +3,9 @@ package audit_test import ( "testing" - audittest "github.com/TrueCloudLab/frostfs-api-go/v2/audit/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + audittest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" ) func TestMessageConvert(t *testing.T) { diff --git a/audit/test/generate.go b/audit/test/generate.go index 44c6d14..093cbfe 100644 --- a/audit/test/generate.go +++ b/audit/test/generate.go @@ -1,8 +1,8 @@ package audittest import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/audit" - refstest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" ) func GenerateDataAuditResult(empty bool) *audit.DataAuditResult { diff --git a/audit/types.go b/audit/types.go index 14a0025..6f856f0 100644 --- a/audit/types.go +++ b/audit/types.go @@ -1,7 +1,7 @@ package audit import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" ) // DataAuditResult is a unified structure of diff --git a/container/attributes_test.go b/container/attributes_test.go index aa34b2a..fc5678c 100644 --- a/container/attributes_test.go +++ b/container/attributes_test.go @@ -3,8 +3,8 @@ package container_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/container" - containertest "github.com/TrueCloudLab/frostfs-api-go/v2/container/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + containertest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/test" "github.com/stretchr/testify/require" ) diff --git a/container/convert.go b/container/convert.go index 8e35efa..0753755 100644 --- a/container/convert.go +++ b/container/convert.go @@ -1,17 +1,17 @@ package container import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/acl" - aclGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - container "github.com/TrueCloudLab/frostfs-api-go/v2/container/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/netmap" - netmapGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" - sessionGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + aclGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + netmapGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) func (a *Attribute) ToGRPCMessage() grpc.Message { diff --git a/container/grpc/service.go b/container/grpc/service.go index ca5c4d9..050cf0b 100644 --- a/container/grpc/service.go +++ b/container/grpc/service.go @@ -1,9 +1,9 @@ package container import ( - acl "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) // SetContainer sets container of the request. diff --git a/container/grpc/service.pb.go b/container/grpc/service.pb.go index ed607e2..6786337 100644 --- a/container/grpc/service.pb.go +++ b/container/grpc/service.pb.go @@ -7,9 +7,9 @@ package container import ( - grpc2 "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - grpc1 "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + grpc2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -2160,14 +2160,14 @@ var file_container_grpc_service_proto_rawDesc = []byte{ 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, - 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x64, 0x5a, 0x42, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, - 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, - 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6a, 0x5a, 0x48, 0x67, + 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, + 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, + 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, + 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/container/grpc/service_grpc.pb.go b/container/grpc/service_grpc.pb.go index 1de8b5f..3af498b 100644 --- a/container/grpc/service_grpc.pb.go +++ b/container/grpc/service_grpc.pb.go @@ -28,9 +28,9 @@ type ContainerServiceClient interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -38,53 +38,53 @@ type ContainerServiceClient interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) } @@ -169,9 +169,9 @@ type ContainerServiceServer interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Put(context.Context, *PutRequest) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -179,53 +179,53 @@ type ContainerServiceServer interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. Get(context.Context, *GetRequest) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). List(context.Context, *ListRequest) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error) } diff --git a/container/grpc/types.go b/container/grpc/types.go index 91e9470..7308f9e 100644 --- a/container/grpc/types.go +++ b/container/grpc/types.go @@ -1,8 +1,8 @@ package container import ( - netmap "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) // SetKey sets key to the container attribute. diff --git a/container/grpc/types.pb.go b/container/grpc/types.pb.go index 0b78b3f..75796c2 100644 --- a/container/grpc/types.pb.go +++ b/container/grpc/types.pb.go @@ -7,8 +7,8 @@ package container import ( - grpc1 "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -242,14 +242,14 @@ var file_container_grpc_types_proto_rawDesc = []byte{ 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, 0x64, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, - 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, - 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, - 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, - 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x6a, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, + 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/container/json.go b/container/json.go index ac8bdf3..d9fc4f6 100644 --- a/container/json.go +++ b/container/json.go @@ -1,8 +1,8 @@ package container import ( - container "github.com/TrueCloudLab/frostfs-api-go/v2/container/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (a *Attribute) MarshalJSON() ([]byte, error) { diff --git a/container/marshal.go b/container/marshal.go index a7f77ab..98b32b4 100644 --- a/container/marshal.go +++ b/container/marshal.go @@ -1,9 +1,9 @@ package container import ( - container "github.com/TrueCloudLab/frostfs-api-go/v2/container/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - protoutil "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/container/message_test.go b/container/message_test.go index 62e1914..869ccb2 100644 --- a/container/message_test.go +++ b/container/message_test.go @@ -3,9 +3,9 @@ package container_test import ( "testing" - containertest "github.com/TrueCloudLab/frostfs-api-go/v2/container/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + containertest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" ) func TestMessageConvert(t *testing.T) { diff --git a/container/status.go b/container/status.go index d5aa147..f44fce9 100644 --- a/container/status.go +++ b/container/status.go @@ -1,8 +1,8 @@ package container import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/status" - statusgrpc "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + statusgrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" ) // LocalizeFailStatus checks if passed global status.Code is related to container failure and: diff --git a/container/status_test.go b/container/status_test.go index adbfd2f..57787b1 100644 --- a/container/status_test.go +++ b/container/status_test.go @@ -3,8 +3,8 @@ package container_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/container" - statustest "github.com/TrueCloudLab/frostfs-api-go/v2/status/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + statustest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/test" ) func TestStatusCodes(t *testing.T) { diff --git a/container/test/generate.go b/container/test/generate.go index 82f378a..00a0955 100644 --- a/container/test/generate.go +++ b/container/test/generate.go @@ -1,11 +1,11 @@ package containertest import ( - acltest "github.com/TrueCloudLab/frostfs-api-go/v2/acl/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/container" - netmaptest "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/test" - refstest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" - sessiontest "github.com/TrueCloudLab/frostfs-api-go/v2/session/test" + acltest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + netmaptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/test" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/test" ) func GenerateAttribute(empty bool) *container.Attribute { diff --git a/container/types.go b/container/types.go index fdb35f8..948580d 100644 --- a/container/types.go +++ b/container/types.go @@ -1,10 +1,10 @@ package container import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/acl" - "github.com/TrueCloudLab/frostfs-api-go/v2/netmap" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" ) type Attribute struct { diff --git a/go.mod b/go.mod index 4eddb9e..25445da 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,16 @@ -module github.com/TrueCloudLab/frostfs-api-go/v2 +module git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 go 1.17 require ( - github.com/TrueCloudLab/frostfs-crypto v0.5.0 + git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 github.com/stretchr/testify v1.7.0 google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) require ( - github.com/TrueCloudLab/rfc6979 v0.3.0 // indirect + git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect github.com/davecgh/go-spew v1.1.0 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/mr-tron/base58 v1.2.0 // indirect diff --git a/go.sum b/go.sum index 68f8351..34f4d44 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,10 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= +git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0/go.mod h1:RUIKZATQLJ+TaYQa60X2fTDwfuhMfm8Ar60bQ5fr+vU= +git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9mwVfJ+SjT3HA= +git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/TrueCloudLab/frostfs-crypto v0.5.0 h1:ZoLjixSkQv3j1EwZ1WJzMEJY2NR+9nO4Pd8WSyM/RRI= -github.com/TrueCloudLab/frostfs-crypto v0.5.0/go.mod h1:775MUewpH8AWpXrimAG2NYWOXB6lpKOI5kqgu+eI5zs= -github.com/TrueCloudLab/rfc6979 v0.3.0 h1:0SYMAfQWh/TjnofqYQHy+s3rmQ5gi0fvOaDbqd60/Ic= -github.com/TrueCloudLab/rfc6979 v0.3.0/go.mod h1:qylxFXFQ/sMvpZC/8JyWp+mfzk5Zj/KDT5FAbekhobc= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= diff --git a/lock/grpc/types.go b/lock/grpc/types.go index d39c134..9d5719f 100644 --- a/lock/grpc/types.go +++ b/lock/grpc/types.go @@ -1,6 +1,6 @@ package lock -import refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" +import refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" // SetMembers sets `members` field. func (x *Lock) SetMembers(ids []*refs.ObjectID) { diff --git a/lock/grpc/types.pb.go b/lock/grpc/types.pb.go index 35bef9e..01e263a 100644 --- a/lock/grpc/types.pb.go +++ b/lock/grpc/types.pb.go @@ -7,7 +7,7 @@ package lock import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -84,13 +84,13 @@ var file_lock_grpc_types_proto_rawDesc = []byte{ 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, 0x55, 0x5a, 0x38, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, - 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4c, 0x6f, 0x63, - 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69, + 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, + 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, + 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6c, 0x6f, + 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0xaa, 0x02, 0x18, 0x4e, + 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, + 0x50, 0x49, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/netmap/attributes.go b/netmap/attributes.go index 6901da5..719d882 100644 --- a/netmap/attributes.go +++ b/netmap/attributes.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" ) // prefix of keys to subnet attributes. diff --git a/netmap/attributes_test.go b/netmap/attributes_test.go index 0385f42..6d5b9ea 100644 --- a/netmap/attributes_test.go +++ b/netmap/attributes_test.go @@ -4,9 +4,9 @@ import ( "strconv" "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/netmap" - netmaptest "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + netmaptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" "github.com/stretchr/testify/require" ) diff --git a/netmap/convert.go b/netmap/convert.go index 36af646..cc20d36 100644 --- a/netmap/convert.go +++ b/netmap/convert.go @@ -1,11 +1,11 @@ package netmap import ( - netmap "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (f *Filter) ToGRPCMessage() grpc.Message { diff --git a/netmap/grpc/service.go b/netmap/grpc/service.go index ad72ced..882db6b 100644 --- a/netmap/grpc/service.go +++ b/netmap/grpc/service.go @@ -1,8 +1,8 @@ package netmap import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) // SetBody sets body of the request. diff --git a/netmap/grpc/service.pb.go b/netmap/grpc/service.pb.go index 64859ae..d74d7c3 100644 --- a/netmap/grpc/service.pb.go +++ b/netmap/grpc/service.pb.go @@ -7,8 +7,8 @@ package netmap import ( - grpc1 "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -854,14 +854,14 @@ var file_netmap_grpc_service_proto_rawDesc = []byte{ 0x6d, 0x61, 0x70, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5b, 0x5a, 0x3c, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, - 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, - 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, - 0x50, 0x49, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x61, 0x5a, 0x42, + 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, + 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, + 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, + 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/netmap/grpc/types.go b/netmap/grpc/types.go index b97a0c8..d0bf41a 100644 --- a/netmap/grpc/types.go +++ b/netmap/grpc/types.go @@ -1,6 +1,6 @@ package netmap -import refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" +import refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" // SetReplicas of placement policy. func (m *PlacementPolicy) SetReplicas(v []*Replica) { diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index 5d2237b..92fea20 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -7,7 +7,7 @@ package netmap import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -1145,13 +1145,13 @@ var file_netmap_grpc_types_proto_rawDesc = []byte{ 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, 0x43, 0x54, - 0x10, 0x02, 0x42, 0x5b, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, - 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, - 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, + 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, + 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/netmap/json.go b/netmap/json.go index aed469c..6eacb96 100644 --- a/netmap/json.go +++ b/netmap/json.go @@ -1,8 +1,8 @@ package netmap import ( - netmap "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (p *PlacementPolicy) MarshalJSON() ([]byte, error) { diff --git a/netmap/marshal.go b/netmap/marshal.go index d006f92..e08d6f0 100644 --- a/netmap/marshal.go +++ b/netmap/marshal.go @@ -1,9 +1,9 @@ package netmap import ( - netmap "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - protoutil "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/netmap/message_test.go b/netmap/message_test.go index 2ebec3c..fe78ffe 100644 --- a/netmap/message_test.go +++ b/netmap/message_test.go @@ -3,9 +3,9 @@ package netmap_test import ( "testing" - netmaptest "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + netmaptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" ) func TestMessageConvert(t *testing.T) { diff --git a/netmap/string.go b/netmap/string.go index 0c2a491..1f00a55 100644 --- a/netmap/string.go +++ b/netmap/string.go @@ -1,7 +1,7 @@ package netmap import ( - netmap "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" + netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" ) // String returns string representation of Clause. diff --git a/netmap/test/generate.go b/netmap/test/generate.go index 835e7f1..30e200e 100644 --- a/netmap/test/generate.go +++ b/netmap/test/generate.go @@ -1,9 +1,9 @@ package netmaptest import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/netmap" - refstest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" - sessiontest "github.com/TrueCloudLab/frostfs-api-go/v2/session/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/test" ) func GenerateFilter(empty bool) *netmap.Filter { diff --git a/netmap/types.go b/netmap/types.go index dc76f80..c878184 100644 --- a/netmap/types.go +++ b/netmap/types.go @@ -1,8 +1,8 @@ package netmap import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" ) type LocalNodeInfoRequest struct { diff --git a/object/convert.go b/object/convert.go index 82eba35..95fde3c 100644 --- a/object/convert.go +++ b/object/convert.go @@ -3,13 +3,13 @@ package object import ( "fmt" - object "github.com/TrueCloudLab/frostfs-api-go/v2/object/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" - sessionGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + sessionGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) func TypeToGRPCField(t Type) object.ObjectType { diff --git a/object/grpc/service.go b/object/grpc/service.go index d85d44b..44b5f4a 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -1,8 +1,8 @@ package object import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) // SetAddress sets address of the requested object. diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index 5821b77..207b0b0 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -7,8 +7,8 @@ package object import ( - grpc1 "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -2751,13 +2751,14 @@ var file_object_grpc_service_proto_rawDesc = []byte{ 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x5b, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, - 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, - 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, + 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, + 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 8864e00..172998c 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -30,30 +30,30 @@ type ObjectServiceClient interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. - // * __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -63,102 +63,103 @@ type ObjectServiceClient interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object storage container not found; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation SEARCH of the object is denied; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, 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 @@ -166,31 +167,31 @@ type ObjectServiceClient interface { // order. // // Extended headers can change `GetRange` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. - // * __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -198,29 +199,29 @@ type ObjectServiceClient interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. - // * __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) } @@ -401,30 +402,30 @@ type ObjectServiceServer interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. - // * __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Get(*GetRequest, ObjectService_GetServer) error // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -434,102 +435,103 @@ type ObjectServiceServer interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object storage container not found; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Put(ObjectService_PutServer) error // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Head(context.Context, *HeadRequest) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation SEARCH of the object is denied; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Search(*SearchRequest, ObjectService_SearchServer) 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 @@ -537,31 +539,31 @@ type ObjectServiceServer interface { // order. // // Extended headers can change `GetRange` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. - // * __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -569,29 +571,29 @@ type ObjectServiceServer interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // * __NEOFS__NETMAP_EPOCH \ - // Will use the requsted version of Network Map for object placement - // calculation. - // * __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) } diff --git a/object/grpc/status.pb.go b/object/grpc/status.pb.go index 17ad8de..034fa1b 100644 --- a/object/grpc/status.pb.go +++ b/object/grpc/status.pb.go @@ -10,7 +10,7 @@ import ( reflect "reflect" sync "sync" - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) diff --git a/object/grpc/types.go b/object/grpc/types.go index 9801037..9a2cdea 100644 --- a/object/grpc/types.go +++ b/object/grpc/types.go @@ -1,8 +1,8 @@ package object import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) // SetKey sets key to the object attribute. diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 19a888b..818bc5e 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -7,8 +7,8 @@ package object import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc1 "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -877,13 +877,13 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x10, - 0x04, 0x42, 0x5b, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, - 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x04, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, + 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, + 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, + 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, + 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/object/json.go b/object/json.go index 6999cc9..1a04031 100644 --- a/object/json.go +++ b/object/json.go @@ -1,8 +1,8 @@ package object import ( - object "github.com/TrueCloudLab/frostfs-api-go/v2/object/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (h *ShortHeader) MarshalJSON() ([]byte, error) { diff --git a/object/lock.go b/object/lock.go index e9704a8..62ba4a9 100644 --- a/object/lock.go +++ b/object/lock.go @@ -4,12 +4,12 @@ import ( "errors" "fmt" - lock "github.com/TrueCloudLab/frostfs-api-go/v2/lock/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + lock "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/lock/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) // Lock represents object Lock message from NeoFS API V2 protocol. diff --git a/object/lock_test.go b/object/lock_test.go index 90c7e7f..41b159d 100644 --- a/object/lock_test.go +++ b/object/lock_test.go @@ -3,8 +3,8 @@ package object_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/object" - objecttest "github.com/TrueCloudLab/frostfs-api-go/v2/object/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + objecttest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/test" "github.com/stretchr/testify/require" ) diff --git a/object/marshal.go b/object/marshal.go index e286578..b918e69 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -1,10 +1,10 @@ package object import ( - object "github.com/TrueCloudLab/frostfs-api-go/v2/object/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/object/message_test.go b/object/message_test.go index 94b1c1d..c690e66 100644 --- a/object/message_test.go +++ b/object/message_test.go @@ -3,9 +3,9 @@ package object_test import ( "testing" - objecttest "github.com/TrueCloudLab/frostfs-api-go/v2/object/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + objecttest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" ) func TestMessageConvert(t *testing.T) { diff --git a/object/status.go b/object/status.go index bbdeb3f..cff8275 100644 --- a/object/status.go +++ b/object/status.go @@ -1,8 +1,8 @@ package object import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/status" - statusgrpc "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + statusgrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" ) // LocalizeFailStatus checks if passed global status.Code is related to object failure and: diff --git a/object/status_test.go b/object/status_test.go index af7dcf9..7a9ac13 100644 --- a/object/status_test.go +++ b/object/status_test.go @@ -3,9 +3,9 @@ package object_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/object" - "github.com/TrueCloudLab/frostfs-api-go/v2/status" - statustest "github.com/TrueCloudLab/frostfs-api-go/v2/status/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + statustest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/test" "github.com/stretchr/testify/require" ) diff --git a/object/string.go b/object/string.go index ef22f8b..6e42c81 100644 --- a/object/string.go +++ b/object/string.go @@ -1,7 +1,7 @@ package object import ( - object "github.com/TrueCloudLab/frostfs-api-go/v2/object/grpc" + object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc" ) // String returns string representation of Type. diff --git a/object/test/generate.go b/object/test/generate.go index 1c74576..0816ffc 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -1,11 +1,11 @@ package objecttest import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/internal/random" - "github.com/TrueCloudLab/frostfs-api-go/v2/object" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refstest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" - sessiontest "github.com/TrueCloudLab/frostfs-api-go/v2/session/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/internal/random" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/test" ) func GenerateShortHeader(empty bool) *object.ShortHeader { diff --git a/object/types.go b/object/types.go index 33eb48e..f076b74 100644 --- a/object/types.go +++ b/object/types.go @@ -1,8 +1,8 @@ package object import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" ) type Type uint32 diff --git a/refs/convert.go b/refs/convert.go index dade588..028bd6a 100644 --- a/refs/convert.go +++ b/refs/convert.go @@ -1,9 +1,9 @@ package refs import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (o *OwnerID) ToGRPCMessage() grpc.Message { diff --git a/refs/grpc/types.pb.go b/refs/grpc/types.pb.go index 7fcf89d..5e9bfb5 100644 --- a/refs/grpc/types.pb.go +++ b/refs/grpc/types.pb.go @@ -733,13 +733,13 @@ var file_refs_grpc_types_proto_rawDesc = []byte{ 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x54, 0x5a, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, - 0x41, 0x32, 0x35, 0x36, 0x10, 0x02, 0x42, 0x55, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, - 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, - 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, - 0x66, 0x73, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, 0x66, 0x73, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x41, 0x32, 0x35, 0x36, 0x10, 0x02, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, + 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, 0x66, 0x73, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, + 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, + 0x65, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/refs/json.go b/refs/json.go index 44198ae..529723a 100644 --- a/refs/json.go +++ b/refs/json.go @@ -1,8 +1,8 @@ package refs import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (a *Address) MarshalJSON() ([]byte, error) { diff --git a/refs/marshal.go b/refs/marshal.go index 50c3501..14b0f8c 100644 --- a/refs/marshal.go +++ b/refs/marshal.go @@ -3,9 +3,9 @@ package refs import ( "encoding/binary" - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/refs/message_test.go b/refs/message_test.go index 8d8a69d..ba36434 100644 --- a/refs/message_test.go +++ b/refs/message_test.go @@ -3,9 +3,9 @@ package refs_test import ( "testing" - refstest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" ) func TestMessageConvert(t *testing.T) { diff --git a/refs/string.go b/refs/string.go index 2dac54a..5389aa3 100644 --- a/refs/string.go +++ b/refs/string.go @@ -1,7 +1,7 @@ package refs import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) // String returns string representation of ChecksumType. diff --git a/refs/test/generate.go b/refs/test/generate.go index b11b1a0..cce64a8 100644 --- a/refs/test/generate.go +++ b/refs/test/generate.go @@ -3,7 +3,7 @@ package refstest import ( "math/rand" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" ) func GenerateVersion(empty bool) *refs.Version { diff --git a/refs/types_test.go b/refs/types_test.go index 11ad628..68d8fd7 100644 --- a/refs/types_test.go +++ b/refs/types_test.go @@ -5,7 +5,7 @@ import ( "strconv" "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" "github.com/stretchr/testify/require" ) diff --git a/reputation/convert.go b/reputation/convert.go index 25e887d..ca54261 100644 --- a/reputation/convert.go +++ b/reputation/convert.go @@ -1,11 +1,11 @@ package reputation import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - reputation "github.com/TrueCloudLab/frostfs-api-go/v2/reputation/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + reputation "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) // ToGRPCMessage converts PeerID to gRPC-generated diff --git a/reputation/grpc/service.go b/reputation/grpc/service.go index b737d6d..81ed890 100644 --- a/reputation/grpc/service.go +++ b/reputation/grpc/service.go @@ -1,7 +1,7 @@ package reputation import ( - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) // SetEpoch sets epoch in which the trust was assessed. diff --git a/reputation/grpc/service.pb.go b/reputation/grpc/service.pb.go index 2abb8d7..2d0f61f 100644 --- a/reputation/grpc/service.pb.go +++ b/reputation/grpc/service.pb.go @@ -7,7 +7,7 @@ package reputation import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -618,14 +618,14 @@ var file_reputation_grpc_service_proto_rawDesc = []byte{ 0x38, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x67, 0x5a, 0x44, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, - 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x70, + 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, 0x70, + 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, + 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, + 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/reputation/grpc/types.go b/reputation/grpc/types.go index 01766f8..63f2d34 100644 --- a/reputation/grpc/types.go +++ b/reputation/grpc/types.go @@ -1,7 +1,7 @@ package reputation import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) // SetPublicKey sets binary public key of ID. diff --git a/reputation/grpc/types.pb.go b/reputation/grpc/types.pb.go index 9699284..b95b240 100644 --- a/reputation/grpc/types.pb.go +++ b/reputation/grpc/types.pb.go @@ -7,7 +7,7 @@ package reputation import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -364,14 +364,14 @@ var file_reputation_grpc_types_proto_rawDesc = []byte{ 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x75, - 0x73, 0x74, 0x52, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x42, 0x67, 0x5a, 0x44, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, - 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x52, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x70, + 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, 0x70, + 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, + 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, + 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/reputation/json.go b/reputation/json.go index d1b4d4d..3976462 100644 --- a/reputation/json.go +++ b/reputation/json.go @@ -1,8 +1,8 @@ package reputation import ( - reputation "github.com/TrueCloudLab/frostfs-api-go/v2/reputation/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + reputation "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) func (x *PeerID) MarshalJSON() ([]byte, error) { diff --git a/reputation/marshal.go b/reputation/marshal.go index 138e0e8..a64e822 100644 --- a/reputation/marshal.go +++ b/reputation/marshal.go @@ -1,9 +1,9 @@ package reputation import ( - reputation "github.com/TrueCloudLab/frostfs-api-go/v2/reputation/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - protoutil "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + reputation "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/reputation/message_test.go b/reputation/message_test.go index 8f308b0..891c2e4 100644 --- a/reputation/message_test.go +++ b/reputation/message_test.go @@ -3,9 +3,9 @@ package reputation_test import ( "testing" - reputationtest "github.com/TrueCloudLab/frostfs-api-go/v2/reputation/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + reputationtest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" ) func TestMessageConvert(t *testing.T) { diff --git a/reputation/test/generate.go b/reputation/test/generate.go index 09d61d2..7731ad9 100644 --- a/reputation/test/generate.go +++ b/reputation/test/generate.go @@ -1,9 +1,9 @@ package reputationtest import ( - refstest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/reputation" - sessiontest "github.com/TrueCloudLab/frostfs-api-go/v2/session/test" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/test" ) func GeneratePeerID(empty bool) *reputation.PeerID { diff --git a/reputation/types.go b/reputation/types.go index 3876f1a..a339183 100644 --- a/reputation/types.go +++ b/reputation/types.go @@ -1,8 +1,8 @@ package reputation import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" ) // PeerID represents reputation.PeerID message diff --git a/rpc/accounting.go b/rpc/accounting.go index 21c7a7f..4f324c9 100644 --- a/rpc/accounting.go +++ b/rpc/accounting.go @@ -1,9 +1,9 @@ package rpc import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/accounting" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" ) const serviceAccounting = serviceNamePrefix + "accounting.AccountingService" diff --git a/rpc/client/flows.go b/rpc/client/flows.go index e741ca3..a3da1e2 100644 --- a/rpc/client/flows.go +++ b/rpc/client/flows.go @@ -5,8 +5,8 @@ import ( "io" "sync" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) // SendUnary initializes communication session by RPC info, performs unary RPC diff --git a/rpc/client/init.go b/rpc/client/init.go index 7706c7a..60ccda9 100644 --- a/rpc/client/init.go +++ b/rpc/client/init.go @@ -4,8 +4,8 @@ import ( "context" "io" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" "google.golang.org/grpc" ) diff --git a/rpc/client/stream_wrapper.go b/rpc/client/stream_wrapper.go index 7f60db2..22033dd 100644 --- a/rpc/client/stream_wrapper.go +++ b/rpc/client/stream_wrapper.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" "google.golang.org/grpc" ) diff --git a/rpc/client/util.go b/rpc/client/util.go index 291ebac..95dc2b0 100644 --- a/rpc/client/util.go +++ b/rpc/client/util.go @@ -3,7 +3,7 @@ package client import ( "fmt" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" ) const methodNameFmt = "/%s/%s" diff --git a/rpc/common/call_test.go b/rpc/common/call_test.go index f3acd08..942ee02 100644 --- a/rpc/common/call_test.go +++ b/rpc/common/call_test.go @@ -3,7 +3,7 @@ package common_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" "github.com/stretchr/testify/require" ) diff --git a/rpc/container.go b/rpc/container.go index a33afe1..1292c22 100644 --- a/rpc/container.go +++ b/rpc/container.go @@ -1,9 +1,9 @@ package rpc import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/container" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" ) const serviceContainer = serviceNamePrefix + "container.ContainerService" diff --git a/rpc/message/encoding.go b/rpc/message/encoding.go index b28cde3..715f015 100644 --- a/rpc/message/encoding.go +++ b/rpc/message/encoding.go @@ -1,7 +1,7 @@ package message import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" ) diff --git a/rpc/message/message.go b/rpc/message/message.go index 4f6acaf..c9b87f0 100644 --- a/rpc/message/message.go +++ b/rpc/message/message.go @@ -3,7 +3,7 @@ package message import ( "fmt" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" ) // Message represents raw Protobuf message diff --git a/rpc/message/test/message.go b/rpc/message/test/message.go index 138b758..df769d2 100644 --- a/rpc/message/test/message.go +++ b/rpc/message/test/message.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" "github.com/stretchr/testify/require" ) diff --git a/rpc/netmap.go b/rpc/netmap.go index bfe2ef4..38bdd6d 100644 --- a/rpc/netmap.go +++ b/rpc/netmap.go @@ -1,9 +1,9 @@ package rpc import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/netmap" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" ) const serviceNetmap = serviceNamePrefix + "netmap.NetmapService" diff --git a/rpc/object.go b/rpc/object.go index b2d0c95..1cac1c7 100644 --- a/rpc/object.go +++ b/rpc/object.go @@ -1,10 +1,10 @@ package rpc import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/object" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) const serviceObject = serviceNamePrefix + "object.ObjectService" diff --git a/rpc/reputation.go b/rpc/reputation.go index 413868d..3d036b2 100644 --- a/rpc/reputation.go +++ b/rpc/reputation.go @@ -1,9 +1,9 @@ package rpc import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/reputation" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" ) const serviceReputation = serviceNamePrefix + "reputation.ReputationService" diff --git a/rpc/session.go b/rpc/session.go index f180780..f786734 100644 --- a/rpc/session.go +++ b/rpc/session.go @@ -1,9 +1,9 @@ package rpc import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" ) const serviceSession = serviceNamePrefix + "session.SessionService" diff --git a/session/convert.go b/session/convert.go index a6bc6d6..870e208 100644 --- a/session/convert.go +++ b/session/convert.go @@ -3,15 +3,15 @@ package session import ( "fmt" - "github.com/TrueCloudLab/frostfs-api-go/v2/acl" - aclGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/status" - statusGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + aclGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + statusGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" ) func (c *CreateRequestBody) ToGRPCMessage() grpc.Message { diff --git a/session/grpc/service.go b/session/grpc/service.go index a9e5282..6e02328 100644 --- a/session/grpc/service.go +++ b/session/grpc/service.go @@ -1,7 +1,7 @@ package session import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) // SetOwnerId sets identifier of the session initiator. diff --git a/session/grpc/service.pb.go b/session/grpc/service.pb.go index 5bf1677..23d6913 100644 --- a/session/grpc/service.pb.go +++ b/session/grpc/service.pb.go @@ -7,7 +7,7 @@ package session import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -330,13 +330,14 @@ var file_session_grpc_service_proto_rawDesc = []byte{ 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, 0x5e, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, - 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, 0x4e, 0x65, 0x6f, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, - 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x64, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, + 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0xaa, 0x02, 0x1b, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/session/grpc/types.go b/session/grpc/types.go index e3ee8d6..bcc92d1 100644 --- a/session/grpc/types.go +++ b/session/grpc/types.go @@ -1,9 +1,9 @@ package session import ( - acl "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - status "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc" + acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + status "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" ) // SetKey sets key to the X-Header. diff --git a/session/grpc/types.pb.go b/session/grpc/types.pb.go index b96f954..3ca6001 100644 --- a/session/grpc/types.pb.go +++ b/session/grpc/types.pb.go @@ -7,9 +7,9 @@ package session import ( - grpc1 "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc2 "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -1196,13 +1196,14 @@ var file_session_grpc_types_proto_rawDesc = []byte{ 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, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x42, 0x5e, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, - 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, 0x4e, 0x65, 0x6f, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, - 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x42, 0x64, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, + 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0xaa, 0x02, 0x1b, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/session/json.go b/session/json.go index d44325f..77cbe10 100644 --- a/session/json.go +++ b/session/json.go @@ -1,8 +1,8 @@ package session import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "google.golang.org/protobuf/encoding/protojson" ) diff --git a/session/marshal.go b/session/marshal.go index f4b1bc9..3c56cd4 100644 --- a/session/marshal.go +++ b/session/marshal.go @@ -1,9 +1,9 @@ package session import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" goproto "google.golang.org/protobuf/proto" ) diff --git a/session/message_test.go b/session/message_test.go index 33489de..39dd336 100644 --- a/session/message_test.go +++ b/session/message_test.go @@ -3,9 +3,9 @@ package session_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - rpctest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" - sessiontest "github.com/TrueCloudLab/frostfs-api-go/v2/session/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + rpctest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/test" ) func TestMessageConvert(t *testing.T) { diff --git a/session/status.go b/session/status.go index 04aa450..8b3b381 100644 --- a/session/status.go +++ b/session/status.go @@ -1,8 +1,8 @@ package session import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/status" - statusgrpc "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + statusgrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" ) // LocalizeFailStatus checks if passed global status.Code is related to session failure and: diff --git a/session/status_test.go b/session/status_test.go index 2a7ff6d..57ce4bd 100644 --- a/session/status_test.go +++ b/session/status_test.go @@ -3,8 +3,8 @@ package session_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" - statustest "github.com/TrueCloudLab/frostfs-api-go/v2/status/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + statustest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/test" ) func TestStatusCodes(t *testing.T) { diff --git a/session/string.go b/session/string.go index 24e7d09..0e7c48a 100644 --- a/session/string.go +++ b/session/string.go @@ -1,7 +1,7 @@ package session import ( - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) // String returns string representation of ObjectSessionVerb. diff --git a/session/test/generate.go b/session/test/generate.go index dc06aed..cfce6cd 100644 --- a/session/test/generate.go +++ b/session/test/generate.go @@ -1,11 +1,11 @@ package sessiontest import ( - acltest "github.com/TrueCloudLab/frostfs-api-go/v2/acl/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/internal/random" - refstest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" - statustest "github.com/TrueCloudLab/frostfs-api-go/v2/status/test" + acltest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/internal/random" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + statustest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/test" ) func GenerateCreateRequestBody(empty bool) *session.CreateRequestBody { diff --git a/session/types.go b/session/types.go index d00d76f..19cfecc 100644 --- a/session/types.go +++ b/session/types.go @@ -1,10 +1,10 @@ package session import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/acl" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/status" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) type CreateRequestBody struct { diff --git a/session/util.go b/session/util.go index 59ee076..7edca29 100644 --- a/session/util.go +++ b/session/util.go @@ -1,7 +1,7 @@ package session import ( - session "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) // RequestHeaders represents common part of diff --git a/signature/sign.go b/signature/sign.go index f1d4cf6..f4dad90 100644 --- a/signature/sign.go +++ b/signature/sign.go @@ -5,14 +5,14 @@ import ( "errors" "fmt" - "github.com/TrueCloudLab/frostfs-api-go/v2/accounting" - "github.com/TrueCloudLab/frostfs-api-go/v2/container" - "github.com/TrueCloudLab/frostfs-api-go/v2/netmap" - "github.com/TrueCloudLab/frostfs-api-go/v2/object" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/reputation" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/signature" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/signature" ) type serviceRequest interface { diff --git a/signature/sign_test.go b/signature/sign_test.go index fb508a3..ff31954 100644 --- a/signature/sign_test.go +++ b/signature/sign_test.go @@ -3,9 +3,9 @@ package signature import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/accounting" - "github.com/TrueCloudLab/frostfs-api-go/v2/session" - crypto "github.com/TrueCloudLab/frostfs-crypto" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + crypto "git.frostfs.info/TrueCloudLab/frostfs-crypto" "github.com/stretchr/testify/require" ) diff --git a/status/convert.go b/status/convert.go index e13e567..0743952 100644 --- a/status/convert.go +++ b/status/convert.go @@ -1,9 +1,9 @@ package status import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - status "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + status "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" ) func (x *Detail) ToGRPCMessage() grpc.Message { diff --git a/status/grpc/types.pb.go b/status/grpc/types.pb.go index d4960fb..f6fd81c 100644 --- a/status/grpc/types.pb.go +++ b/status/grpc/types.pb.go @@ -558,13 +558,14 @@ var file_status_grpc_types_proto_rawDesc = []byte{ 0x4e, 0x44, 0x10, 0x01, 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, 0x42, 0x5b, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, - 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, - 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, + 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, + 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/status/marshal.go b/status/marshal.go index 553b7d7..78064c1 100644 --- a/status/marshal.go +++ b/status/marshal.go @@ -1,9 +1,9 @@ package status import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - status "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc" - protoutil "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + status "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/status/message_test.go b/status/message_test.go index 47355f1..f16f152 100644 --- a/status/message_test.go +++ b/status/message_test.go @@ -3,9 +3,9 @@ package status_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" - statustest "github.com/TrueCloudLab/frostfs-api-go/v2/status/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + statustest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/test" ) func TestMessageConvert(t *testing.T) { diff --git a/status/test/codes.go b/status/test/codes.go index 4df7da5..3a2e001 100644 --- a/status/test/codes.go +++ b/status/test/codes.go @@ -3,7 +3,7 @@ package statustest import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" "github.com/stretchr/testify/require" ) diff --git a/status/test/generate.go b/status/test/generate.go index 8812814..8537b39 100644 --- a/status/test/generate.go +++ b/status/test/generate.go @@ -1,7 +1,7 @@ package statustest import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/status" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" ) // Detail returns status.Detail filled with static random values. diff --git a/storagegroup/convert.go b/storagegroup/convert.go index dddd8b4..898d493 100644 --- a/storagegroup/convert.go +++ b/storagegroup/convert.go @@ -1,11 +1,11 @@ package storagegroup import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - sg "github.com/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + sg "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc" ) func (s *StorageGroup) ToGRPCMessage() grpc.Message { diff --git a/storagegroup/grpc/types.go b/storagegroup/grpc/types.go index f1151c4..9be5c24 100644 --- a/storagegroup/grpc/types.go +++ b/storagegroup/grpc/types.go @@ -1,7 +1,7 @@ package storagegroup import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) // SetValidationDataSize sets the total size of the payloads of the storage group. diff --git a/storagegroup/grpc/types.pb.go b/storagegroup/grpc/types.pb.go index 98e2bcd..37f88ea 100644 --- a/storagegroup/grpc/types.pb.go +++ b/storagegroup/grpc/types.pb.go @@ -7,7 +7,7 @@ package storagegroup import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -132,14 +132,15 @@ var file_storagegroup_grpc_types_proto_rawDesc = []byte{ 0x6f, 0x63, 0x68, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x04, 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, 0x6d, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, - 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, - 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0xaa, 0x02, 0x20, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x42, 0x73, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, + 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0xaa, 0x02, 0x20, 0x4e, 0x65, 0x6f, 0x2e, + 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/storagegroup/json.go b/storagegroup/json.go index 6136068..b122893 100644 --- a/storagegroup/json.go +++ b/storagegroup/json.go @@ -1,8 +1,8 @@ package storagegroup import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - storagegroup "github.com/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + storagegroup "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc" ) func (s *StorageGroup) MarshalJSON() ([]byte, error) { diff --git a/storagegroup/marshal.go b/storagegroup/marshal.go index f7a94f7..3f8171a 100644 --- a/storagegroup/marshal.go +++ b/storagegroup/marshal.go @@ -1,10 +1,10 @@ package storagegroup import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - storagegroup "github.com/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + storagegroup "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/storagegroup/message_test.go b/storagegroup/message_test.go index ccc214c..e4ed367 100644 --- a/storagegroup/message_test.go +++ b/storagegroup/message_test.go @@ -3,9 +3,9 @@ package storagegroup_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" - storagegrouptest "github.com/TrueCloudLab/frostfs-api-go/v2/storagegroup/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + storagegrouptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/test" ) func TestMessageConvert(t *testing.T) { diff --git a/storagegroup/test/generate.go b/storagegroup/test/generate.go index fb338e4..b53f199 100644 --- a/storagegroup/test/generate.go +++ b/storagegroup/test/generate.go @@ -1,8 +1,8 @@ package storagegrouptest import ( - refstest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/storagegroup" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup" ) func GenerateStorageGroup(empty bool) *storagegroup.StorageGroup { diff --git a/storagegroup/types.go b/storagegroup/types.go index 179705e..b5a3a5b 100644 --- a/storagegroup/types.go +++ b/storagegroup/types.go @@ -1,7 +1,7 @@ package storagegroup import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" ) // StorageGroup is a unified structure of StorageGroup diff --git a/subnet/encoding_test.go b/subnet/encoding_test.go index 3e41b23..0a1fea1 100644 --- a/subnet/encoding_test.go +++ b/subnet/encoding_test.go @@ -3,9 +3,9 @@ package subnet_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" - subnettest "github.com/TrueCloudLab/frostfs-api-go/v2/subnet/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + subnettest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet/test" ) func TestMessageConvert(t *testing.T) { diff --git a/subnet/grpc/types.go b/subnet/grpc/types.go index 548e656..3196c5a 100644 --- a/subnet/grpc/types.go +++ b/subnet/grpc/types.go @@ -1,7 +1,7 @@ package subnet import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) // SetID returns identifier of the subnet. Nil arg is equivalent to zero subnet ID. diff --git a/subnet/grpc/types.pb.go b/subnet/grpc/types.pb.go index 2de1bc8..c2d7529 100644 --- a/subnet/grpc/types.pb.go +++ b/subnet/grpc/types.pb.go @@ -7,7 +7,7 @@ package subnet import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -93,13 +93,14 @@ var file_subnet_grpc_types_proto_rawDesc = []byte{ 0x62, 0x6e, 0x65, 0x74, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 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, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x5b, 0x5a, 0x3c, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, - 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x3b, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, - 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, - 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x49, 0x44, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x75, 0x62, + 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0xaa, + 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/subnet/info.go b/subnet/info.go index 37ecfe2..2e1e94c 100644 --- a/subnet/info.go +++ b/subnet/info.go @@ -1,12 +1,12 @@ package subnet import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - refsgrpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - subnet "github.com/TrueCloudLab/frostfs-api-go/v2/subnet/grpc" - protoutil "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + refsgrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + subnet "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet/grpc" + protoutil "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) // Info represents information about NeoFS subnet. Structure is compatible with NeoFS API V2 protocol. diff --git a/subnet/test/generate.go b/subnet/test/generate.go index d5eab77..214ac7b 100644 --- a/subnet/test/generate.go +++ b/subnet/test/generate.go @@ -1,8 +1,8 @@ package subnettest import ( - refstest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/subnet" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet" ) func GenerateSubnetInfo(empty bool) *subnet.Info { diff --git a/tombstone/convert.go b/tombstone/convert.go index 48e64a6..62febc5 100644 --- a/tombstone/convert.go +++ b/tombstone/convert.go @@ -1,10 +1,10 @@ package tombstone import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - tombstone "github.com/TrueCloudLab/frostfs-api-go/v2/tombstone/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + tombstone "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone/grpc" ) func (s *Tombstone) ToGRPCMessage() grpc.Message { diff --git a/tombstone/grpc/types.go b/tombstone/grpc/types.go index 6793635..9b4b744 100644 --- a/tombstone/grpc/types.go +++ b/tombstone/grpc/types.go @@ -1,7 +1,7 @@ package tombstone import ( - refs "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) // SetExpirationEpoch sets number of tombstone expiration epoch. diff --git a/tombstone/grpc/types.pb.go b/tombstone/grpc/types.pb.go index b8ea61a..11405ac 100644 --- a/tombstone/grpc/types.pb.go +++ b/tombstone/grpc/types.pb.go @@ -7,7 +7,7 @@ package tombstone import ( - grpc "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -110,13 +110,14 @@ var file_tombstone_grpc_types_proto_rawDesc = []byte{ 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x42, 0x64, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, - 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, - 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x6f, - 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x74, 0x6f, 0x6d, - 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x54, 0x6f, 0x6d, - 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x42, 0x6a, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, + 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, + 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, + 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x3b, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0xaa, 0x02, 0x1d, 0x4e, + 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, + 0x50, 0x49, 0x2e, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/tombstone/json.go b/tombstone/json.go index 1059910..05d959e 100644 --- a/tombstone/json.go +++ b/tombstone/json.go @@ -1,8 +1,8 @@ package tombstone import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - tombstone "github.com/TrueCloudLab/frostfs-api-go/v2/tombstone/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + tombstone "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone/grpc" ) func (s *Tombstone) MarshalJSON() ([]byte, error) { diff --git a/tombstone/marshal.go b/tombstone/marshal.go index 706d9c1..ae4405c 100644 --- a/tombstone/marshal.go +++ b/tombstone/marshal.go @@ -1,9 +1,9 @@ package tombstone import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - tombstone "github.com/TrueCloudLab/frostfs-api-go/v2/tombstone/grpc" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + tombstone "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( diff --git a/tombstone/message_test.go b/tombstone/message_test.go index ae0ad00..7528c73 100644 --- a/tombstone/message_test.go +++ b/tombstone/message_test.go @@ -3,9 +3,9 @@ package tombstone_test import ( "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" - tombstonetest "github.com/TrueCloudLab/frostfs-api-go/v2/tombstone/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" + tombstonetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone/test" ) func TestMessageConvert(t *testing.T) { diff --git a/tombstone/test/generate.go b/tombstone/test/generate.go index 00ffa92..3caf528 100644 --- a/tombstone/test/generate.go +++ b/tombstone/test/generate.go @@ -1,8 +1,8 @@ package tombstonetest import ( - refstest "github.com/TrueCloudLab/frostfs-api-go/v2/refs/test" - "github.com/TrueCloudLab/frostfs-api-go/v2/tombstone" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone" ) func GenerateTombstone(empty bool) *tombstone.Tombstone { diff --git a/tombstone/types.go b/tombstone/types.go index 4f2ffb4..edcd934 100644 --- a/tombstone/types.go +++ b/tombstone/types.go @@ -1,7 +1,7 @@ package tombstone import ( - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" ) // Tombstone is a unified structure of Tombstone diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index b34e9d0..de2b72f 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -4,8 +4,8 @@ import ( "math" "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test" "github.com/stretchr/testify/require" goproto "google.golang.org/protobuf/proto" ) diff --git a/util/protogen/main.go b/util/protogen/main.go index b5a1931..99f5b7b 100644 --- a/util/protogen/main.go +++ b/util/protogen/main.go @@ -31,7 +31,7 @@ func generateFile(gen *protogen.Plugin, file *protogen.File) *protogen.Generated g.P() g.P("package ", file.GoPackageName) g.P() - g.P(`import "github.com/TrueCloudLab/frostfs-api-go/v2/util/proto"`) + g.P(`import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"`) //for _, e := range file.Enums { // g.P("type " + e.GoIdent.GoName + " int32") diff --git a/util/signature/data.go b/util/signature/data.go index efe543d..6de9466 100644 --- a/util/signature/data.go +++ b/util/signature/data.go @@ -3,8 +3,8 @@ package signature import ( "crypto/ecdsa" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - crypto "github.com/TrueCloudLab/frostfs-crypto" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + crypto "git.frostfs.info/TrueCloudLab/frostfs-crypto" ) type DataSource interface { diff --git a/util/signature/options.go b/util/signature/options.go index cb25034..28728dc 100644 --- a/util/signature/options.go +++ b/util/signature/options.go @@ -5,9 +5,9 @@ import ( "encoding/base64" "fmt" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/TrueCloudLab/frostfs-api-go/v2/util/signature/walletconnect" - crypto "github.com/TrueCloudLab/frostfs-crypto" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/signature/walletconnect" + crypto "git.frostfs.info/TrueCloudLab/frostfs-crypto" ) type cfg struct { diff --git a/util/signature/sign_test.go b/util/signature/sign_test.go index c819068..1fe2a4a 100644 --- a/util/signature/sign_test.go +++ b/util/signature/sign_test.go @@ -6,7 +6,7 @@ import ( "crypto/rand" "testing" - "github.com/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" "github.com/stretchr/testify/require" ) diff --git a/util/signature/walletconnect/sign.go b/util/signature/walletconnect/sign.go index bd24a89..b96a842 100644 --- a/util/signature/walletconnect/sign.go +++ b/util/signature/walletconnect/sign.go @@ -7,7 +7,7 @@ import ( "encoding/binary" "encoding/hex" - crypto "github.com/TrueCloudLab/frostfs-crypto" + crypto "git.frostfs.info/TrueCloudLab/frostfs-crypto" ) const ( From 5faee63f60d15cdc9fb47ff57c81554100d97b9d Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 3 Mar 2023 12:51:08 +0300 Subject: [PATCH 003/169] [#7] pre-commit: Add initial configuration Signed-off-by: Evgenii Stratonikov --- .golangci.yml | 4 ++-- .pre-commit-config.yaml | 19 +++++++++++++++++++ CHANGELOG.md | 34 +++++++++++++++++----------------- Makefile | 0 4 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 .pre-commit-config.yaml mode change 100644 => 100755 Makefile diff --git a/.golangci.yml b/.golangci.yml index 8f35944..5abd044 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,7 +11,7 @@ run: skip-files: - (^|.*/)grpc/(.*) - + # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" @@ -64,4 +64,4 @@ issues: - linters: # ignore SA6002 since we use pool of []byte, however we can switch to *bytes.Buffer - staticcheck - text: "SA6002:" \ No newline at end of file + text: "SA6002:" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9c6f604 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,19 @@ +ci: + autofix_prs: false + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: check-merge-conflict + - id: check-json + - id: check-xml + - id: check-yaml + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - id: end-of-file-fixer + exclude: ".key$" diff --git a/CHANGELOG.md b/CHANGELOG.md index c49300a..3b31e83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ - Mark all expiration methods as deprecated (#417) ### Updated -- Minimal go version to 1.17 (#412) +- Minimal go version to 1.17 (#412) - `neofs-crypto` to `v0.4.0` (#412) - `google.golang.org/grpc` to `v1.48.0` (#415) - `google.golang.org/protobuf` to `v1.28.0` (#415) @@ -60,7 +60,7 @@ NeoFS API v2.13 support ### Fixed - Incompatible changes in signature scheme (#380) - + ### Added - Public URI-parsing function `client.ParseURI()` (#383) @@ -92,9 +92,9 @@ NeoFS API v2.12 support ## [2.11.0] - 2021-12-02 - Sinjido (신지도, 薪智島) -NeoFS API v2.11 support. High level packages are moved to -[neofs-sdk-go](https://github.com/nspcc-dev/neofs-sdk-go) repository. -Repository restructured as Go module version 2 and synced with +NeoFS API v2.11 support. High level packages are moved to +[neofs-sdk-go](https://github.com/nspcc-dev/neofs-sdk-go) repository. +Repository restructured as Go module version 2 and synced with [neofs-api](https://github.com/nspcc-dev/neofs-api) release version. ### Fixed @@ -109,7 +109,7 @@ Repository restructured as Go module version 2 and synced with - neofs-api-go is now Go module version 2 (#201) ### Removed -- All packages from `pkg` moved to +- All packages from `pkg` moved to [neofs-sdk-go](https://github.com/nspcc-dev/neofs-sdk-go) (#201) ## [1.30.0] - 2021-10-19 - Udo (우도, 牛島) @@ -126,7 +126,7 @@ NeoFS API v2.10 support. - pkg/client callback to parse internal response information (#337) - Service filter type in extended ACL from API v2.10 (#338) - Enhanced network info structures from API v2.10 (#339) -- Well-known public-append basic ACL constant (#341) +- Well-known public-append basic ACL constant (#341) - Native contract names support (#351) ### Changed @@ -258,7 +258,7 @@ Raw client and support of NeoFS API v2.5.0 "Jebudo" release. ### Added - Raw client for peer to peer communication. -- `client.WithKey` option to sign messages with different keys within single +- `client.WithKey` option to sign messages with different keys within single client. - `Content-Type` well-known object attribute constant. @@ -271,7 +271,7 @@ Raw client and support of NeoFS API v2.5.0 "Jebudo" release. Support changes from NeoFS API v2.4.0 "Ganghwado" release. -### Added +### Added - `netmap.NetworkInfo` definitions in `v2` and `pkg/netmap`. - `netmap.NetworkInfo` RPC support in `pkg/client`. @@ -322,7 +322,7 @@ Support changes from NeoFS API v2.2.1 release. ### Fixed -- Remarks of the updated linter. +- Remarks of the updated linter. ## [1.22.0] - 2020-12-30 - Yeouido (여의도, 汝矣島) @@ -335,7 +335,7 @@ Support changes from NeoFS API v2.2.0 "Yeouido" release. - Support of `StorageGroup` message. - Support of `DataAuditResult` message. - Stringer and string parser for `Checksum` type of client library. -- Stringer and string parser for `Type` message. +- Stringer and string parser for `Type` message. - Stringer and string parser for `Type` type of client library. - `AddTypeFilter` method on `SearchFilters` type of client library that adds filter by object type. @@ -350,7 +350,7 @@ Support changes from NeoFS API v2.2.0 "Yeouido" release. - `Container.SetNonceUUID` setter of container nonce in UUID format. - `NewVerifiedContainerFromV2` container constructor that preliminary checks if container message argument meets NeoFS API V2 specification. - + ### Changed - `Container.Nonce`/`Container.SetNonce` marked as deprecated. @@ -368,7 +368,7 @@ Support neofs-api v2.1.1. ### Added -- `client.GetVerifiedContainerStructure` function to check +- `client.GetVerifiedContainerStructure` function to check that the container structure matches the requested identifier. ## [1.21.0] - 2020-12-11 - Modo (모도, 茅島) @@ -391,7 +391,7 @@ Support neofs-api v2.1.1. ### Renamed -- `AddLeafFilter` to `AddPhyFilter` +- `AddLeafFilter` to `AddPhyFilter` ### Fixed @@ -425,9 +425,9 @@ Support neofs-api v2.1.1. ## [1.20.0] - 2020-11-16 - Jindo (진도, 珍島) -Major API refactoring and simplification. From now on this library will have -backward compatibility and support of major versions of NeoFS-API by having -**version specific** files in `vN` dirs and **version independent** SDK +Major API refactoring and simplification. From now on this library will have +backward compatibility and support of major versions of NeoFS-API by having +**version specific** files in `vN` dirs and **version independent** SDK structures and client in `pkg`. This version supports NeoFS-API v2.0.X diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 From 3af7645abf6ce59e3aab8a6ee6e76b8acbf83924 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 3 Mar 2023 12:55:17 +0300 Subject: [PATCH 004/169] [#7] pre-commit: Add golangci-lint hook Signed-off-by: Evgenii Stratonikov --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c6f604..46c9c89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,3 +17,8 @@ repos: args: [--markdown-linebreak-ext=md] - id: end-of-file-fixer exclude: ".key$" + + - repo: https://github.com/golangci/golangci-lint + rev: v1.51.2 + hooks: + - id: golangci-lint From bd67469f43f9addad55ee7a256b73b5f02b70597 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 3 Mar 2023 12:55:38 +0300 Subject: [PATCH 005/169] [#7] pre-commit: Add gitlint hook Signed-off-by: Evgenii Stratonikov --- .gitlint | 10 ++++++++++ .pre-commit-config.yaml | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100644 .gitlint diff --git a/.gitlint b/.gitlint new file mode 100644 index 0000000..9ce883f --- /dev/null +++ b/.gitlint @@ -0,0 +1,10 @@ +[general] +fail-without-commits=true +contrib=CC1 + +[title-match-regex] +regex=^\[\#[0-9]+\]\s + +[ignore-by-title] +regex=^Release(.*) +ignore=title-match-regex diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46c9c89..3050af4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,3 +22,9 @@ repos: rev: v1.51.2 hooks: - id: golangci-lint + + - repo: https://github.com/jorisroovers/gitlint + rev: v0.18.0 + hooks: + - id: gitlint + stages: [commit-msg] From 3f7cb1b5ef2dddd2a7f118983df8bdb11dcd7cc6 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 7 Mar 2023 09:56:34 +0300 Subject: [PATCH 006/169] [#7] .github: Remove directory Signed-off-by: Evgenii Stratonikov --- .github/logo.svg | 70 --------------------------------------- .github/workflows/dco.yml | 21 ------------ .github/workflows/go.yml | 64 ----------------------------------- 3 files changed, 155 deletions(-) delete mode 100644 .github/logo.svg delete mode 100644 .github/workflows/dco.yml delete mode 100644 .github/workflows/go.yml diff --git a/.github/logo.svg b/.github/logo.svg deleted file mode 100644 index 148c359..0000000 --- a/.github/logo.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml deleted file mode 100644 index 40ed8fc..0000000 --- a/.github/workflows/dco.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: DCO check - -on: - pull_request: - branches: - - master - -jobs: - commits_check_job: - runs-on: ubuntu-latest - name: Commits Check - steps: - - name: Get PR Commits - id: 'get-pr-commits' - uses: tim-actions/get-pr-commits@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: DCO Check - uses: tim-actions/dco@master - with: - commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 48e770c..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: neofs-api-go tests - -on: - push: - branches: - - master - paths-ignore: - - '*.md' - pull_request: - branches: - - master - paths-ignore: - - '*.md' - -jobs: - test: - runs-on: ubuntu-20.04 - strategy: - matrix: - go: [ '1.17.x', '1.18.x', '1.19.x' ] - steps: - - name: Setup go - uses: actions/setup-go@v3 - with: - go-version: ${{ matrix.go }} - - - name: Check out code - uses: actions/checkout@v3 - - - name: Cache go mod - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go-${{ matrix.go }}- - - - name: Get dependencies - run: make dep - - - name: Run go test - run: go test -coverprofile=coverage.txt -covermode=atomic ./... - - - name: Codecov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: bash <(curl -s https://codecov.io/bash) - - lint: - runs-on: ubuntu-20.04 - steps: - - name: Setup go - uses: actions/setup-go@v3 - with: - go-version: 1.19 - - - name: Check out code - uses: actions/checkout@v3 - - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.48.0 - only-new-issues: true From 63eb4dc3eabffb2fcbd548180f3f8a9f2cdaee02 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 28 Feb 2023 12:11:05 +0300 Subject: [PATCH 007/169] [#3] api-go: Go version up Update go version 1.17 -> 1.18 Signed-off-by: Dmitrii Stepanov --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 25445da..a30ccb8 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 -go 1.17 +go 1.18 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 From d005bf0393c6f282fc3f070e736c0f693203d97d Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 28 Feb 2023 13:01:18 +0300 Subject: [PATCH 008/169] [#3] signature: Refactor sign and verify Split methods to separate files, drop redundant intefaces Signed-off-by: Dmitrii Stepanov --- go.mod | 3 +- go.sum | 8 +- signature/body.go | 115 +++++++++++++ signature/marshaller.go | 26 +++ signature/sign.go | 357 ++++----------------------------------- signature/verify.go | 111 ++++++++++++ util/collection/slice.go | 17 ++ 7 files changed, 312 insertions(+), 325 deletions(-) create mode 100644 signature/body.go create mode 100644 signature/marshaller.go create mode 100644 signature/verify.go create mode 100644 util/collection/slice.go diff --git a/go.mod b/go.mod index a30ccb8..1c60a27 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.18 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 github.com/stretchr/testify v1.7.0 + golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) @@ -16,7 +17,7 @@ require ( github.com/mr-tron/base58 v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect - golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect + golang.org/x/sys v0.1.0 // indirect golang.org/x/text v0.3.3 // indirect google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect diff --git a/go.sum b/go.sum index 34f4d44..c33a4c1 100644 --- a/go.sum +++ b/go.sum @@ -46,8 +46,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= @@ -64,6 +64,8 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 h1:Jvc7gsqn21cJHCmAWx0LiimpP18LZmUxkT5Mp7EZ1mI= +golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -87,8 +89,9 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -98,7 +101,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/signature/body.go b/signature/body.go new file mode 100644 index 0000000..bf3ab6c --- /dev/null +++ b/signature/body.go @@ -0,0 +1,115 @@ +package signature + +import ( + "fmt" + + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" +) + +func serviceMessageBody(req interface{}) stableMarshaler { + switch v := req.(type) { + default: + panic(fmt.Sprintf("unsupported session message %T", req)) + + /* Accounting */ + case *accounting.BalanceRequest: + return v.GetBody() + case *accounting.BalanceResponse: + return v.GetBody() + + /* Session */ + case *session.CreateRequest: + return v.GetBody() + case *session.CreateResponse: + return v.GetBody() + + /* Container */ + case *container.PutRequest: + return v.GetBody() + case *container.PutResponse: + return v.GetBody() + case *container.DeleteRequest: + return v.GetBody() + case *container.DeleteResponse: + return v.GetBody() + case *container.GetRequest: + return v.GetBody() + case *container.GetResponse: + return v.GetBody() + case *container.ListRequest: + return v.GetBody() + case *container.ListResponse: + return v.GetBody() + case *container.SetExtendedACLRequest: + return v.GetBody() + case *container.SetExtendedACLResponse: + return v.GetBody() + case *container.GetExtendedACLRequest: + return v.GetBody() + case *container.GetExtendedACLResponse: + return v.GetBody() + case *container.AnnounceUsedSpaceRequest: + return v.GetBody() + case *container.AnnounceUsedSpaceResponse: + return v.GetBody() + + /* Object */ + case *object.PutRequest: + return v.GetBody() + case *object.PutResponse: + return v.GetBody() + case *object.GetRequest: + return v.GetBody() + case *object.GetResponse: + return v.GetBody() + case *object.HeadRequest: + return v.GetBody() + case *object.HeadResponse: + return v.GetBody() + case *object.SearchRequest: + return v.GetBody() + case *object.SearchResponse: + return v.GetBody() + case *object.DeleteRequest: + return v.GetBody() + case *object.DeleteResponse: + return v.GetBody() + case *object.GetRangeRequest: + return v.GetBody() + case *object.GetRangeResponse: + return v.GetBody() + case *object.GetRangeHashRequest: + return v.GetBody() + case *object.GetRangeHashResponse: + return v.GetBody() + + /* Netmap */ + case *netmap.LocalNodeInfoRequest: + return v.GetBody() + case *netmap.LocalNodeInfoResponse: + return v.GetBody() + case *netmap.NetworkInfoRequest: + return v.GetBody() + case *netmap.NetworkInfoResponse: + return v.GetBody() + case *netmap.SnapshotRequest: + return v.GetBody() + case *netmap.SnapshotResponse: + return v.GetBody() + + /* Reputation */ + case *reputation.AnnounceLocalTrustRequest: + return v.GetBody() + case *reputation.AnnounceLocalTrustResponse: + return v.GetBody() + case *reputation.AnnounceIntermediateResultRequest: + return v.GetBody() + case *reputation.AnnounceIntermediateResultResponse: + return v.GetBody() + } +} diff --git a/signature/marshaller.go b/signature/marshaller.go new file mode 100644 index 0000000..ff9beb3 --- /dev/null +++ b/signature/marshaller.go @@ -0,0 +1,26 @@ +package signature + +type stableMarshaler interface { + StableMarshal([]byte) []byte + StableSize() int +} + +type StableMarshalerWrapper struct { + SM stableMarshaler +} + +func (s StableMarshalerWrapper) ReadSignedData(buf []byte) ([]byte, error) { + if s.SM != nil { + return s.SM.StableMarshal(buf), nil + } + + return nil, nil +} + +func (s StableMarshalerWrapper) SignedDataSize() int { + if s.SM != nil { + return s.SM.StableSize() + } + + return 0 +} diff --git a/signature/sign.go b/signature/sign.go index f4dad90..bd53d94 100644 --- a/signature/sign.go +++ b/signature/sign.go @@ -2,15 +2,9 @@ package signature import ( "crypto/ecdsa" - "errors" "fmt" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/signature" ) @@ -27,169 +21,69 @@ type serviceResponse interface { SetVerificationHeader(*session.ResponseVerificationHeader) } -type stableMarshaler interface { - StableMarshal([]byte) []byte - StableSize() int -} - -type StableMarshalerWrapper struct { - SM stableMarshaler -} - -type metaHeader interface { - stableMarshaler - getOrigin() metaHeader -} - -type verificationHeader interface { - stableMarshaler - - GetBodySignature() *refs.Signature +type signatureReceiver interface { SetBodySignature(*refs.Signature) - GetMetaSignature() *refs.Signature SetMetaSignature(*refs.Signature) - GetOriginSignature() *refs.Signature SetOriginSignature(*refs.Signature) - - setOrigin(stableMarshaler) - getOrigin() verificationHeader -} - -type requestMetaHeader struct { - *session.RequestMetaHeader -} - -type responseMetaHeader struct { - *session.ResponseMetaHeader -} - -type requestVerificationHeader struct { - *session.RequestVerificationHeader -} - -type responseVerificationHeader struct { - *session.ResponseVerificationHeader -} - -func (h *requestMetaHeader) getOrigin() metaHeader { - return &requestMetaHeader{ - RequestMetaHeader: h.GetOrigin(), - } -} - -func (h *responseMetaHeader) getOrigin() metaHeader { - return &responseMetaHeader{ - ResponseMetaHeader: h.GetOrigin(), - } -} - -func (h *requestVerificationHeader) getOrigin() verificationHeader { - if origin := h.GetOrigin(); origin != nil { - return &requestVerificationHeader{ - RequestVerificationHeader: origin, - } - } - - return nil -} - -func (h *requestVerificationHeader) setOrigin(m stableMarshaler) { - if m != nil { - h.SetOrigin(m.(*session.RequestVerificationHeader)) - } -} - -func (r *responseVerificationHeader) getOrigin() verificationHeader { - if origin := r.GetOrigin(); origin != nil { - return &responseVerificationHeader{ - ResponseVerificationHeader: origin, - } - } - - return nil -} - -func (r *responseVerificationHeader) setOrigin(m stableMarshaler) { - if m != nil { - r.SetOrigin(m.(*session.ResponseVerificationHeader)) - } -} - -func (s StableMarshalerWrapper) ReadSignedData(buf []byte) ([]byte, error) { - if s.SM != nil { - return s.SM.StableMarshal(buf), nil - } - - return nil, nil -} - -func (s StableMarshalerWrapper) SignedDataSize() int { - if s.SM != nil { - return s.SM.StableSize() - } - - return 0 } +// SignServiceMessage signes service message with key. func SignServiceMessage(key *ecdsa.PrivateKey, msg interface{}) error { - var ( - body, meta, verifyOrigin stableMarshaler - verifyHdr verificationHeader - verifyHdrSetter func(verificationHeader) - ) - switch v := msg.(type) { case nil: return nil case serviceRequest: - body = serviceMessageBody(v) - meta = v.GetMetaHeader() - verifyHdr = &requestVerificationHeader{new(session.RequestVerificationHeader)} - verifyHdrSetter = func(h verificationHeader) { - v.SetVerificationHeader(h.(*requestVerificationHeader).RequestVerificationHeader) - } - - if h := v.GetVerificationHeader(); h != nil { - verifyOrigin = h - } + return signServiceRequest(key, v) case serviceResponse: - body = serviceMessageBody(v) - meta = v.GetMetaHeader() - verifyHdr = &responseVerificationHeader{new(session.ResponseVerificationHeader)} - verifyHdrSetter = func(h verificationHeader) { - v.SetVerificationHeader(h.(*responseVerificationHeader).ResponseVerificationHeader) - } - - if h := v.GetVerificationHeader(); h != nil { - verifyOrigin = h - } + return signServiceResponse(key, v) default: panic(fmt.Sprintf("unsupported session message %T", v)) } +} - if verifyOrigin == nil { +func signServiceRequest(key *ecdsa.PrivateKey, v serviceRequest) error { + result := &session.RequestVerificationHeader{} + body := serviceMessageBody(v) + meta := v.GetMetaHeader() + header := v.GetVerificationHeader() + if err := signMessageParts(key, body, meta, header, header != nil, result); err != nil { + return err + } + result.SetOrigin(header) + v.SetVerificationHeader(result) + return nil +} + +func signServiceResponse(key *ecdsa.PrivateKey, v serviceResponse) error { + result := &session.ResponseVerificationHeader{} + body := serviceMessageBody(v) + meta := v.GetMetaHeader() + header := v.GetVerificationHeader() + if err := signMessageParts(key, body, meta, header, header != nil, result); err != nil { + return err + } + result.SetOrigin(header) + v.SetVerificationHeader(result) + return nil +} + +func signMessageParts(key *ecdsa.PrivateKey, body, meta, header stableMarshaler, hasHeader bool, result signatureReceiver) error { + if !hasHeader { // sign session message body - if err := signServiceMessagePart(key, body, verifyHdr.SetBodySignature); err != nil { + if err := signServiceMessagePart(key, body, result.SetBodySignature); err != nil { return fmt.Errorf("could not sign body: %w", err) } } // sign meta header - if err := signServiceMessagePart(key, meta, verifyHdr.SetMetaSignature); err != nil { + if err := signServiceMessagePart(key, meta, result.SetMetaSignature); err != nil { return fmt.Errorf("could not sign meta header: %w", err) } // sign verification header origin - if err := signServiceMessagePart(key, verifyOrigin, verifyHdr.SetOriginSignature); err != nil { + if err := signServiceMessagePart(key, header, result.SetOriginSignature); err != nil { return fmt.Errorf("could not sign origin of verification header: %w", err) } - - // wrap origin verification header - verifyHdr.setOrigin(verifyOrigin) - - // update matryoshka verification header - verifyHdrSetter(verifyHdr) - return nil } @@ -212,182 +106,3 @@ func signServiceMessagePart(key *ecdsa.PrivateKey, part stableMarshaler, sigWrit return nil } - -func VerifyServiceMessage(msg interface{}) error { - var ( - meta metaHeader - verify verificationHeader - ) - - switch v := msg.(type) { - case nil: - return nil - case serviceRequest: - meta = &requestMetaHeader{ - RequestMetaHeader: v.GetMetaHeader(), - } - - verify = &requestVerificationHeader{ - RequestVerificationHeader: v.GetVerificationHeader(), - } - case serviceResponse: - meta = &responseMetaHeader{ - ResponseMetaHeader: v.GetMetaHeader(), - } - - verify = &responseVerificationHeader{ - ResponseVerificationHeader: v.GetVerificationHeader(), - } - default: - panic(fmt.Sprintf("unsupported session message %T", v)) - } - - body := serviceMessageBody(msg) - size := body.StableSize() - if sz := meta.StableSize(); sz > size { - size = sz - } - if sz := verify.StableSize(); sz > size { - size = sz - } - - buf := make([]byte, 0, size) - return verifyMatryoshkaLevel(body, meta, verify, buf) -} - -func verifyMatryoshkaLevel(body stableMarshaler, meta metaHeader, verify verificationHeader, buf []byte) error { - if err := verifyServiceMessagePart(meta, verify.GetMetaSignature, buf); err != nil { - return fmt.Errorf("could not verify meta header: %w", err) - } - - origin := verify.getOrigin() - - if err := verifyServiceMessagePart(origin, verify.GetOriginSignature, buf); err != nil { - return fmt.Errorf("could not verify origin of verification header: %w", err) - } - - if origin == nil { - if err := verifyServiceMessagePart(body, verify.GetBodySignature, buf); err != nil { - return fmt.Errorf("could not verify body: %w", err) - } - - return nil - } - - if verify.GetBodySignature() != nil { - return errors.New("body signature at the matryoshka upper level") - } - - return verifyMatryoshkaLevel(body, meta.getOrigin(), origin, buf) -} - -func verifyServiceMessagePart(part stableMarshaler, sigRdr func() *refs.Signature, buf []byte) error { - return signature.VerifyDataWithSource( - &StableMarshalerWrapper{part}, - sigRdr, - signature.WithBuffer(buf), - ) -} - -func serviceMessageBody(req interface{}) stableMarshaler { - switch v := req.(type) { - default: - panic(fmt.Sprintf("unsupported session message %T", req)) - - /* Accounting */ - case *accounting.BalanceRequest: - return v.GetBody() - case *accounting.BalanceResponse: - return v.GetBody() - - /* Session */ - case *session.CreateRequest: - return v.GetBody() - case *session.CreateResponse: - return v.GetBody() - - /* Container */ - case *container.PutRequest: - return v.GetBody() - case *container.PutResponse: - return v.GetBody() - case *container.DeleteRequest: - return v.GetBody() - case *container.DeleteResponse: - return v.GetBody() - case *container.GetRequest: - return v.GetBody() - case *container.GetResponse: - return v.GetBody() - case *container.ListRequest: - return v.GetBody() - case *container.ListResponse: - return v.GetBody() - case *container.SetExtendedACLRequest: - return v.GetBody() - case *container.SetExtendedACLResponse: - return v.GetBody() - case *container.GetExtendedACLRequest: - return v.GetBody() - case *container.GetExtendedACLResponse: - return v.GetBody() - case *container.AnnounceUsedSpaceRequest: - return v.GetBody() - case *container.AnnounceUsedSpaceResponse: - return v.GetBody() - - /* Object */ - case *object.PutRequest: - return v.GetBody() - case *object.PutResponse: - return v.GetBody() - case *object.GetRequest: - return v.GetBody() - case *object.GetResponse: - return v.GetBody() - case *object.HeadRequest: - return v.GetBody() - case *object.HeadResponse: - return v.GetBody() - case *object.SearchRequest: - return v.GetBody() - case *object.SearchResponse: - return v.GetBody() - case *object.DeleteRequest: - return v.GetBody() - case *object.DeleteResponse: - return v.GetBody() - case *object.GetRangeRequest: - return v.GetBody() - case *object.GetRangeResponse: - return v.GetBody() - case *object.GetRangeHashRequest: - return v.GetBody() - case *object.GetRangeHashResponse: - return v.GetBody() - - /* Netmap */ - case *netmap.LocalNodeInfoRequest: - return v.GetBody() - case *netmap.LocalNodeInfoResponse: - return v.GetBody() - case *netmap.NetworkInfoRequest: - return v.GetBody() - case *netmap.NetworkInfoResponse: - return v.GetBody() - case *netmap.SnapshotRequest: - return v.GetBody() - case *netmap.SnapshotResponse: - return v.GetBody() - - /* Reputation */ - case *reputation.AnnounceLocalTrustRequest: - return v.GetBody() - case *reputation.AnnounceLocalTrustResponse: - return v.GetBody() - case *reputation.AnnounceIntermediateResultRequest: - return v.GetBody() - case *reputation.AnnounceIntermediateResultResponse: - return v.GetBody() - } -} diff --git a/signature/verify.go b/signature/verify.go new file mode 100644 index 0000000..fe76844 --- /dev/null +++ b/signature/verify.go @@ -0,0 +1,111 @@ +package signature + +import ( + "errors" + "fmt" + + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/collection" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/signature" +) + +type signatureProvider interface { + GetBodySignature() *refs.Signature + GetMetaSignature() *refs.Signature + GetOriginSignature() *refs.Signature +} + +// VerifyServiceMessage verifies service message. +func VerifyServiceMessage(msg interface{}) error { + switch v := msg.(type) { + case nil: + return nil + case serviceRequest: + return verifyServiceRequest(v) + case serviceResponse: + return verifyServiceResponse(v) + default: + panic(fmt.Sprintf("unsupported session message %T", v)) + } +} + +func verifyServiceRequest(v serviceRequest) error { + meta := v.GetMetaHeader() + verificationHeader := v.GetVerificationHeader() + body := serviceMessageBody(v) + size := collection.Max(body.StableSize(), meta.StableSize(), verificationHeader.StableSize()) + buf := make([]byte, 0, size) + return verifyServiceRequestRecursive(body, meta, verificationHeader, buf) +} + +func verifyServiceRequestRecursive(body stableMarshaler, meta *session.RequestMetaHeader, verify *session.RequestVerificationHeader, buf []byte) error { + verificationHeaderOrigin := verify.GetOrigin() + metaOrigin := meta.GetOrigin() + + stop, err := verifyMessageParts(body, meta, verificationHeaderOrigin, verificationHeaderOrigin != nil, verify, buf) + if err != nil { + return err + } + if stop { + return nil + } + + return verifyServiceRequestRecursive(body, metaOrigin, verificationHeaderOrigin, buf) +} + +func verifyMessageParts(body, meta, originHeader stableMarshaler, hasOriginHeader bool, sigProvider signatureProvider, buf []byte) (stop bool, err error) { + if err := verifyServiceMessagePart(meta, sigProvider.GetMetaSignature, buf); err != nil { + return false, fmt.Errorf("could not verify meta header: %w", err) + } + + if err := verifyServiceMessagePart(originHeader, sigProvider.GetOriginSignature, buf); err != nil { + return false, fmt.Errorf("could not verify origin of verification header: %w", err) + } + + if !hasOriginHeader { + if err := verifyServiceMessagePart(body, sigProvider.GetBodySignature, buf); err != nil { + return false, fmt.Errorf("could not verify body: %w", err) + } + + return true, nil + } + + if sigProvider.GetBodySignature() != nil { + return false, errors.New("body signature misses at the matryoshka upper level") + } + + return false, nil +} + +func verifyServiceResponse(v serviceResponse) error { + meta := v.GetMetaHeader() + verificationHeader := v.GetVerificationHeader() + body := serviceMessageBody(v) + size := collection.Max(body.StableSize(), meta.StableSize(), verificationHeader.StableSize()) + buf := make([]byte, 0, size) + return verifyServiceResponseRecursive(body, meta, verificationHeader, buf) +} + +func verifyServiceResponseRecursive(body stableMarshaler, meta *session.ResponseMetaHeader, verify *session.ResponseVerificationHeader, buf []byte) error { + verificationHeaderOrigin := verify.GetOrigin() + metaOrigin := meta.GetOrigin() + + stop, err := verifyMessageParts(body, meta, verificationHeaderOrigin, verificationHeaderOrigin != nil, verify, buf) + if err != nil { + return err + } + if stop { + return nil + } + + return verifyServiceResponseRecursive(body, metaOrigin, verificationHeaderOrigin, buf) +} + +func verifyServiceMessagePart(part stableMarshaler, sigRdr func() *refs.Signature, buf []byte) error { + return signature.VerifyDataWithSource( + &StableMarshalerWrapper{part}, + sigRdr, + signature.WithBuffer(buf), + ) +} diff --git a/util/collection/slice.go b/util/collection/slice.go new file mode 100644 index 0000000..436f28c --- /dev/null +++ b/util/collection/slice.go @@ -0,0 +1,17 @@ +package collection + +import "golang.org/x/exp/constraints" + +// Max finds maximum value of items. +func Max[T constraints.Ordered](items ...T) T { + if len(items) == 0 { + panic("failed to get max value: empty slice") + } + result := items[0] + for i := 1; i < len(items); i++ { + if items[i] > result { + result = items[i] + } + } + return result +} From e073c996fc9869c4bd11796b17cfc6b49c1eacd9 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 28 Feb 2023 14:43:13 +0300 Subject: [PATCH 009/169] [#3] signature: Add benchmarks Add benchmarks for sign and verify methods Signed-off-by: Dmitrii Stepanov --- signature/sign_test.go | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/signature/sign_test.go b/signature/sign_test.go index ff31954..c013525 100644 --- a/signature/sign_test.go +++ b/signature/sign_test.go @@ -70,3 +70,56 @@ func TestBalanceResponse(t *testing.T) { // verification must fail require.Error(t, VerifyServiceMessage(req)) } + +func BenchmarkSignRequest(b *testing.B) { + key, _ := crypto.LoadPrivateKey("Kwk6k2eC3L3QuPvD8aiaNyoSXgQ2YL1bwS5CP1oKoA9waeAze97s") + + b.ResetTimer() + b.ReportAllocs() + + for i := 0; i < b.N; i++ { + b.StopTimer() + dec := new(accounting.Decimal) + dec.SetValue(100) + + body := new(accounting.BalanceResponseBody) + body.SetBalance(dec) + + meta := new(session.ResponseMetaHeader) + meta.SetTTL(1) + + resp := new(accounting.BalanceResponse) + resp.SetBody(body) + resp.SetMetaHeader(meta) + + b.StartTimer() + SignServiceMessage(key, resp) + } +} + +func BenchmarkVerifyRequest(b *testing.B) { + key, _ := crypto.LoadPrivateKey("Kwk6k2eC3L3QuPvD8aiaNyoSXgQ2YL1bwS5CP1oKoA9waeAze97s") + + b.ResetTimer() + b.ReportAllocs() + + for i := 0; i < b.N; i++ { + b.StopTimer() + dec := new(accounting.Decimal) + dec.SetValue(100) + + body := new(accounting.BalanceResponseBody) + body.SetBalance(dec) + + meta := new(session.ResponseMetaHeader) + meta.SetTTL(1) + + resp := new(accounting.BalanceResponse) + resp.SetBody(body) + resp.SetMetaHeader(meta) + SignServiceMessage(key, resp) + b.StartTimer() + + VerifyServiceMessage(resp) + } +} From 611f73ad0fbf9b33c7fb9d69a3b9791ead0f321e Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 28 Feb 2023 17:47:12 +0300 Subject: [PATCH 010/169] [#3] signature: Sign parts in parallel Sign request/response parts in parallel Signed-off-by: Dmitrii Stepanov --- go.mod | 1 + go.sum | 2 ++ signature/sign.go | 31 +++++++++++++++++++++---------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 1c60a27..fd9049e 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( github.com/mr-tron/base58 v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect + golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.1.0 // indirect golang.org/x/text v0.3.3 // indirect google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect diff --git a/go.sum b/go.sum index c33a4c1..4224bda 100644 --- a/go.sum +++ b/go.sum @@ -84,6 +84,8 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/signature/sign.go b/signature/sign.go index bd53d94..5ed7870 100644 --- a/signature/sign.go +++ b/signature/sign.go @@ -7,6 +7,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/signature" + "golang.org/x/sync/errgroup" ) type serviceRequest interface { @@ -68,23 +69,33 @@ func signServiceResponse(key *ecdsa.PrivateKey, v serviceResponse) error { } func signMessageParts(key *ecdsa.PrivateKey, body, meta, header stableMarshaler, hasHeader bool, result signatureReceiver) error { + eg := &errgroup.Group{} if !hasHeader { // sign session message body - if err := signServiceMessagePart(key, body, result.SetBodySignature); err != nil { - return fmt.Errorf("could not sign body: %w", err) - } + eg.Go(func() error { + if err := signServiceMessagePart(key, body, result.SetBodySignature); err != nil { + return fmt.Errorf("could not sign body: %w", err) + } + return nil + }) } // sign meta header - if err := signServiceMessagePart(key, meta, result.SetMetaSignature); err != nil { - return fmt.Errorf("could not sign meta header: %w", err) - } + eg.Go(func() error { + if err := signServiceMessagePart(key, meta, result.SetMetaSignature); err != nil { + return fmt.Errorf("could not sign meta header: %w", err) + } + return nil + }) // sign verification header origin - if err := signServiceMessagePart(key, header, result.SetOriginSignature); err != nil { - return fmt.Errorf("could not sign origin of verification header: %w", err) - } - return nil + eg.Go(func() error { + if err := signServiceMessagePart(key, header, result.SetOriginSignature); err != nil { + return fmt.Errorf("could not sign origin of verification header: %w", err) + } + return nil + }) + return eg.Wait() } func signServiceMessagePart(key *ecdsa.PrivateKey, part stableMarshaler, sigWrite func(*refs.Signature)) error { From 73fde0e37cdd264bbd3244464d02c1f247ead14b Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 28 Feb 2023 18:52:50 +0300 Subject: [PATCH 011/169] [#3] signature: Verify parts in parallel Verify request/response parts in parallel Signed-off-by: Dmitrii Stepanov --- go.mod | 4 +-- go.sum | 3 +- signature/verify.go | 73 ++++++++++++++++++++++++++++------------ util/collection/slice.go | 17 ---------- 4 files changed, 54 insertions(+), 43 deletions(-) delete mode 100644 util/collection/slice.go diff --git a/go.mod b/go.mod index fd9049e..6fce011 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 github.com/stretchr/testify v1.7.0 - golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 + golang.org/x/sync v0.1.0 google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.0 ) @@ -14,10 +14,10 @@ require ( git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect github.com/davecgh/go-spew v1.1.0 // indirect github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-cmp v0.5.8 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect - golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.1.0 // indirect golang.org/x/text v0.3.3 // indirect google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect diff --git a/go.sum b/go.sum index 4224bda..e81a6ec 100644 --- a/go.sum +++ b/go.sum @@ -48,6 +48,7 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= @@ -64,8 +65,6 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 h1:Jvc7gsqn21cJHCmAWx0LiimpP18LZmUxkT5Mp7EZ1mI= -golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= diff --git a/signature/verify.go b/signature/verify.go index fe76844..08f91d9 100644 --- a/signature/verify.go +++ b/signature/verify.go @@ -6,8 +6,8 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/collection" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/signature" + "golang.org/x/sync/errgroup" ) type signatureProvider interface { @@ -16,6 +16,12 @@ type signatureProvider interface { GetOriginSignature() *refs.Signature } +type buffers struct { + Body []byte + Meta []byte + Header []byte +} + // VerifyServiceMessage verifies service message. func VerifyServiceMessage(msg interface{}) error { switch v := msg.(type) { @@ -34,16 +40,23 @@ func verifyServiceRequest(v serviceRequest) error { meta := v.GetMetaHeader() verificationHeader := v.GetVerificationHeader() body := serviceMessageBody(v) - size := collection.Max(body.StableSize(), meta.StableSize(), verificationHeader.StableSize()) - buf := make([]byte, 0, size) - return verifyServiceRequestRecursive(body, meta, verificationHeader, buf) + buffers := createBuffers(body.StableSize(), meta.StableSize(), verificationHeader.StableSize()) + return verifyServiceRequestRecursive(body, meta, verificationHeader, buffers) } -func verifyServiceRequestRecursive(body stableMarshaler, meta *session.RequestMetaHeader, verify *session.RequestVerificationHeader, buf []byte) error { +func createBuffers(bodySize, metaSize, headerSize int) *buffers { + return &buffers{ + Body: make([]byte, 0, bodySize), + Meta: make([]byte, 0, metaSize), + Header: make([]byte, 0, headerSize), + } +} + +func verifyServiceRequestRecursive(body stableMarshaler, meta *session.RequestMetaHeader, verify *session.RequestVerificationHeader, buffers *buffers) error { verificationHeaderOrigin := verify.GetOrigin() metaOrigin := meta.GetOrigin() - stop, err := verifyMessageParts(body, meta, verificationHeaderOrigin, verificationHeaderOrigin != nil, verify, buf) + stop, err := verifyMessageParts(body, meta, verificationHeaderOrigin, verificationHeaderOrigin != nil, verify, buffers) if err != nil { return err } @@ -51,23 +64,40 @@ func verifyServiceRequestRecursive(body stableMarshaler, meta *session.RequestMe return nil } - return verifyServiceRequestRecursive(body, metaOrigin, verificationHeaderOrigin, buf) + return verifyServiceRequestRecursive(body, metaOrigin, verificationHeaderOrigin, buffers) } -func verifyMessageParts(body, meta, originHeader stableMarshaler, hasOriginHeader bool, sigProvider signatureProvider, buf []byte) (stop bool, err error) { - if err := verifyServiceMessagePart(meta, sigProvider.GetMetaSignature, buf); err != nil { - return false, fmt.Errorf("could not verify meta header: %w", err) +func verifyMessageParts(body, meta, originHeader stableMarshaler, hasOriginHeader bool, sigProvider signatureProvider, buffers *buffers) (stop bool, err error) { + eg := &errgroup.Group{} + + eg.Go(func() error { + if err := verifyServiceMessagePart(meta, sigProvider.GetMetaSignature, buffers.Meta); err != nil { + return fmt.Errorf("could not verify meta header: %w", err) + } + return nil + }) + + eg.Go(func() error { + if err := verifyServiceMessagePart(originHeader, sigProvider.GetOriginSignature, buffers.Header); err != nil { + return fmt.Errorf("could not verify origin of verification header: %w", err) + } + return nil + }) + + if !hasOriginHeader { + eg.Go(func() error { + if err := verifyServiceMessagePart(body, sigProvider.GetBodySignature, buffers.Body); err != nil { + return fmt.Errorf("could not verify body: %w", err) + } + return nil + }) } - if err := verifyServiceMessagePart(originHeader, sigProvider.GetOriginSignature, buf); err != nil { - return false, fmt.Errorf("could not verify origin of verification header: %w", err) + if err := eg.Wait(); err != nil { + return false, err } if !hasOriginHeader { - if err := verifyServiceMessagePart(body, sigProvider.GetBodySignature, buf); err != nil { - return false, fmt.Errorf("could not verify body: %w", err) - } - return true, nil } @@ -82,16 +112,15 @@ func verifyServiceResponse(v serviceResponse) error { meta := v.GetMetaHeader() verificationHeader := v.GetVerificationHeader() body := serviceMessageBody(v) - size := collection.Max(body.StableSize(), meta.StableSize(), verificationHeader.StableSize()) - buf := make([]byte, 0, size) - return verifyServiceResponseRecursive(body, meta, verificationHeader, buf) + buffers := createBuffers(body.StableSize(), meta.StableSize(), verificationHeader.StableSize()) + return verifyServiceResponseRecursive(body, meta, verificationHeader, buffers) } -func verifyServiceResponseRecursive(body stableMarshaler, meta *session.ResponseMetaHeader, verify *session.ResponseVerificationHeader, buf []byte) error { +func verifyServiceResponseRecursive(body stableMarshaler, meta *session.ResponseMetaHeader, verify *session.ResponseVerificationHeader, buffers *buffers) error { verificationHeaderOrigin := verify.GetOrigin() metaOrigin := meta.GetOrigin() - stop, err := verifyMessageParts(body, meta, verificationHeaderOrigin, verificationHeaderOrigin != nil, verify, buf) + stop, err := verifyMessageParts(body, meta, verificationHeaderOrigin, verificationHeaderOrigin != nil, verify, buffers) if err != nil { return err } @@ -99,7 +128,7 @@ func verifyServiceResponseRecursive(body stableMarshaler, meta *session.Response return nil } - return verifyServiceResponseRecursive(body, metaOrigin, verificationHeaderOrigin, buf) + return verifyServiceResponseRecursive(body, metaOrigin, verificationHeaderOrigin, buffers) } func verifyServiceMessagePart(part stableMarshaler, sigRdr func() *refs.Signature, buf []byte) error { diff --git a/util/collection/slice.go b/util/collection/slice.go deleted file mode 100644 index 436f28c..0000000 --- a/util/collection/slice.go +++ /dev/null @@ -1,17 +0,0 @@ -package collection - -import "golang.org/x/exp/constraints" - -// Max finds maximum value of items. -func Max[T constraints.Ordered](items ...T) T { - if len(items) == 0 { - panic("failed to get max value: empty slice") - } - result := items[0] - for i := 1; i < len(items); i++ { - if items[i] > result { - result = items[i] - } - } - return result -} From ec0d0274fa936de70b407b3a50c4a32d24261570 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 9 Mar 2023 11:33:21 +0300 Subject: [PATCH 012/169] [#3] signature: Add buffer pool Signed-off-by: Dmitrii Stepanov --- signature/sign.go | 5 +++- signature/verify.go | 49 ++++++++++++++------------------------- util/signature/buffer.go | 29 +++++++++++++++++++++++ util/signature/data.go | 20 +++++++--------- util/signature/options.go | 22 +++++++----------- 5 files changed, 67 insertions(+), 58 deletions(-) create mode 100644 util/signature/buffer.go diff --git a/signature/sign.go b/signature/sign.go index 5ed7870..49343bd 100644 --- a/signature/sign.go +++ b/signature/sign.go @@ -101,10 +101,13 @@ func signMessageParts(key *ecdsa.PrivateKey, body, meta, header stableMarshaler, func signServiceMessagePart(key *ecdsa.PrivateKey, part stableMarshaler, sigWrite func(*refs.Signature)) error { var sig *refs.Signature + wrapper := StableMarshalerWrapper{ + SM: part, + } // sign part if err := signature.SignDataWithHandler( key, - &StableMarshalerWrapper{part}, + wrapper, func(s *refs.Signature) { sig = s }, diff --git a/signature/verify.go b/signature/verify.go index 08f91d9..67e4a82 100644 --- a/signature/verify.go +++ b/signature/verify.go @@ -16,12 +16,6 @@ type signatureProvider interface { GetOriginSignature() *refs.Signature } -type buffers struct { - Body []byte - Meta []byte - Header []byte -} - // VerifyServiceMessage verifies service message. func VerifyServiceMessage(msg interface{}) error { switch v := msg.(type) { @@ -40,23 +34,14 @@ func verifyServiceRequest(v serviceRequest) error { meta := v.GetMetaHeader() verificationHeader := v.GetVerificationHeader() body := serviceMessageBody(v) - buffers := createBuffers(body.StableSize(), meta.StableSize(), verificationHeader.StableSize()) - return verifyServiceRequestRecursive(body, meta, verificationHeader, buffers) + return verifyServiceRequestRecursive(body, meta, verificationHeader) } -func createBuffers(bodySize, metaSize, headerSize int) *buffers { - return &buffers{ - Body: make([]byte, 0, bodySize), - Meta: make([]byte, 0, metaSize), - Header: make([]byte, 0, headerSize), - } -} - -func verifyServiceRequestRecursive(body stableMarshaler, meta *session.RequestMetaHeader, verify *session.RequestVerificationHeader, buffers *buffers) error { +func verifyServiceRequestRecursive(body stableMarshaler, meta *session.RequestMetaHeader, verify *session.RequestVerificationHeader) error { verificationHeaderOrigin := verify.GetOrigin() metaOrigin := meta.GetOrigin() - stop, err := verifyMessageParts(body, meta, verificationHeaderOrigin, verificationHeaderOrigin != nil, verify, buffers) + stop, err := verifyMessageParts(body, meta, verificationHeaderOrigin, verificationHeaderOrigin != nil, verify) if err != nil { return err } @@ -64,21 +49,21 @@ func verifyServiceRequestRecursive(body stableMarshaler, meta *session.RequestMe return nil } - return verifyServiceRequestRecursive(body, metaOrigin, verificationHeaderOrigin, buffers) + return verifyServiceRequestRecursive(body, metaOrigin, verificationHeaderOrigin) } -func verifyMessageParts(body, meta, originHeader stableMarshaler, hasOriginHeader bool, sigProvider signatureProvider, buffers *buffers) (stop bool, err error) { +func verifyMessageParts(body, meta, originHeader stableMarshaler, hasOriginHeader bool, sigProvider signatureProvider) (stop bool, err error) { eg := &errgroup.Group{} eg.Go(func() error { - if err := verifyServiceMessagePart(meta, sigProvider.GetMetaSignature, buffers.Meta); err != nil { + if err := verifyServiceMessagePart(meta, sigProvider.GetMetaSignature); err != nil { return fmt.Errorf("could not verify meta header: %w", err) } return nil }) eg.Go(func() error { - if err := verifyServiceMessagePart(originHeader, sigProvider.GetOriginSignature, buffers.Header); err != nil { + if err := verifyServiceMessagePart(originHeader, sigProvider.GetOriginSignature); err != nil { return fmt.Errorf("could not verify origin of verification header: %w", err) } return nil @@ -86,7 +71,7 @@ func verifyMessageParts(body, meta, originHeader stableMarshaler, hasOriginHeade if !hasOriginHeader { eg.Go(func() error { - if err := verifyServiceMessagePart(body, sigProvider.GetBodySignature, buffers.Body); err != nil { + if err := verifyServiceMessagePart(body, sigProvider.GetBodySignature); err != nil { return fmt.Errorf("could not verify body: %w", err) } return nil @@ -112,15 +97,14 @@ func verifyServiceResponse(v serviceResponse) error { meta := v.GetMetaHeader() verificationHeader := v.GetVerificationHeader() body := serviceMessageBody(v) - buffers := createBuffers(body.StableSize(), meta.StableSize(), verificationHeader.StableSize()) - return verifyServiceResponseRecursive(body, meta, verificationHeader, buffers) + return verifyServiceResponseRecursive(body, meta, verificationHeader) } -func verifyServiceResponseRecursive(body stableMarshaler, meta *session.ResponseMetaHeader, verify *session.ResponseVerificationHeader, buffers *buffers) error { +func verifyServiceResponseRecursive(body stableMarshaler, meta *session.ResponseMetaHeader, verify *session.ResponseVerificationHeader) error { verificationHeaderOrigin := verify.GetOrigin() metaOrigin := meta.GetOrigin() - stop, err := verifyMessageParts(body, meta, verificationHeaderOrigin, verificationHeaderOrigin != nil, verify, buffers) + stop, err := verifyMessageParts(body, meta, verificationHeaderOrigin, verificationHeaderOrigin != nil, verify) if err != nil { return err } @@ -128,13 +112,16 @@ func verifyServiceResponseRecursive(body stableMarshaler, meta *session.Response return nil } - return verifyServiceResponseRecursive(body, metaOrigin, verificationHeaderOrigin, buffers) + return verifyServiceResponseRecursive(body, metaOrigin, verificationHeaderOrigin) } -func verifyServiceMessagePart(part stableMarshaler, sigRdr func() *refs.Signature, buf []byte) error { +func verifyServiceMessagePart(part stableMarshaler, sigRdr func() *refs.Signature) error { + wrapper := StableMarshalerWrapper{ + SM: part, + } + return signature.VerifyDataWithSource( - &StableMarshalerWrapper{part}, + wrapper, sigRdr, - signature.WithBuffer(buf), ) } diff --git a/util/signature/buffer.go b/util/signature/buffer.go new file mode 100644 index 0000000..2a7f1e0 --- /dev/null +++ b/util/signature/buffer.go @@ -0,0 +1,29 @@ +package signature + +import "sync" + +const poolSliceMaxSize = 64 * 1024 + +var buffersPool = sync.Pool{ + New: func() any { + return make([]byte, 0) + }, +} + +func newBufferFromPool(size int) []byte { + result := buffersPool.Get().([]byte) + if cap(result) < size { + result = make([]byte, size) + } else { + result = result[:size] + } + return result +} + +func returnBufferToPool(buf []byte) { + if cap(buf) > poolSliceMaxSize { + return + } + buf = buf[:0] + buffersPool.Put(buf) +} diff --git a/util/signature/data.go b/util/signature/data.go index 6de9466..d2bf1dc 100644 --- a/util/signature/data.go +++ b/util/signature/data.go @@ -35,7 +35,10 @@ func SignDataWithHandler(key *ecdsa.PrivateKey, src DataSource, handler KeySigna opts[i](cfg) } - data, err := readSignedData(cfg, src) + buffer := newBufferFromPool(src.SignedDataSize()) + defer returnBufferToPool(buffer) + + data, err := src.ReadSignedData(buffer) if err != nil { return err } @@ -61,7 +64,10 @@ func VerifyDataWithSource(dataSrc DataSource, sigSrc KeySignatureSource, opts .. opts[i](cfg) } - data, err := readSignedData(cfg, dataSrc) + buffer := newBufferFromPool(dataSrc.SignedDataSize()) + defer returnBufferToPool(buffer) + + data, err := dataSrc.ReadSignedData(buffer) if err != nil { return err } @@ -76,13 +82,3 @@ func SignData(key *ecdsa.PrivateKey, v DataWithSignature, opts ...SignOption) er func VerifyData(src DataWithSignature, opts ...SignOption) error { return VerifyDataWithSource(src, src.GetSignature, opts...) } - -func readSignedData(cfg *cfg, src DataSource) ([]byte, error) { - size := src.SignedDataSize() - if cfg.buffer == nil || cap(cfg.buffer) < size { - cfg.buffer = make([]byte, size) - } else { - cfg.buffer = cfg.buffer[:size] - } - return src.ReadSignedData(cfg.buffer) -} diff --git a/util/signature/options.go b/util/signature/options.go index 28728dc..a8a3522 100644 --- a/util/signature/options.go +++ b/util/signature/options.go @@ -13,7 +13,6 @@ import ( type cfg struct { schemeFixed bool scheme refs.SignatureScheme - buffer []byte } func defaultCfg() *cfg { @@ -36,9 +35,10 @@ func verify(cfg *cfg, data []byte, sig *refs.Signature) error { case refs.ECDSA_RFC6979_SHA256: return crypto.VerifyRFC6979(pub, data, sig.GetSign()) case refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT: - buf := make([]byte, base64.StdEncoding.EncodedLen(len(data))) - base64.StdEncoding.Encode(buf, data) - if !walletconnect.Verify(pub, buf, sig.GetSign()) { + buffer := newBufferFromPool(base64.StdEncoding.EncodedLen(len(data))) + defer returnBufferToPool(buffer) + base64.StdEncoding.Encode(buffer, data) + if !walletconnect.Verify(pub, buffer, sig.GetSign()) { return crypto.ErrInvalidSignature } return nil @@ -54,9 +54,10 @@ func sign(cfg *cfg, key *ecdsa.PrivateKey, data []byte) ([]byte, error) { case refs.ECDSA_RFC6979_SHA256: return crypto.SignRFC6979(key, data) case refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT: - buf := make([]byte, base64.StdEncoding.EncodedLen(len(data))) - base64.StdEncoding.Encode(buf, data) - return walletconnect.Sign(key, buf) + buffer := newBufferFromPool(base64.StdEncoding.EncodedLen(len(data))) + defer returnBufferToPool(buffer) + base64.StdEncoding.Encode(buffer, data) + return walletconnect.Sign(key, buffer) default: panic(fmt.Sprintf("unsupported scheme %s", cfg.scheme)) } @@ -69,13 +70,6 @@ func SignWithRFC6979() SignOption { } } -// WithBuffer allows providing pre-allocated buffer for signature verification. -func WithBuffer(buf []byte) SignOption { - return func(c *cfg) { - c.buffer = buf - } -} - func SignWithWalletConnect() SignOption { return func(c *cfg) { c.scheme = refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT From c46cd37f7115730366b3e32176947f495ded5165 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Mon, 6 Mar 2023 14:59:51 +0300 Subject: [PATCH 013/169] [#10] Generate api Signed-off-by: Denis Kirillov --- container/grpc/types.pb.go | 10 ++++---- lock/grpc/types.pb.go | 2 +- netmap/grpc/types.pb.go | 2 +- object/grpc/service_grpc.pb.go | 44 +++++++++++++++++----------------- object/grpc/types.pb.go | 10 ++++---- session/grpc/types.pb.go | 6 ++--- storagegroup/grpc/types.pb.go | 2 +- tombstone/grpc/types.pb.go | 2 +- 8 files changed, 39 insertions(+), 39 deletions(-) diff --git a/container/grpc/types.pb.go b/container/grpc/types.pb.go index 75796c2..9c6b2db 100644 --- a/container/grpc/types.pb.go +++ b/container/grpc/types.pb.go @@ -131,16 +131,16 @@ func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { // // There are some "well-known" attributes affecting system behaviour: // -// - __NEOFS__SUBNET \ +// - [ __NEOFS__SUBNET | __FROSTFS__SUBNET ] \ // String ID of a container's storage subnet. Any container can be attached to // one subnet only. -// - __NEOFS__NAME \ +// - [ __NEOFS__NAME | __FROSTFS__NAME ] \ // String of a human-friendly container name registered as a domain in // NNS contract. -// - __NEOFS__ZONE \ -// String of a zone for `__NEOFS__NAME`. Used as a TLD of a domain name in NNS +// - [ __NEOFS__ZONE | __FROSTFS__ZONE ] \ +// String of a zone for `__NEOFS__NAME`/`__FROSTFS__NAME`. Used as a TLD of a domain name in NNS // contract. If no zone is specified, use default zone: `container`. -// - __NEOFS__DISABLE_HOMOMORPHIC_HASHING \ +// - [ __NEOFS__DISABLE_HOMOMORPHIC_HASHING | __FROSTFS__DISABLE_HOMOMORPHIC_HASHING ] \ // Disables homomorphic hashing for the container if the value equals "true" string. // Any other values are interpreted as missing attribute. Container could be // accepted in a NeoFS network only if the global network hashing configuration diff --git a/lock/grpc/types.pb.go b/lock/grpc/types.pb.go index 01e263a..476b9ab 100644 --- a/lock/grpc/types.pb.go +++ b/lock/grpc/types.pb.go @@ -23,7 +23,7 @@ const ( // Lock objects protects a list of objects from being deleted. The lifetime of a // lock object is limited similar to regular objects in -// `__NEOFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. +// `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` 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 diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index 92fea20..ab9cc16 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -827,7 +827,7 @@ func (x *NetworkInfo) GetNetworkConfig() *NetworkConfig { // attributes it's a string presenting floating point number with comma or // point delimiter for decimal part. In the Network Map it will be saved as // 64-bit unsigned integer representing number of minimal token fractions. -// - __NEOFS__SUBNET_%s \ +// - [ __NEOFS__SUBNET_%s | __FROSTFS__SUBNET_%s ] \ // `True` or `False`. Defines if the node is included in the `%s` subnetwork // or not. `%s` must be an existing subnetwork's ID (non-negative integer number). // A node can be included in more than one subnetwork and, therefore, can contain diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 172998c..d3b9314 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -30,11 +30,11 @@ type ObjectServiceClient interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. - // - __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or + // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ + // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH`/`__FROSTFS__NETMAP_EPOCH` if specified or // the latest one otherwise) of Network Map to find an object until the depth // limit is reached. // @@ -63,7 +63,7 @@ type ObjectServiceClient interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -94,7 +94,7 @@ type ObjectServiceClient interface { // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -118,7 +118,7 @@ type ObjectServiceClient interface { // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -144,7 +144,7 @@ type ObjectServiceClient interface { // Specification section for more details. // // Extended headers can change `Search` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -167,10 +167,10 @@ type ObjectServiceClient interface { // order. // // Extended headers can change `GetRange` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. - // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // @@ -199,10 +199,10 @@ type ObjectServiceClient interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. - // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // @@ -402,11 +402,11 @@ type ObjectServiceServer interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. - // - __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or + // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ + // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH`/`__FROSTFS__NETMAP_EPOCH` if specified or // the latest one otherwise) of Network Map to find an object until the depth // limit is reached. // @@ -435,7 +435,7 @@ type ObjectServiceServer interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -466,7 +466,7 @@ type ObjectServiceServer interface { // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -490,7 +490,7 @@ type ObjectServiceServer interface { // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -516,7 +516,7 @@ type ObjectServiceServer interface { // Specification section for more details. // // Extended headers can change `Search` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -539,10 +539,10 @@ type ObjectServiceServer interface { // order. // // Extended headers can change `GetRange` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. - // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // @@ -571,10 +571,10 @@ type ObjectServiceServer interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // - __NEOFS__NETMAP_EPOCH \ + // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. - // - __NEOFS__NETMAP_LOOKUP_DEPTH \ + // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 818bc5e..6622359 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -556,19 +556,19 @@ func (x *SplitInfo) GetLink() *grpc.ObjectID { // Objects with duplicated attribute names or attributes with empty values // will be considered invalid. // -// There are some "well-known" attributes starting with `__NEOFS__` prefix +// There are some "well-known" attributes starting with `__NEOFS__`/`__FROSTFS__` prefix // that affect system behaviour: // -// - __NEOFS__UPLOAD_ID \ +// - [ __NEOFS__UPLOAD_ID | __FROSTFS__UPLOAD_ID ] \ // Marks smaller parts of a split bigger object -// - __NEOFS__EXPIRATION_EPOCH \ +// - [ __NEOFS__EXPIRATION_EPOCH | __FROSTFS__EXPIRATION_EPOCH ] \ // Tells GC to delete object after that epoch -// - __NEOFS__TICK_EPOCH \ +// - [ __NEOFS__TICK_EPOCH | __FROSTFS__TICK_EPOCH ] \ // Decimal number that defines what epoch must produce // object notification with UTF-8 object address in a // body (`0` value produces notification right after // object put) -// - __NEOFS__TICK_TOPIC \ +// - [ __NEOFS__TICK_TOPIC | __FROSTFS__TICK_TOPIC ] \ // UTF-8 string topic ID that is used for object notification // // And some well-known attributes used by applications only: diff --git a/session/grpc/types.pb.go b/session/grpc/types.pb.go index 3ca6001..de89a80 100644 --- a/session/grpc/types.pb.go +++ b/session/grpc/types.pb.go @@ -349,14 +349,14 @@ func (x *SessionToken) GetSignature() *grpc.Signature { // Responses with duplicated header names or headers with empty values will be // considered invalid. // -// There are some "well-known" headers starting with `__NEOFS__` prefix that +// There are some "well-known" headers starting with `__NEOFS__` or `__FROSTFS__` prefix that // affect system behaviour: // -// - __NEOFS__NETMAP_EPOCH \ +// - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Netmap epoch to use for object placement calculation. The `value` is string // encoded `uint64` in decimal presentation. If set to '0' or not set, the // current epoch only will be used. -// - __NEOFS__NETMAP_LOOKUP_DEPTH \ +// - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ // If object can't be found using current epoch's netmap, this header limits // how many past epochs the node can look up through. The `value` is string // encoded `uint64` in decimal presentation. If set to '0' or not set, only the diff --git a/storagegroup/grpc/types.pb.go b/storagegroup/grpc/types.pb.go index 37f88ea..2513f9c 100644 --- a/storagegroup/grpc/types.pb.go +++ b/storagegroup/grpc/types.pb.go @@ -27,7 +27,7 @@ const ( // contains objects from the same container. // // Being an object payload, StorageGroup may have expiration Epoch set with -// `__NEOFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup +// `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup // will be ignored by InnerRing nodes during Data Audit cycles and will be // deleted by Storage Nodes. type StorageGroup struct { diff --git a/tombstone/grpc/types.pb.go b/tombstone/grpc/types.pb.go index 11405ac..86ed356 100644 --- a/tombstone/grpc/types.pb.go +++ b/tombstone/grpc/types.pb.go @@ -30,7 +30,7 @@ type Tombstone struct { // Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone // creator depending on the current NeoFS network settings. A tombstone object - // must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH` + // must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` // attribute. Otherwise, the tombstone will be rejected by a storage node. ExpirationEpoch uint64 `protobuf:"varint,1,opt,name=expiration_epoch,json=expirationEpoch,proto3" json:"expiration_epoch,omitempty"` // 16 byte UUID used to identify the split object hierarchy parts. Must be From cd2e46a17cd739a99a39ff14ab9e036d5e48fee7 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Mon, 6 Mar 2023 15:24:58 +0300 Subject: [PATCH 014/169] [#10] Add __FROSTFS__ system attributes Signed-off-by: Denis Kirillov --- container/attributes.go | 23 ++++++++++++++++++++--- netmap/attributes.go | 14 ++++++++++---- netmap/attributes_test.go | 2 +- object/attributes.go | 29 ++++++++++++++++++++++++----- session/xheaders.go | 17 ++++++++++++++++- 5 files changed, 71 insertions(+), 14 deletions(-) diff --git a/container/attributes.go b/container/attributes.go index eb4b078..356a6b9 100644 --- a/container/attributes.go +++ b/container/attributes.go @@ -1,7 +1,7 @@ package container // SysAttributePrefix is a prefix of key to system attribute. -const SysAttributePrefix = "__NEOFS__" +const SysAttributePrefix = "__FROSTFS__" const ( // SysAttributeSubnet is a string ID of container's storage subnet. @@ -17,6 +17,23 @@ const ( SysAttributeHomomorphicHashing = SysAttributePrefix + "DISABLE_HOMOMORPHIC_HASHING" ) +// SysAttributePrefixNeoFS is a prefix of key to system attribute. +const SysAttributePrefixNeoFS = "__NEOFS__" + +const ( + // SysAttributeSubnetNeoFS is a string ID of container's storage subnet. + SysAttributeSubnetNeoFS = SysAttributePrefixNeoFS + "SUBNET" + + // SysAttributeNameNeoFS is a string of human-friendly container name registered as the domain in NNS contract. + SysAttributeNameNeoFS = SysAttributePrefixNeoFS + "NAME" + + // SysAttributeZoneNeoFS is a string of zone for container name. + SysAttributeZoneNeoFS = SysAttributePrefixNeoFS + "ZONE" + + // SysAttributeHomomorphicHashingNeoFS is a container's homomorphic hashing state. + SysAttributeHomomorphicHashingNeoFS = SysAttributePrefixNeoFS + "DISABLE_HOMOMORPHIC_HASHING" +) + // SysAttributeZoneDefault is a default value for SysAttributeZone attribute. const SysAttributeZoneDefault = "container" @@ -33,7 +50,7 @@ const disabledHomomorphicHashingValue = "true" // See also SetHomomorphicHashingState. func (c Container) HomomorphicHashingState() bool { for i := range c.attr { - if c.attr[i].GetKey() == SysAttributeHomomorphicHashing { + if c.attr[i].GetKey() == SysAttributeHomomorphicHashing || c.attr[i].GetKey() == SysAttributeHomomorphicHashingNeoFS { return c.attr[i].GetValue() != disabledHomomorphicHashingValue } } @@ -50,7 +67,7 @@ func (c Container) HomomorphicHashingState() bool { // See also HomomorphicHashingState. func (c *Container) SetHomomorphicHashingState(enable bool) { for i := range c.attr { - if c.attr[i].GetKey() == SysAttributeHomomorphicHashing { + if c.attr[i].GetKey() == SysAttributeHomomorphicHashing || c.attr[i].GetKey() == SysAttributeHomomorphicHashingNeoFS { if enable { // approach without allocation/waste // coping works since the attributes diff --git a/netmap/attributes.go b/netmap/attributes.go index 719d882..3ebec57 100644 --- a/netmap/attributes.go +++ b/netmap/attributes.go @@ -9,7 +9,10 @@ import ( ) // prefix of keys to subnet attributes. -const attrSubnetPrefix = "__NEOFS__SUBNET_" +const attrSubnetPrefix = "__FROSTFS__SUBNET_" + +// prefix of keys to subnet attributes. +const attrSubnetPrefixNeoFS = "__NEOFS__SUBNET_" const ( // subnet attribute's value denoting subnet entry @@ -62,7 +65,7 @@ func subnetAttributeKey(id *refs.SubnetID) string { // - disables non-zero subnet; // - enables zero subnet. // -// Attribute key is calculated from ID using format `__NEOFS__SUBNET_%s`. +// Attribute key is calculated from ID using format `__FROSTFS__SUBNET_%s`. // Attribute Value is: // - `True` if node enters the subnet; // - `False`, otherwise. @@ -143,8 +146,11 @@ func IterateSubnets(node *NodeInfo, f func(refs.SubnetID) error) error { // cut subnet ID string idTxt := strings.TrimPrefix(key, attrSubnetPrefix) if len(idTxt) == len(key) { - // not a subnet attribute - continue + idTxt = strings.TrimPrefix(key, attrSubnetPrefixNeoFS) + if len(idTxt) == len(key) { + // not a subnet attribute + continue + } } // check value diff --git a/netmap/attributes_test.go b/netmap/attributes_test.go index 6d5b9ea..a2b3be9 100644 --- a/netmap/attributes_test.go +++ b/netmap/attributes_test.go @@ -11,7 +11,7 @@ import ( ) func subnetAttrKey(val string) string { - return "__NEOFS__SUBNET_" + val + return "__FROSTFS__SUBNET_" + val } func assertSubnetAttrKey(t *testing.T, attr *netmap.Attribute, num uint32) { diff --git a/object/attributes.go b/object/attributes.go index cc82873..3293682 100644 --- a/object/attributes.go +++ b/object/attributes.go @@ -7,7 +7,7 @@ import ( ) // SysAttributePrefix is a prefix of key to system attribute. -const SysAttributePrefix = "__NEOFS__" +const SysAttributePrefix = "__FROSTFS__" const ( // SysAttributeUploadID marks smaller parts of a split bigger object. @@ -25,6 +25,25 @@ const ( SysAttributeTickTopic = SysAttributePrefix + "TICK_TOPIC" ) +// SysAttributePrefixNeoFS is a prefix of key to system attribute. +const SysAttributePrefixNeoFS = "__NEOFS__" + +const ( + // SysAttributeUploadIDNeoFS marks smaller parts of a split bigger object. + SysAttributeUploadIDNeoFS = SysAttributePrefixNeoFS + "UPLOAD_ID" + + // SysAttributeExpEpochNeoFS tells GC to delete object after that epoch. + SysAttributeExpEpochNeoFS = SysAttributePrefixNeoFS + "EXPIRATION_EPOCH" + + // SysAttributeTickEpochNeoFS defines what epoch must produce object + // notification. + SysAttributeTickEpochNeoFS = SysAttributePrefixNeoFS + "TICK_EPOCH" + + // SysAttributeTickTopicNeoFS defines what topic object notification + // must be sent to. + SysAttributeTickTopicNeoFS = SysAttributePrefixNeoFS + "TICK_TOPIC" +) + // NotificationInfo groups information about object notification // that can be written to object. // @@ -81,10 +100,10 @@ func WriteNotificationInfo(o *Object, ni NotificationInfo) { for i := range attrs { switch attrs[i].GetKey() { - case SysAttributeTickEpoch: + case SysAttributeTickEpoch, SysAttributeTickEpochNeoFS: attrs[i].SetValue(epoch) changedEpoch = true - case SysAttributeTickTopic: + case SysAttributeTickTopic, SysAttributeTickTopicNeoFS: changedTopic = true if topic == "" { @@ -141,7 +160,7 @@ func GetNotificationInfo(o *Object) (*NotificationInfo, error) { for _, attr := range o.GetHeader().GetAttributes() { switch key := attr.GetKey(); key { - case SysAttributeTickEpoch: + case SysAttributeTickEpoch, SysAttributeTickEpochNeoFS: epoch, err := strconv.ParseUint(attr.GetValue(), 10, 64) if err != nil { return nil, fmt.Errorf("could not parse epoch: %w", err) @@ -150,7 +169,7 @@ func GetNotificationInfo(o *Object) (*NotificationInfo, error) { ni.SetEpoch(epoch) foundEpoch = true - case SysAttributeTickTopic: + case SysAttributeTickTopic, SysAttributeTickTopicNeoFS: ni.SetTopic(attr.GetValue()) } } diff --git a/session/xheaders.go b/session/xheaders.go index 64b16de..ba3ac8d 100644 --- a/session/xheaders.go +++ b/session/xheaders.go @@ -1,7 +1,7 @@ package session // ReservedXHeaderPrefix is a prefix of keys to "well-known" X-headers. -const ReservedXHeaderPrefix = "__NEOFS__" +const ReservedXHeaderPrefix = "__FROSTFS__" const ( // XHeaderNetmapEpoch is a key to the reserved X-header that specifies netmap epoch @@ -14,3 +14,18 @@ const ( // set, the current epoch only will be used. XHeaderNetmapLookupDepth = ReservedXHeaderPrefix + "NETMAP_LOOKUP_DEPTH" ) + +// ReservedXHeaderPrefixNeoFS is a prefix of keys to "well-known" X-headers. +const ReservedXHeaderPrefixNeoFS = "__NEOFS__" + +const ( + // XHeaderNetmapEpochNeoFS is a key to the reserved X-header that specifies netmap epoch + // to use for object placement calculation. If set to '0' or not set, the current + // epoch only will be used. + XHeaderNetmapEpochNeoFS = ReservedXHeaderPrefixNeoFS + "NETMAP_EPOCH" + + // XHeaderNetmapLookupDepthNeoFS is a key to the reserved X-header that limits + // how many past epochs back the node will can lookup. If set to '0' or not + // set, the current epoch only will be used. + XHeaderNetmapLookupDepthNeoFS = ReservedXHeaderPrefixNeoFS + "NETMAP_LOOKUP_DEPTH" +) From 8009022a20aa08c3a0e46e0d956301d1db0385f2 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Wed, 15 Mar 2023 12:23:01 +0300 Subject: [PATCH 015/169] [#13] *: Regenerate api Signed-off-by: Denis Kirillov --- container/grpc/types.pb.go | 14 ++++-- lock/grpc/types.pb.go | 2 +- netmap/grpc/types.pb.go | 3 +- object/grpc/service_grpc.pb.go | 84 +++++++++++++++++++++------------- object/grpc/types.pb.go | 14 ++++-- session/grpc/types.pb.go | 8 ++-- storagegroup/grpc/types.pb.go | 2 +- tombstone/grpc/types.pb.go | 2 +- 8 files changed, 80 insertions(+), 49 deletions(-) diff --git a/container/grpc/types.pb.go b/container/grpc/types.pb.go index 9c6b2db..1044617 100644 --- a/container/grpc/types.pb.go +++ b/container/grpc/types.pb.go @@ -131,16 +131,20 @@ func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { // // There are some "well-known" attributes affecting system behaviour: // -// - [ __NEOFS__SUBNET | __FROSTFS__SUBNET ] \ +// - [ __SYSTEM__SUBNET ] \ +// (`__NEOFS__SUBNET` is deprecated) \ // String ID of a container's storage subnet. Any container can be attached to // one subnet only. -// - [ __NEOFS__NAME | __FROSTFS__NAME ] \ +// - [ __SYSTEM__NAME ] \ +// (`__NEOFS__NAME` is deprecated) \ // String of a human-friendly container name registered as a domain in // NNS contract. -// - [ __NEOFS__ZONE | __FROSTFS__ZONE ] \ -// String of a zone for `__NEOFS__NAME`/`__FROSTFS__NAME`. Used as a TLD of a domain name in NNS +// - [ __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`. -// - [ __NEOFS__DISABLE_HOMOMORPHIC_HASHING | __FROSTFS__DISABLE_HOMOMORPHIC_HASHING ] \ +// - [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \ +// (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ // Disables homomorphic hashing for the container if the value equals "true" string. // Any other values are interpreted as missing attribute. Container could be // accepted in a NeoFS network only if the global network hashing configuration diff --git a/lock/grpc/types.pb.go b/lock/grpc/types.pb.go index 476b9ab..22758c1 100644 --- a/lock/grpc/types.pb.go +++ b/lock/grpc/types.pb.go @@ -23,7 +23,7 @@ const ( // Lock objects protects a list of objects from being deleted. The lifetime of a // lock object is limited similar to regular objects in -// `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. +// `__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 diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index ab9cc16..0f017da 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -827,7 +827,8 @@ func (x *NetworkInfo) GetNetworkConfig() *NetworkConfig { // attributes it's a string presenting floating point number with comma or // point delimiter for decimal part. In the Network Map it will be saved as // 64-bit unsigned integer representing number of minimal token fractions. -// - [ __NEOFS__SUBNET_%s | __FROSTFS__SUBNET_%s ] \ +// - [ __SYSTEM__SUBNET_%s ] \ +// (`__NEOFS__SUBNET_%s` is deprecated) \ // `True` or `False`. Defines if the node is included in the `%s` subnetwork // or not. `%s` must be an existing subnetwork's ID (non-negative integer number). // A node can be included in more than one subnetwork and, therefore, can contain diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index d3b9314..23906d6 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -30,11 +30,13 @@ type ObjectServiceClient interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ // Will use the requsted version of Network Map for object placement // calculation. - // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ - // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH`/`__FROSTFS__NETMAP_EPOCH` if specified or + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or // the latest one otherwise) of Network Map to find an object until the depth // limit is reached. // @@ -63,7 +65,8 @@ type ObjectServiceClient interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH \ + // - [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -94,8 +97,9 @@ type ObjectServiceClient interface { // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. // // Please refer to detailed `XHeader` description. @@ -118,8 +122,9 @@ type ObjectServiceClient interface { // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. // // Please refer to detailed `XHeader` description. @@ -144,8 +149,9 @@ type ObjectServiceClient interface { // Specification section for more details. // // Extended headers can change `Search` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. // // Please refer to detailed `XHeader` description. @@ -167,10 +173,12 @@ type ObjectServiceClient interface { // order. // // Extended headers can change `GetRange` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. - // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // @@ -199,10 +207,12 @@ type ObjectServiceClient interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. - // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // @@ -402,11 +412,13 @@ type ObjectServiceServer interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ // Will use the requsted version of Network Map for object placement // calculation. - // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ - // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH`/`__FROSTFS__NETMAP_EPOCH` if specified or + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or // the latest one otherwise) of Network Map to find an object until the depth // limit is reached. // @@ -435,7 +447,8 @@ type ObjectServiceServer interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH \ + // - [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -466,8 +479,9 @@ type ObjectServiceServer interface { // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. // // Please refer to detailed `XHeader` description. @@ -490,8 +504,9 @@ type ObjectServiceServer interface { // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. // // Please refer to detailed `XHeader` description. @@ -516,8 +531,9 @@ type ObjectServiceServer interface { // Specification section for more details. // // Extended headers can change `Search` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. // // Please refer to detailed `XHeader` description. @@ -539,10 +555,12 @@ type ObjectServiceServer interface { // order. // // Extended headers can change `GetRange` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. - // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // @@ -571,10 +589,12 @@ type ObjectServiceServer interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. - // - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 6622359..506adda 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -556,19 +556,23 @@ func (x *SplitInfo) GetLink() *grpc.ObjectID { // Objects with duplicated attribute names or attributes with empty values // will be considered invalid. // -// There are some "well-known" attributes starting with `__NEOFS__`/`__FROSTFS__` prefix +// There are some "well-known" attributes starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix // that affect system behaviour: // -// - [ __NEOFS__UPLOAD_ID | __FROSTFS__UPLOAD_ID ] \ +// - [ __SYSTEM__UPLOAD_ID ] \ +// (`__NEOFS__UPLOAD_ID` is deprecated) \ // Marks smaller parts of a split bigger object -// - [ __NEOFS__EXPIRATION_EPOCH | __FROSTFS__EXPIRATION_EPOCH ] \ +// - [ __SYSTEM__EXPIRATION_EPOCH ] \ +// (`__NEOFS__EXPIRATION_EPOCH` is deprecated) \ // Tells GC to delete object after that epoch -// - [ __NEOFS__TICK_EPOCH | __FROSTFS__TICK_EPOCH ] \ +// - [ __SYSTEM__TICK_EPOCH ] \ +// (`__NEOFS__TICK_EPOCH` is deprecated) \ // Decimal number that defines what epoch must produce // object notification with UTF-8 object address in a // body (`0` value produces notification right after // object put) -// - [ __NEOFS__TICK_TOPIC | __FROSTFS__TICK_TOPIC ] \ +// - [ __SYSTEM__TICK_TOPIC ] \ +// (`__NEOFS__TICK_TOPIC` is deprecated) \ // UTF-8 string topic ID that is used for object notification // // And some well-known attributes used by applications only: diff --git a/session/grpc/types.pb.go b/session/grpc/types.pb.go index de89a80..ed76725 100644 --- a/session/grpc/types.pb.go +++ b/session/grpc/types.pb.go @@ -349,14 +349,16 @@ func (x *SessionToken) GetSignature() *grpc.Signature { // Responses with duplicated header names or headers with empty values will be // considered invalid. // -// There are some "well-known" headers starting with `__NEOFS__` or `__FROSTFS__` prefix that +// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix that // affect system behaviour: // -// - [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ +// - [ __SYSTEM__NETMAP_EPOCH ] \ +// (`__NEOFS__NETMAP_EPOCH` is deprecated) \ // Netmap epoch to use for object placement calculation. The `value` is string // encoded `uint64` in decimal presentation. If set to '0' or not set, the // current epoch only will be used. -// - [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ +// - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ +// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // If object can't be found using current epoch's netmap, this header limits // how many past epochs the node can look up through. The `value` is string // encoded `uint64` in decimal presentation. If set to '0' or not set, only the diff --git a/storagegroup/grpc/types.pb.go b/storagegroup/grpc/types.pb.go index 2513f9c..6629364 100644 --- a/storagegroup/grpc/types.pb.go +++ b/storagegroup/grpc/types.pb.go @@ -27,7 +27,7 @@ const ( // contains objects from the same container. // // Being an object payload, StorageGroup may have expiration Epoch set with -// `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup +// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) well-known attribute. When expired, StorageGroup // will be ignored by InnerRing nodes during Data Audit cycles and will be // deleted by Storage Nodes. type StorageGroup struct { diff --git a/tombstone/grpc/types.pb.go b/tombstone/grpc/types.pb.go index 86ed356..3365912 100644 --- a/tombstone/grpc/types.pb.go +++ b/tombstone/grpc/types.pb.go @@ -30,7 +30,7 @@ type Tombstone struct { // Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone // creator depending on the current NeoFS network settings. A tombstone object - // must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` + // must have the same expiration epoch value in `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) // attribute. Otherwise, the tombstone will be rejected by a storage node. ExpirationEpoch uint64 `protobuf:"varint,1,opt,name=expiration_epoch,json=expirationEpoch,proto3" json:"expiration_epoch,omitempty"` // 16 byte UUID used to identify the split object hierarchy parts. Must be From 9dc375346703cdcceadf3e3835d80bc4fea32ab4 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Wed, 15 Mar 2023 12:50:43 +0300 Subject: [PATCH 016/169] [#13] *: Rename __FROSTFS__ prefix to __SYSTEM__ Signed-off-by: Denis Kirillov --- container/attributes.go | 7 ++++++- netmap/attributes.go | 5 +++-- netmap/attributes_test.go | 2 +- object/attributes.go | 7 ++++++- session/xheaders.go | 5 ++++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/container/attributes.go b/container/attributes.go index 356a6b9..1d7c94a 100644 --- a/container/attributes.go +++ b/container/attributes.go @@ -1,7 +1,7 @@ package container // SysAttributePrefix is a prefix of key to system attribute. -const SysAttributePrefix = "__FROSTFS__" +const SysAttributePrefix = "__SYSTEM__" const ( // SysAttributeSubnet is a string ID of container's storage subnet. @@ -18,19 +18,24 @@ const ( ) // SysAttributePrefixNeoFS is a prefix of key to system attribute. +// Deprecated: use SysAttributePrefix const SysAttributePrefixNeoFS = "__NEOFS__" const ( // SysAttributeSubnetNeoFS is a string ID of container's storage subnet. + // Deprecated: use SysAttributeSubnet SysAttributeSubnetNeoFS = SysAttributePrefixNeoFS + "SUBNET" // SysAttributeNameNeoFS is a string of human-friendly container name registered as the domain in NNS contract. + // Deprecated: use SysAttributeName SysAttributeNameNeoFS = SysAttributePrefixNeoFS + "NAME" // SysAttributeZoneNeoFS is a string of zone for container name. + // Deprecated: use SysAttributeZone SysAttributeZoneNeoFS = SysAttributePrefixNeoFS + "ZONE" // SysAttributeHomomorphicHashingNeoFS is a container's homomorphic hashing state. + // Deprecated: use SysAttributeHomomorphicHashing SysAttributeHomomorphicHashingNeoFS = SysAttributePrefixNeoFS + "DISABLE_HOMOMORPHIC_HASHING" ) diff --git a/netmap/attributes.go b/netmap/attributes.go index 3ebec57..205376b 100644 --- a/netmap/attributes.go +++ b/netmap/attributes.go @@ -9,9 +9,10 @@ import ( ) // prefix of keys to subnet attributes. -const attrSubnetPrefix = "__FROSTFS__SUBNET_" +const attrSubnetPrefix = "__SYSTEM__SUBNET_" // prefix of keys to subnet attributes. +// Deprecated: use attrSubnetPrefix const attrSubnetPrefixNeoFS = "__NEOFS__SUBNET_" const ( @@ -65,7 +66,7 @@ func subnetAttributeKey(id *refs.SubnetID) string { // - disables non-zero subnet; // - enables zero subnet. // -// Attribute key is calculated from ID using format `__FROSTFS__SUBNET_%s`. +// Attribute key is calculated from ID using format `__SYSTEM__SUBNET_%s`. // Attribute Value is: // - `True` if node enters the subnet; // - `False`, otherwise. diff --git a/netmap/attributes_test.go b/netmap/attributes_test.go index a2b3be9..1a340bd 100644 --- a/netmap/attributes_test.go +++ b/netmap/attributes_test.go @@ -11,7 +11,7 @@ import ( ) func subnetAttrKey(val string) string { - return "__FROSTFS__SUBNET_" + val + return "__SYSTEM__SUBNET_" + val } func assertSubnetAttrKey(t *testing.T, attr *netmap.Attribute, num uint32) { diff --git a/object/attributes.go b/object/attributes.go index 3293682..9aa592f 100644 --- a/object/attributes.go +++ b/object/attributes.go @@ -7,7 +7,7 @@ import ( ) // SysAttributePrefix is a prefix of key to system attribute. -const SysAttributePrefix = "__FROSTFS__" +const SysAttributePrefix = "__SYSTEM__" const ( // SysAttributeUploadID marks smaller parts of a split bigger object. @@ -26,21 +26,26 @@ const ( ) // SysAttributePrefixNeoFS is a prefix of key to system attribute. +// Deprecated: use SysAttributePrefix const SysAttributePrefixNeoFS = "__NEOFS__" const ( // SysAttributeUploadIDNeoFS marks smaller parts of a split bigger object. + // Deprecated: use SysAttributeUploadID SysAttributeUploadIDNeoFS = SysAttributePrefixNeoFS + "UPLOAD_ID" // SysAttributeExpEpochNeoFS tells GC to delete object after that epoch. + // Deprecated: use SysAttributeExpEpoch SysAttributeExpEpochNeoFS = SysAttributePrefixNeoFS + "EXPIRATION_EPOCH" // SysAttributeTickEpochNeoFS defines what epoch must produce object // notification. + // Deprecated: use SysAttributeTickEpoch SysAttributeTickEpochNeoFS = SysAttributePrefixNeoFS + "TICK_EPOCH" // SysAttributeTickTopicNeoFS defines what topic object notification // must be sent to. + // Deprecated: use SysAttributeTickTopic SysAttributeTickTopicNeoFS = SysAttributePrefixNeoFS + "TICK_TOPIC" ) diff --git a/session/xheaders.go b/session/xheaders.go index ba3ac8d..0e02093 100644 --- a/session/xheaders.go +++ b/session/xheaders.go @@ -1,7 +1,7 @@ package session // ReservedXHeaderPrefix is a prefix of keys to "well-known" X-headers. -const ReservedXHeaderPrefix = "__FROSTFS__" +const ReservedXHeaderPrefix = "__SYSTEM__" const ( // XHeaderNetmapEpoch is a key to the reserved X-header that specifies netmap epoch @@ -16,16 +16,19 @@ const ( ) // ReservedXHeaderPrefixNeoFS is a prefix of keys to "well-known" X-headers. +// Deprecated: use ReservedXHeaderPrefix const ReservedXHeaderPrefixNeoFS = "__NEOFS__" const ( // XHeaderNetmapEpochNeoFS is a key to the reserved X-header that specifies netmap epoch // to use for object placement calculation. If set to '0' or not set, the current // epoch only will be used. + // Deprecated: use XHeaderNetmapEpoch XHeaderNetmapEpochNeoFS = ReservedXHeaderPrefixNeoFS + "NETMAP_EPOCH" // XHeaderNetmapLookupDepthNeoFS is a key to the reserved X-header that limits // how many past epochs back the node will can lookup. If set to '0' or not // set, the current epoch only will be used. + // Deprecated: use XHeaderNetmapLookupDepth XHeaderNetmapLookupDepthNeoFS = ReservedXHeaderPrefixNeoFS + "NETMAP_LOOKUP_DEPTH" ) From ee64c0cd51e9896356b0e3893ccb1698f76f5855 Mon Sep 17 00:00:00 2001 From: Liza Date: Wed, 22 Mar 2023 20:54:40 +0300 Subject: [PATCH 017/169] [#14] Add Issue Template Add bug reposrt and feature request templates Signed-off-by: Liza --- .github/ISSUE_TEMPLATE/bug_report.md | 45 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++ 3 files changed, 66 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..7e778d2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,45 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: community, triage, bug +assignees: '' + +--- + + + +## Expected Behavior + + + +## Current Behavior + + + +## Possible Solution + + + + + + +## Steps to Reproduce (for bugs) + + + +1. + +## Context + + + +## Regression + + + +## Your Environment + +* Version used: +* Server setup and configuration: +* Operating System and version (`uname -a`): diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..d6d1162 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: community, triage +assignees: '' + +--- + +## Is your feature request related to a problem? Please describe. + + +## Describe the solution you'd like + + +## Describe alternatives you've considered + + +## Additional context + From 29a562da0ee076a8e4ec9540d63a2f9ed7e1ae35 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 24 Mar 2023 22:06:52 +0300 Subject: [PATCH 018/169] [#15] .gitlint: Synchronize settings across FrostFS repos This change allows to use `[#xx]` placeholders for issue number. Signed-off-by: Evgenii Stratonikov --- .gitlint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlint b/.gitlint index 9ce883f..a1bb93d 100644 --- a/.gitlint +++ b/.gitlint @@ -3,7 +3,7 @@ fail-without-commits=true contrib=CC1 [title-match-regex] -regex=^\[\#[0-9]+\]\s +regex=^\[\#[0-9Xx]+\]\s [ignore-by-title] regex=^Release(.*) From e022a2b831f6f6149609ecf507531ae8061629c9 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Thu, 6 Apr 2023 00:43:56 +0300 Subject: [PATCH 019/169] [#16] object: Allow set `copy_number` for every placement vector Signed-off-by: Pavel Karpy --- object/grpc/service.go | 2 +- object/grpc/service.pb.go | 18 +++++++++++++----- object/marshal.go | 6 ++++-- object/test/generate.go | 2 +- object/types.go | 8 ++++---- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/object/grpc/service.go b/object/grpc/service.go index 44b5f4a..74dc168 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -109,7 +109,7 @@ func (m *PutRequest_Body_Init) SetHeader(v *Header) { } // SetCopiesNumber sets number of the copies to save. -func (m *PutRequest_Body_Init) SetCopiesNumber(v uint32) { +func (m *PutRequest_Body_Init) SetCopiesNumber(v []uint32) { m.CopiesNumber = v } diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index 207b0b0..6ba4090 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -1452,9 +1452,17 @@ type PutRequest_Body_Init struct { Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // Object's Header Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` - // Number of the object copies to store within the RPC call. By default + // Number of copies of the object to store within the RPC call. By default, // object is processed according to the container's placement policy. - CopiesNumber uint32 `protobuf:"varint,4,opt,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` + // Can be one of: + // 1. A single number; applied to the whole request and is treated as + // a minimal number of nodes that must store an object to complete the + // request successfully. + // 2. An ordered array; every number is treated as a minimal number of + // nodes in a corresponding placement vector that must store an object + // to complete the request successfully. The length MUST equal the placement + // vectors number, otherwise request is considered malformed. + CopiesNumber []uint32 `protobuf:"varint,4,rep,packed,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` } func (x *PutRequest_Body_Init) Reset() { @@ -1510,11 +1518,11 @@ func (x *PutRequest_Body_Init) GetHeader() *Header { return nil } -func (x *PutRequest_Body_Init) GetCopiesNumber() uint32 { +func (x *PutRequest_Body_Init) GetCopiesNumber() []uint32 { if x != nil { return x.CopiesNumber } - return 0 + return nil } // PUT Object response body @@ -2457,7 +2465,7 @@ var file_object_grpc_service_proto_rawDesc = []byte{ 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, - 0x70, 0x69, 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x70, 0x69, 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x22, 0xa0, 0x02, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, diff --git a/object/marshal.go b/object/marshal.go index b918e69..7a89b97 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -516,7 +516,7 @@ func (r *PutObjectPartInit) StableMarshal(buf []byte) []byte { offset += proto.NestedStructureMarshal(putReqInitObjectIDField, buf[offset:], r.id) offset += proto.NestedStructureMarshal(putReqInitSignatureField, buf[offset:], r.sig) offset += proto.NestedStructureMarshal(putReqInitHeaderField, buf[offset:], r.hdr) - proto.UInt32Marshal(putReqInitCopiesNumField, buf[offset:], r.copyNum) + proto.RepeatedUInt32Marshal(putReqInitCopiesNumField, buf[offset:], r.copyNum) return buf } @@ -529,7 +529,9 @@ func (r *PutObjectPartInit) StableSize() (size int) { size += proto.NestedStructureSize(putReqInitObjectIDField, r.id) size += proto.NestedStructureSize(putReqInitSignatureField, r.sig) size += proto.NestedStructureSize(putReqInitHeaderField, r.hdr) - size += proto.UInt32Size(putReqInitCopiesNumField, r.copyNum) + + arrSize, _ := proto.RepeatedUInt32Size(putReqInitCopiesNumField, r.copyNum) + size += arrSize return size } diff --git a/object/test/generate.go b/object/test/generate.go index 0816ffc..32d7a3c 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -216,7 +216,7 @@ func GeneratePutObjectPartInit(empty bool) *object.PutObjectPartInit { m := new(object.PutObjectPartInit) if !empty { - m.SetCopiesNumber(234) + m.SetCopiesNumber([]uint32{234}) m.SetObjectID(refstest.GenerateObjectID(false)) } diff --git a/object/types.go b/object/types.go index f076b74..a40de57 100644 --- a/object/types.go +++ b/object/types.go @@ -128,7 +128,7 @@ type PutObjectPartInit struct { hdr *Header - copyNum uint32 + copyNum []uint32 } type PutObjectPartChunk struct { @@ -894,15 +894,15 @@ func (r *PutObjectPartInit) SetHeader(v *Header) { r.hdr = v } -func (r *PutObjectPartInit) GetCopiesNumber() uint32 { +func (r *PutObjectPartInit) GetCopiesNumber() []uint32 { if r != nil { return r.copyNum } - return 0 + return nil } -func (r *PutObjectPartInit) SetCopiesNumber(v uint32) { +func (r *PutObjectPartInit) SetCopiesNumber(v []uint32) { r.copyNum = v } From e6522d62a8795766bf1a8526df190a1e86fd6309 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 7 Apr 2023 15:32:05 +0300 Subject: [PATCH 020/169] [#16] container, object: Regenerate service comments Signed-off-by: Pavel Karpy --- container/grpc/service_grpc.pb.go | 108 +++--- object/grpc/service_grpc.pb.go | 530 +++++++++++++++--------------- 2 files changed, 318 insertions(+), 320 deletions(-) diff --git a/container/grpc/service_grpc.pb.go b/container/grpc/service_grpc.pb.go index 3af498b..1de8b5f 100644 --- a/container/grpc/service_grpc.pb.go +++ b/container/grpc/service_grpc.pb.go @@ -28,9 +28,9 @@ type ContainerServiceClient interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -38,53 +38,53 @@ type ContainerServiceClient interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) } @@ -169,9 +169,9 @@ type ContainerServiceServer interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Put(context.Context, *PutRequest) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -179,53 +179,53 @@ type ContainerServiceServer interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. Get(context.Context, *GetRequest) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). List(context.Context, *ListRequest) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error) } diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 23906d6..6b1c32a 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -30,32 +30,32 @@ type ObjectServiceClient interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -65,107 +65,106 @@ type ObjectServiceClient interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object storage container not found; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has - // + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation SEARCH of the object is denied; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, 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 @@ -173,33 +172,33 @@ type ObjectServiceClient interface { // order. // // Extended headers can change `GetRange` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -207,31 +206,31 @@ type ObjectServiceClient interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) } @@ -412,32 +411,32 @@ type ObjectServiceServer interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Get(*GetRequest, ObjectService_GetServer) error // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -447,107 +446,106 @@ type ObjectServiceServer interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object storage container not found; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has - // + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Put(ObjectService_PutServer) error // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Head(context.Context, *HeadRequest) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation SEARCH of the object is denied; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Search(*SearchRequest, ObjectService_SearchServer) 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 @@ -555,33 +553,33 @@ type ObjectServiceServer interface { // order. // // Extended headers can change `GetRange` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -589,31 +587,31 @@ type ObjectServiceServer interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) } From 3a7280968b28e55a775aabfc54e50271a44a7ee7 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 21 Mar 2023 11:46:56 +0300 Subject: [PATCH 021/169] [#12] tracing: Add tracing dependencies Signed-off-by: Dmitrii Stepanov --- go.mod | 31 +++-- go.sum | 360 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 361 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index 6fce011..7a6dc32 100644 --- a/go.mod +++ b/go.mod @@ -4,22 +4,33 @@ go 1.18 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 - github.com/stretchr/testify v1.7.0 + github.com/stretchr/testify v1.8.2 + go.opentelemetry.io/otel v1.14.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 + go.opentelemetry.io/otel/sdk v1.14.0 + go.opentelemetry.io/otel/trace v1.14.0 golang.org/x/sync v0.1.0 - google.golang.org/grpc v1.48.0 - google.golang.org/protobuf v1.28.0 + google.golang.org/grpc v1.53.0 + google.golang.org/protobuf v1.28.1 ) require ( git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect - github.com/davecgh/go-spew v1.1.0 // indirect + github.com/cenkalti/backoff/v4 v4.2.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-cmp v0.5.8 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/text v0.3.3 // indirect - google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect + go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect + go.opentelemetry.io/proto/otlp v0.19.0 // indirect + golang.org/x/net v0.7.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect + google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e81a6ec..0664c0e 100644 --- a/go.sum +++ b/go.sum @@ -1,34 +1,98 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0/go.mod h1:RUIKZATQLJ+TaYQa60X2fTDwfuhMfm8Ar60bQ5fr+vU= git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9mwVfJ+SjT3HA= git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= +github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -40,84 +104,328 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 h1:/fXHZHGvro6MVqV34fJzDhi7sHGpX3Ej/Qjmfn003ho= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0/go.mod h1:UFG7EBMRdXyFstOwH028U0sVf+AvukSGhF0g8+dmNG8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 h1:TKf2uAs2ueguzLaxOCBXNpHxfO/aC7PAdDsSH0IbeRQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0/go.mod h1:HrbCVv40OOLTABmOn1ZWty6CHXkU8DK/Urc43tHug70= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 h1:ap+y8RXX3Mu9apKVtOkM6WSFESLM8K3wNQyOU8sWHcc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0/go.mod h1:5w41DY6S9gZrbjuq6Y+753e96WfPha5IcsOSZTtullM= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 h1:sEL90JjOO/4yhquXl5zTAkLLsZ5+MycAgX99SDsxGc8= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0/go.mod h1:oCslUcizYdpKYyS9e8srZEqM6BB8fq41VJBjLAE6z1w= +go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= +go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= +go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -126,17 +434,29 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 816628d37db53bd8dfb307a2a0e2c752304939aa Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 21 Mar 2023 11:47:38 +0300 Subject: [PATCH 022/169] [#12] tracing: Add tracing package Add tracing config, implementation and setup Signed-off-by: Dmitrii Stepanov --- pkg/tracing/config.go | 74 ++++++++++ pkg/tracing/config_test.go | 212 +++++++++++++++++++++++++++ pkg/tracing/propagator.go | 96 ++++++++++++ pkg/tracing/propagator_test.go | 257 +++++++++++++++++++++++++++++++++ pkg/tracing/setup.go | 156 ++++++++++++++++++++ pkg/tracing/span.go | 12 ++ 6 files changed, 807 insertions(+) create mode 100644 pkg/tracing/config.go create mode 100644 pkg/tracing/config_test.go create mode 100644 pkg/tracing/propagator.go create mode 100644 pkg/tracing/propagator_test.go create mode 100644 pkg/tracing/setup.go create mode 100644 pkg/tracing/span.go diff --git a/pkg/tracing/config.go b/pkg/tracing/config.go new file mode 100644 index 0000000..001953a --- /dev/null +++ b/pkg/tracing/config.go @@ -0,0 +1,74 @@ +package tracing + +import "fmt" + +// Exporter is type of tracing target. +type Exporter string + +const ( + Stdout Exporter = "stdout" + OTLPgRPC Exporter = "otlp_grpc" +) + +type Config struct { + // Enabled is true, if tracing enabled. + Enabled bool + // Exporter is collector type. + Exporter Exporter + // Endpoint is collector endpoint for OTLP exporters. + Endpoint string + + // Service is service name that will be used in tracing. + // Mandatory. + Service string + // InstanceID is identity of service instance. + // Optional. + InstanceID string + // Version is version of service instance. + // Optional. + Version string +} + +func (c *Config) validate() error { + if !c.Enabled { + return nil + } + + if c.Exporter != Stdout && c.Exporter != OTLPgRPC { + return fmt.Errorf("tracing config error: unknown exporter '%s', valid values are %v", + c.Exporter, []string{string(Stdout), string(OTLPgRPC)}) + } + + if len(c.Service) == 0 { + return fmt.Errorf("tracing config error: service name must be specified") + } + + if c.Exporter == OTLPgRPC && len(c.Endpoint) == 0 { + return fmt.Errorf("tracing config error: exporter '%s' requires endpoint", c.Exporter) + } + + return nil +} + +func (c *Config) hasChange(other *Config) bool { + if !c.Enabled && !other.Enabled { + return false + } + if c.Enabled != other.Enabled { + return true + } + + if c.Exporter == Stdout && other.Exporter == Stdout { + return !c.serviceInfoEqual(other) + } + + return c.Exporter != other.Exporter || + c.Endpoint != other.Endpoint || + !c.serviceInfoEqual(other) +} + +func (c *Config) serviceInfoEqual(other *Config) bool { + return c.Service == other.Service && + c.InstanceID == other.InstanceID && + c.Version == other.Version +} diff --git a/pkg/tracing/config_test.go b/pkg/tracing/config_test.go new file mode 100644 index 0000000..031dd3b --- /dev/null +++ b/pkg/tracing/config_test.go @@ -0,0 +1,212 @@ +package tracing + +import ( + "testing" +) + +func TestConfig_validate(t *testing.T) { + tests := []struct { + name string + config Config + wantErr bool + }{ + { + name: "disabled", + wantErr: false, + config: Config{ + Enabled: false, + }, + }, + { + name: "stdout", + wantErr: false, + config: Config{ + Enabled: true, + Exporter: Stdout, + Service: "test", + InstanceID: "s01", + Version: "v0.0.1", + }, + }, + { + name: "OTLP gRPC", + wantErr: false, + config: Config{ + Enabled: true, + Exporter: OTLPgRPC, + Service: "test", + Endpoint: "localhost:4717", + InstanceID: "s01", + Version: "v0.0.1", + }, + }, + { + name: "unknown exporter", + wantErr: true, + config: Config{ + Enabled: true, + Exporter: "unknown", + Service: "test", + Endpoint: "localhost:4717", + InstanceID: "s01", + Version: "v0.0.1", + }, + }, + { + name: "no exporter", + wantErr: true, + config: Config{ + Enabled: true, + Service: "test", + Endpoint: "localhost:4717", + InstanceID: "s01", + Version: "v0.0.1", + }, + }, + { + name: "no service", + wantErr: true, + config: Config{ + Enabled: true, + Exporter: OTLPgRPC, + Endpoint: "localhost:4717", + InstanceID: "s01", + Version: "v0.0.1", + }, + }, + { + name: "no endpoint for grpc", + wantErr: true, + config: Config{ + Enabled: true, + Exporter: OTLPgRPC, + Service: "test", + InstanceID: "s01", + Version: "v0.0.1", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if err := tt.config.validate(); (err != nil) != tt.wantErr { + t.Errorf("Config.validate() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestConfig_hasChange(t *testing.T) { + tests := []struct { + name string + config Config + other Config + want bool + }{ + { + name: "disabled configs always equal", + want: false, + config: Config{ + Enabled: false, + Exporter: Stdout, + Service: "test", + InstanceID: "s01", + Version: "v1.0.0", + }, + other: Config{ + Enabled: false, + Exporter: OTLPgRPC, + Endpoint: "localhost:4717", + Service: "test", + InstanceID: "s01", + Version: "v1.0.0", + }, + }, + { + name: "enabled", + want: true, + config: Config{ + Enabled: false, + Exporter: OTLPgRPC, + Endpoint: "localhost:4717", + Service: "test", + InstanceID: "s01", + Version: "v1.0.0", + }, + other: Config{ + Enabled: true, + Exporter: OTLPgRPC, + Endpoint: "localhost:4717", + Service: "test", + InstanceID: "s01", + Version: "v1.0.0", + }, + }, + { + name: "disabled", + want: true, + config: Config{ + Enabled: true, + Exporter: OTLPgRPC, + Endpoint: "localhost:4717", + Service: "test", + InstanceID: "s01", + Version: "v1.0.0", + }, + other: Config{ + Enabled: false, + Exporter: OTLPgRPC, + Endpoint: "localhost:4717", + Service: "test", + InstanceID: "s01", + Version: "v1.0.0", + }, + }, + { + name: "do not use endpoint for stdout", + want: false, + config: Config{ + Enabled: true, + Exporter: Stdout, + Endpoint: "localhost:4717", + Service: "test", + InstanceID: "s01", + Version: "v1.0.0", + }, + other: Config{ + Enabled: true, + Exporter: Stdout, + Endpoint: "otherhost:4717", + Service: "test", + InstanceID: "s01", + Version: "v1.0.0", + }, + }, + { + name: "use endpoint for grpc", + want: true, + config: Config{ + Enabled: true, + Exporter: OTLPgRPC, + Endpoint: "localhost:4717", + Service: "test", + InstanceID: "s01", + Version: "v1.0.0", + }, + other: Config{ + Enabled: true, + Exporter: OTLPgRPC, + Endpoint: "otherhost:4717", + Service: "test", + InstanceID: "s01", + Version: "v1.0.0", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := tt.config.hasChange(&tt.other); got != tt.want { + t.Errorf("Config.equal() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/pkg/tracing/propagator.go b/pkg/tracing/propagator.go new file mode 100644 index 0000000..3dabfdc --- /dev/null +++ b/pkg/tracing/propagator.go @@ -0,0 +1,96 @@ +package tracing + +import ( + "context" + "fmt" + "strconv" + + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" +) + +const ( + traceIDHeader = "x-frostfs-trace-id" + spanIDHeader = "x-frostfs-span-id" + flagsHeader = "x-frostfs-trace-flags" +) + +const ( + flagsSampled = 1 << iota +) + +// propagator serializes SpanContext to/from headers. +// x-frostfs-trace-id - TraceID, 16 bytes, hex-string (32 bytes). +// x-frostfs-span-id - SpanID, 8 bytes, hexstring (16 bytes). +// x-frostfs-trace-flags - trace flags (now sampled only). +type propagator struct{} + +// Propagator is propagation.TextMapPropagator instance, used to extract/inject trace info from/to remote context. +var Propagator propagation.TextMapPropagator = &propagator{} + +// Inject injects tracing info to carrier. +func (p *propagator) Inject(ctx context.Context, carrier propagation.TextMapCarrier) { + sc := trace.SpanFromContext(ctx).SpanContext() + if !sc.TraceID().IsValid() || !sc.SpanID().IsValid() { + return + } + + var flags int + if sc.IsSampled() { + flags = flags | flagsSampled + } + + carrier.Set(traceIDHeader, sc.TraceID().String()) + carrier.Set(spanIDHeader, sc.SpanID().String()) + carrier.Set(flagsHeader, fmt.Sprintf("%x", flags)) +} + +// Extract extracts tracing info from carrier and returns context with tracing info. +// In case of error returns ctx. +func (p *propagator) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context { + spanConfig := trace.SpanContextConfig{} + var err error + + traceIDStr := carrier.Get(traceIDHeader) + traceIDDefined := false + if traceIDStr != "" { + traceIDDefined = true + spanConfig.TraceID, err = trace.TraceIDFromHex(traceIDStr) + if err != nil { + return ctx + } + } + + spanIDstr := carrier.Get(spanIDHeader) + spanIDDefined := false + if spanIDstr != "" { + spanIDDefined = true + spanConfig.SpanID, err = trace.SpanIDFromHex(spanIDstr) + if err != nil { + return ctx + } + } + + if traceIDDefined != spanIDDefined { + return ctx //traceID + spanID must be defined OR no traceID and no spanID + } + + flagsStr := carrier.Get(flagsHeader) + if flagsStr != "" { + var v int64 + v, err = strconv.ParseInt(flagsStr, 16, 32) + if err != nil { + return ctx + } + if v&flagsSampled == flagsSampled { + spanConfig.TraceFlags = trace.FlagsSampled + } + } + + return trace.ContextWithRemoteSpanContext(ctx, trace.NewSpanContext(spanConfig)) +} + +// Fields returns the keys whose values are set with Inject. +func (p *propagator) Fields() []string { + return []string{traceIDHeader, spanIDHeader, flagsHeader} +} diff --git a/pkg/tracing/propagator_test.go b/pkg/tracing/propagator_test.go new file mode 100644 index 0000000..fc81e48 --- /dev/null +++ b/pkg/tracing/propagator_test.go @@ -0,0 +1,257 @@ +package tracing + +import ( + "context" + "encoding/hex" + "math/rand" + "testing" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/trace" +) + +type testCarrier struct { + Values map[string]string +} + +func (c *testCarrier) Get(key string) string { + return c.Values[key] +} + +func (c *testCarrier) Set(key string, value string) { + c.Values[key] = value +} + +func (c *testCarrier) Keys() []string { + res := make([]string, 0, len(c.Values)) + for k := range c.Values { + res = append(res, k) + } + return res +} + +var p = &propagator{} + +func TestPropagator_Inject(t *testing.T) { + t.Run("injects trace_id and span_id if valid", func(t *testing.T) { + traceIDBytes := make([]byte, 16) + rand.Read(traceIDBytes) + traceIDHex := hex.EncodeToString(traceIDBytes) + + spanIDBytes := make([]byte, 8) + rand.Read(spanIDBytes) + spanIDHex := hex.EncodeToString(spanIDBytes) + + spanConfig := trace.SpanContextConfig{} + spanConfig.TraceID, _ = trace.TraceIDFromHex(traceIDHex) + spanConfig.SpanID, _ = trace.SpanIDFromHex(spanIDHex) + spanConfig.TraceFlags = trace.FlagsSampled + + ctx := trace.ContextWithRemoteSpanContext(context.Background(), trace.NewSpanContext(spanConfig)) + c := &testCarrier{ + Values: make(map[string]string), + } + p.Inject(ctx, c) + + require.Equal(t, 3, len(c.Values), "not all headers were saved") + require.Equal(t, traceIDHex, c.Values[traceIDHeader], "unexpected trace id") + require.Equal(t, spanIDHex, c.Values[spanIDHeader], "unexpected span id") + require.Equal(t, "1", c.Values[flagsHeader], "unexpected flags") + }) + t.Run("doesn't injects if trace_id is invalid", func(t *testing.T) { + traceIDBytes := make([]byte, 16) + traceIDHex := hex.EncodeToString(traceIDBytes) + + spanIDBytes := make([]byte, 8) + rand.Read(spanIDBytes) + spanIDHex := hex.EncodeToString(spanIDBytes) + + spanConfig := trace.SpanContextConfig{} + spanConfig.TraceID, _ = trace.TraceIDFromHex(traceIDHex) + spanConfig.SpanID, _ = trace.SpanIDFromHex(spanIDHex) + spanConfig.TraceFlags = trace.FlagsSampled + + ctx := trace.ContextWithRemoteSpanContext(context.Background(), trace.NewSpanContext(spanConfig)) + c := &testCarrier{ + Values: make(map[string]string), + } + p.Inject(ctx, c) + + require.Equal(t, 0, len(c.Values), "some headers were saved") + }) + t.Run("doesn't injects if span_id is invalid", func(t *testing.T) { + traceIDBytes := make([]byte, 16) + rand.Read(traceIDBytes) + traceIDHex := hex.EncodeToString(traceIDBytes) + + spanIDBytes := make([]byte, 8) + spanIDHex := hex.EncodeToString(spanIDBytes) + + spanConfig := trace.SpanContextConfig{} + spanConfig.TraceID, _ = trace.TraceIDFromHex(traceIDHex) + spanConfig.SpanID, _ = trace.SpanIDFromHex(spanIDHex) + spanConfig.TraceFlags = trace.FlagsSampled + + ctx := trace.ContextWithRemoteSpanContext(context.Background(), trace.NewSpanContext(spanConfig)) + c := &testCarrier{ + Values: make(map[string]string), + } + p.Inject(ctx, c) + + require.Equal(t, 0, len(c.Values), "some headers were saved") + }) + t.Run("injects flags if no flags specified", func(t *testing.T) { + traceIDBytes := make([]byte, 16) + rand.Read(traceIDBytes) + traceIDHex := hex.EncodeToString(traceIDBytes) + + spanIDBytes := make([]byte, 8) + rand.Read(spanIDBytes) + spanIDHex := hex.EncodeToString(spanIDBytes) + + spanConfig := trace.SpanContextConfig{} + spanConfig.TraceID, _ = trace.TraceIDFromHex(traceIDHex) + spanConfig.SpanID, _ = trace.SpanIDFromHex(spanIDHex) + + ctx := trace.ContextWithRemoteSpanContext(context.Background(), trace.NewSpanContext(spanConfig)) + c := &testCarrier{ + Values: make(map[string]string), + } + p.Inject(ctx, c) + + require.Equal(t, 3, len(c.Values), "not all headers were saved") + require.Equal(t, traceIDHex, c.Values[traceIDHeader], "unexpected trace id") + require.Equal(t, spanIDHex, c.Values[spanIDHeader], "unexpected span id") + require.Equal(t, "0", c.Values[flagsHeader], "unexpected flags") + }) + +} + +func TestPropagator_Extract(t *testing.T) { + t.Run("extracts if set", func(t *testing.T) { + c := &testCarrier{ + Values: make(map[string]string), + } + + traceIDBytes := make([]byte, 16) + rand.Read(traceIDBytes) + traceIDHex := hex.EncodeToString(traceIDBytes) + c.Values[traceIDHeader] = traceIDHex + + spanIDBytes := make([]byte, 8) + rand.Read(spanIDBytes) + spanIDHex := hex.EncodeToString(spanIDBytes) + c.Values[spanIDHeader] = spanIDHex + + c.Values[flagsHeader] = "1" + + ctx := p.Extract(context.Background(), c) + + sc := trace.SpanFromContext(ctx).SpanContext() + require.True(t, sc.HasTraceID(), "trace_id was not set") + require.Equal(t, traceIDHex, sc.TraceID().String(), "trace_id doesn't match") + require.True(t, sc.HasSpanID(), "span_id was not set") + require.Equal(t, spanIDHex, sc.SpanID().String(), "span_id doesn't match") + require.True(t, sc.IsSampled(), "sampled was not set") + }) + t.Run("not extracts if only trace_id defined", func(t *testing.T) { + c := &testCarrier{ + Values: make(map[string]string), + } + + traceIDBytes := make([]byte, 16) + rand.Read(traceIDBytes) + traceIDHex := hex.EncodeToString(traceIDBytes) + c.Values[traceIDHeader] = traceIDHex + c.Values[flagsHeader] = "1" + + ctx := p.Extract(context.Background(), c) + + sc := trace.SpanFromContext(ctx).SpanContext() + require.False(t, sc.HasTraceID(), "trace_id was set") + require.False(t, sc.HasSpanID(), "span_id was set") + require.False(t, sc.IsSampled(), "sampled was set") + }) + t.Run("not extracts if only span_id defined", func(t *testing.T) { + c := &testCarrier{ + Values: make(map[string]string), + } + + spanIDBytes := make([]byte, 8) + rand.Read(spanIDBytes) + spanIDHex := hex.EncodeToString(spanIDBytes) + c.Values[spanIDHeader] = spanIDHex + c.Values[flagsHeader] = "1" + + ctx := p.Extract(context.Background(), c) + + sc := trace.SpanFromContext(ctx).SpanContext() + require.False(t, sc.HasTraceID(), "trace_id was set") + require.False(t, sc.HasSpanID(), "span_id was set") + require.False(t, sc.IsSampled(), "sampled was set") + }) + t.Run("not extracts if trace_id is in invalid", func(t *testing.T) { + c := &testCarrier{ + Values: make(map[string]string), + } + + c.Values[traceIDHeader] = "loren ipsum" + + spanIDBytes := make([]byte, 8) + rand.Read(spanIDBytes) + spanIDHex := hex.EncodeToString(spanIDBytes) + c.Values[spanIDHeader] = spanIDHex + c.Values[flagsHeader] = "1" + + ctx := p.Extract(context.Background(), c) + + sc := trace.SpanFromContext(ctx).SpanContext() + require.False(t, sc.HasTraceID(), "trace_id was set") + require.False(t, sc.HasSpanID(), "span_id was set") + require.False(t, sc.IsSampled(), "sampled was set") + }) + t.Run("not extracts if span_id is invalid", func(t *testing.T) { + c := &testCarrier{ + Values: make(map[string]string), + } + + c.Values[spanIDHeader] = "loren ipsum" + + traceIDBytes := make([]byte, 16) + rand.Read(traceIDBytes) + traceIDHex := hex.EncodeToString(traceIDBytes) + c.Values[traceIDHeader] = traceIDHex + c.Values[flagsHeader] = "1" + + ctx := p.Extract(context.Background(), c) + + sc := trace.SpanFromContext(ctx).SpanContext() + require.False(t, sc.HasTraceID(), "trace_id was set") + require.False(t, sc.HasSpanID(), "span_id was set") + require.False(t, sc.IsSampled(), "sampled was set") + }) + t.Run("not extracts if flags is invalid", func(t *testing.T) { + c := &testCarrier{ + Values: make(map[string]string), + } + + traceIDBytes := make([]byte, 16) + rand.Read(traceIDBytes) + traceIDHex := hex.EncodeToString(traceIDBytes) + c.Values[traceIDHeader] = traceIDHex + + spanIDBytes := make([]byte, 8) + rand.Read(spanIDBytes) + spanIDHex := hex.EncodeToString(spanIDBytes) + c.Values[spanIDHeader] = spanIDHex + + c.Values[flagsHeader] = "loren ipsum" + + ctx := p.Extract(context.Background(), c) + + sc := trace.SpanFromContext(ctx).SpanContext() + require.False(t, sc.HasTraceID(), "trace_id was set") + require.False(t, sc.HasSpanID(), "span_id was set") + require.False(t, sc.IsSampled(), "sampled was set") + }) +} diff --git a/pkg/tracing/setup.go b/pkg/tracing/setup.go new file mode 100644 index 0000000..3df069e --- /dev/null +++ b/pkg/tracing/setup.go @@ -0,0 +1,156 @@ +package tracing + +import ( + "context" + "fmt" + "sync" + "sync/atomic" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" + "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" + "go.opentelemetry.io/otel/sdk/resource" + sdktrace "go.opentelemetry.io/otel/sdk/trace" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + "go.opentelemetry.io/otel/trace" +) + +var ( + // tracingLock protects provider, done, config and tracer from concurrent update. + // These fields change when the config is updated or the application is shutdown. + tracingLock = &sync.Mutex{} + + provider *sdktrace.TracerProvider + done bool + + config = Config{} + tracer = getDefaultTracer() +) + +// Setup initializes global tracer. +// Returns true if global tracer was updated. +// Shutdown method must be called for graceful shutdown. +func Setup(ctx context.Context, cfg Config) (bool, error) { + if err := cfg.validate(); err != nil { + return false, err + } + + tracingLock.Lock() + defer tracingLock.Unlock() + + if done { + return false, fmt.Errorf("failed to setup tracing: already shutdown") + } + + if !config.hasChange(&cfg) { + return false, nil + } + + if !cfg.Enabled { + config = cfg + tracer.Store(&tracerHolder{Tracer: trace.NewNoopTracerProvider().Tracer("")}) + return true, flushAndShutdown(ctx) + } + + exp, err := getExporter(ctx, &cfg) + if err != nil { + return false, err + } + + prevProvider := provider + + provider = sdktrace.NewTracerProvider( + sdktrace.WithBatcher(exp), + sdktrace.WithResource(newResource(&cfg)), + ) + + config = cfg + tracer.Store(&tracerHolder{Tracer: provider.Tracer(cfg.Service)}) + + var retErr error + if prevProvider != nil { + retErr = prevProvider.ForceFlush(ctx) + if err := prevProvider.Shutdown(ctx); err != nil { + if retErr == nil { + retErr = err + } else { + retErr = fmt.Errorf("%v ; %v", retErr, err) + } + } + } + + return true, retErr +} + +// Shutdown shutdowns tracing. +func Shutdown(ctx context.Context) error { + tracingLock.Lock() + defer tracingLock.Unlock() + + if done { + return nil + } + + done = true + + config = Config{} + tracer.Store(&tracerHolder{Tracer: trace.NewNoopTracerProvider().Tracer("")}) + + return flushAndShutdown(ctx) +} + +func getDefaultTracer() *atomic.Value { + v := &atomic.Value{} + v.Store(&tracerHolder{Tracer: trace.NewNoopTracerProvider().Tracer("")}) + return v +} + +func flushAndShutdown(ctx context.Context) error { + if provider == nil { + return nil + } + + tmp := provider + provider = nil + var retErr error + retErr = tmp.ForceFlush(ctx) + if err := tmp.Shutdown(ctx); err != nil { + if retErr == nil { + retErr = err + } else { + retErr = fmt.Errorf("%v ; %v", retErr, err) + } + } + return retErr +} + +func getExporter(ctx context.Context, cfg *Config) (sdktrace.SpanExporter, error) { + switch cfg.Exporter { + default: + return nil, fmt.Errorf("failed to setup tracing: unknown tracing exporter (%s)", cfg.Exporter) + case Stdout: + return stdouttrace.New() + case OTLPgRPC: + return otlptracegrpc.New(ctx, otlptracegrpc.WithEndpoint(cfg.Endpoint), otlptracegrpc.WithInsecure()) + } +} + +func newResource(cfg *Config) *resource.Resource { + attrs := []attribute.KeyValue{ + semconv.ServiceName(cfg.Service), + } + if len(cfg.Version) > 0 { + attrs = append(attrs, semconv.ServiceVersion(cfg.Version)) + } + if len(cfg.InstanceID) > 0 { + attrs = append(attrs, semconv.ServiceInstanceID(cfg.InstanceID)) + } + return resource.NewWithAttributes( + semconv.SchemaURL, + attrs..., + ) +} + +type tracerHolder struct { + Tracer trace.Tracer +} diff --git a/pkg/tracing/span.go b/pkg/tracing/span.go new file mode 100644 index 0000000..5e28c75 --- /dev/null +++ b/pkg/tracing/span.go @@ -0,0 +1,12 @@ +package tracing + +import ( + "context" + + "go.opentelemetry.io/otel/trace" +) + +// StartSpanFromContext creates a span and a context.Context containing the newly-created span. +func StartSpanFromContext(ctx context.Context, operationName string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { + return tracer.Load().(*tracerHolder).Tracer.Start(ctx, operationName, opts...) +} From 488ee50f9e6968aa7e23a195de1a89492857a66c Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 17 Mar 2023 15:54:33 +0300 Subject: [PATCH 023/169] [#12] tracing: Add gRPC middleware Signed-off-by: Dmitrii Stepanov --- pkg/tracing/grpc.go | 136 ++++++++++++++++++++++++++++++ pkg/tracing/grpc_internal.go | 159 +++++++++++++++++++++++++++++++++++ rpc/client/client.go | 10 +++ 3 files changed, 305 insertions(+) create mode 100644 pkg/tracing/grpc.go create mode 100644 pkg/tracing/grpc_internal.go diff --git a/pkg/tracing/grpc.go b/pkg/tracing/grpc.go new file mode 100644 index 0000000..cea59b0 --- /dev/null +++ b/pkg/tracing/grpc.go @@ -0,0 +1,136 @@ +package tracing + +import ( + "context" + "io" + + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + "go.opentelemetry.io/otel/trace" + "google.golang.org/grpc" + grpc_codes "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// NewGRPCUnaryClientInteceptor creates new gRPC unary interceptor to save gRPC client traces. +func NewGRPCUnaryClientInteceptor() grpc.UnaryClientInterceptor { + return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { + ctx, span := startClientSpan(ctx, cc, method) + defer span.End() + + err := invoker(ctx, method, req, reply, cc, opts...) + if err != nil { + grpcStatus, _ := status.FromError(err) + span.SetStatus(codes.Error, grpcStatus.Message()) + span.SetAttributes(semconv.RPCGRPCStatusCodeKey.Int64(int64(grpcStatus.Code()))) + } else { + span.SetStatus(codes.Ok, "") + span.SetAttributes(semconv.RPCGRPCStatusCodeKey.Int64(int64(grpc_codes.OK))) + } + + return err + } +} + +// NewGRPCStreamClientInterceptor creates new gRPC stream interceptor to save gRPC client traces. +func NewGRPCStreamClientInterceptor() grpc.StreamClientInterceptor { + return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { + ctx, span := startClientSpan(ctx, cc, method) + str, err := streamer(ctx, desc, cc, method, opts...) + if err != nil { + grpcStatus, _ := status.FromError(err) + span.SetStatus(codes.Error, grpcStatus.Message()) + span.SetAttributes(semconv.RPCGRPCStatusCodeKey.Int64(int64(grpcStatus.Code()))) + span.End() + return str, err + } + + finished := make(chan error) + done := make(chan struct{}) + strWrp := newgRPCClientStream(str, desc, finished, done) + + go func() { + defer close(finished) + defer close(done) + defer span.End() + + select { + case err := <-finished: + if err == nil || err == io.EOF { + setGRPCSpanStatus(span, nil) + } else { + setGRPCSpanStatus(span, err) + } + return + case <-ctx.Done(): + setGRPCSpanStatus(span, ctx.Err()) + return + } + }() + + return strWrp, nil + } +} + +// NewGRPCUnaryServerInterceptor creates new gRPC unary interceptor to save gRPC server traces. +func NewGRPCUnaryServerInterceptor() grpc.UnaryServerInterceptor { + return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { + ctx = extractGRPCTraceInfo(ctx) + var span trace.Span + ctx, span = StartSpanFromContext(ctx, info.FullMethod, + trace.WithAttributes( + semconv.RPCSystemGRPC, + semconv.RPCMethod(info.FullMethod), + ), + trace.WithSpanKind(trace.SpanKindServer)) + defer span.End() + + resp, err = handler(ctx, req) + + setGRPCSpanStatus(span, err) + return + } +} + +// NewGRPCStreamServerInterceptor creates new gRPC stream interceptor to save gRPC server traces. +func NewGRPCStreamServerInterceptor() grpc.StreamServerInterceptor { + return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + ctx := extractGRPCTraceInfo(ss.Context()) + var span trace.Span + ctx, span = StartSpanFromContext(ctx, info.FullMethod, + trace.WithAttributes( + semconv.RPCSystemGRPC, + semconv.RPCMethod(info.FullMethod), + ), + trace.WithSpanKind(trace.SpanKindServer)) + defer span.End() + + err := handler(srv, newgRPCServerStream(ctx, ss)) + + setGRPCSpanStatus(span, err) + return err + } +} + +func startClientSpan(ctx context.Context, cc *grpc.ClientConn, method string) (context.Context, trace.Span) { + ctx, span := StartSpanFromContext(ctx, method, trace.WithAttributes( + semconv.RPCSystemGRPC, + semconv.RPCMethod(method), + attribute.String("rpc.grpc.target", cc.Target())), + trace.WithSpanKind(trace.SpanKindClient), + ) + ctx = setGRPCTraceInfo(ctx) + return ctx, span +} + +func setGRPCSpanStatus(span trace.Span, err error) { + if err != nil { + grpcStatus, _ := status.FromError(err) + span.SetStatus(codes.Error, grpcStatus.Message()) + span.SetAttributes(semconv.RPCGRPCStatusCodeKey.Int64(int64(grpcStatus.Code()))) + } else { + span.SetStatus(codes.Ok, "") + span.SetAttributes(semconv.RPCGRPCStatusCodeKey.Int64(int64(grpc_codes.OK))) + } +} diff --git a/pkg/tracing/grpc_internal.go b/pkg/tracing/grpc_internal.go new file mode 100644 index 0000000..25cf026 --- /dev/null +++ b/pkg/tracing/grpc_internal.go @@ -0,0 +1,159 @@ +package tracing + +import ( + "context" + + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" +) + +type grpcMetadataCarrier struct { + md *metadata.MD +} + +func (c *grpcMetadataCarrier) Get(key string) string { + values := c.md.Get(key) + if len(values) > 0 { + return values[0] + } + return "" +} + +func (c *grpcMetadataCarrier) Set(key string, value string) { + c.md.Set(key, value) +} + +func (c *grpcMetadataCarrier) Keys() []string { + result := make([]string, 0, c.md.Len()) + for key := range *c.md { + result = append(result, key) + } + return result +} + +func extractGRPCTraceInfo(ctx context.Context) context.Context { + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return ctx + } + carrier := &grpcMetadataCarrier{ + md: &md, + } + return Propagator.Extract(ctx, carrier) +} + +func setGRPCTraceInfo(ctx context.Context) context.Context { + md, ok := metadata.FromOutgoingContext(ctx) + if !ok { + md = metadata.MD{} + } + carrier := &grpcMetadataCarrier{ + md: &md, + } + Propagator.Inject(ctx, carrier) + return metadata.NewOutgoingContext(ctx, md) +} + +type clientStream struct { + originalStream grpc.ClientStream + desc *grpc.StreamDesc + finished chan<- error + done <-chan struct{} +} + +func newgRPCClientStream(originalStream grpc.ClientStream, desc *grpc.StreamDesc, finished chan<- error, done <-chan struct{}) grpc.ClientStream { + return &clientStream{ + originalStream: originalStream, + desc: desc, + finished: finished, + done: done, + } +} + +func (cs *clientStream) Header() (metadata.MD, error) { + md, err := cs.originalStream.Header() + if err != nil { + select { + case <-cs.done: + case cs.finished <- err: + } + } + return md, err +} + +func (cs *clientStream) Trailer() metadata.MD { + return cs.originalStream.Trailer() +} + +func (cs *clientStream) CloseSend() error { + err := cs.originalStream.CloseSend() + if err != nil { + select { + case <-cs.done: + case cs.finished <- err: + } + } + return err +} + +func (cs *clientStream) Context() context.Context { + return cs.originalStream.Context() +} + +func (cs *clientStream) SendMsg(m interface{}) error { + err := cs.originalStream.SendMsg(m) + if err != nil { + select { + case <-cs.done: + case cs.finished <- err: + } + } + return err +} + +func (cs *clientStream) RecvMsg(m interface{}) error { + err := cs.originalStream.RecvMsg(m) + if err != nil || !cs.desc.ServerStreams { + select { + case <-cs.done: + case cs.finished <- err: + } + } + return err +} + +type serverStream struct { + originalStream grpc.ServerStream + ctx context.Context +} + +func newgRPCServerStream(ctx context.Context, originalStream grpc.ServerStream) grpc.ServerStream { + return &serverStream{ + originalStream: originalStream, + ctx: ctx, + } +} + +func (ss *serverStream) SetHeader(md metadata.MD) error { + return ss.originalStream.SendHeader(md) +} + +func (ss *serverStream) SendHeader(md metadata.MD) error { + return ss.originalStream.SendHeader(md) +} + +func (ss *serverStream) SetTrailer(md metadata.MD) { + ss.originalStream.SetTrailer(md) +} + +func (ss *serverStream) Context() context.Context { + return ss.ctx +} + +func (ss *serverStream) SendMsg(m interface{}) error { + return ss.originalStream.SendMsg(m) +} + +func (ss *serverStream) RecvMsg(m interface{}) error { + return ss.originalStream.RecvMsg(m) +} diff --git a/rpc/client/client.go b/rpc/client/client.go index 7e914db..4d12849 100644 --- a/rpc/client/client.go +++ b/rpc/client/client.go @@ -1,6 +1,7 @@ package client import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/pkg/tracing" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) @@ -24,5 +25,14 @@ func New(opts ...Option) *Client { c.grpcDialOpts = append(c.grpcDialOpts, grpc.WithTransportCredentials(credentials.NewTLS(c.tlsCfg))) } + c.grpcDialOpts = append(c.grpcDialOpts, + grpc.WithChainUnaryInterceptor( + tracing.NewGRPCUnaryClientInteceptor(), + ), + grpc.WithChainStreamInterceptor( + tracing.NewGRPCStreamClientInterceptor(), + ), + ) + return &c } From a4e361a2e68ccbb8fbd523dacbaafad83f2ddea1 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 17 Mar 2023 15:55:12 +0300 Subject: [PATCH 024/169] [#12] changelog: Add info about tracing Signed-off-by: Dmitrii Stepanov --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b31e83..da58198 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] ### Added +- Basic tracing support (#12) ### Fixed ### Changed ### Updated From d9c5b9c90ee2676fbde9a0dbc065561e14669629 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 11 Apr 2023 10:35:10 +0300 Subject: [PATCH 025/169] Revert "[#16] container, object: Regenerate service comments" This reverts commit e6522d62a8795766bf1a8526df190a1e86fd6309. --- container/grpc/service_grpc.pb.go | 108 +++--- object/grpc/service_grpc.pb.go | 530 +++++++++++++++--------------- 2 files changed, 320 insertions(+), 318 deletions(-) diff --git a/container/grpc/service_grpc.pb.go b/container/grpc/service_grpc.pb.go index 1de8b5f..3af498b 100644 --- a/container/grpc/service_grpc.pb.go +++ b/container/grpc/service_grpc.pb.go @@ -28,9 +28,9 @@ type ContainerServiceClient interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -38,53 +38,53 @@ type ContainerServiceClient interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) } @@ -169,9 +169,9 @@ type ContainerServiceServer interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Put(context.Context, *PutRequest) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -179,53 +179,53 @@ type ContainerServiceServer interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. Get(context.Context, *GetRequest) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). List(context.Context, *ListRequest) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error) } diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 6b1c32a..23906d6 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -30,32 +30,32 @@ type ObjectServiceClient interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -65,106 +65,107 @@ type ObjectServiceClient interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object storage container not found; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation SEARCH of the object is denied; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, 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 @@ -172,33 +173,33 @@ type ObjectServiceClient interface { // order. // // Extended headers can change `GetRange` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -206,31 +207,31 @@ type ObjectServiceClient interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) } @@ -411,32 +412,32 @@ type ObjectServiceServer interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Get(*GetRequest, ObjectService_GetServer) error // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -446,106 +447,107 @@ type ObjectServiceServer interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object storage container not found; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Put(ObjectService_PutServer) error // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Head(context.Context, *HeadRequest) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation SEARCH of the object is denied; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Search(*SearchRequest, ObjectService_SearchServer) 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 @@ -553,33 +555,33 @@ type ObjectServiceServer interface { // order. // // Extended headers can change `GetRange` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -587,31 +589,31 @@ type ObjectServiceServer interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) } From dbcd51474873ea6c49de081fff35aa74a13b30b8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 11 Apr 2023 10:35:11 +0300 Subject: [PATCH 026/169] Revert "[#16] object: Allow set `copy_number` for every placement vector" This reverts commit e022a2b831f6f6149609ecf507531ae8061629c9. --- object/grpc/service.go | 2 +- object/grpc/service.pb.go | 18 +++++------------- object/marshal.go | 6 ++---- object/test/generate.go | 2 +- object/types.go | 8 ++++---- 5 files changed, 13 insertions(+), 23 deletions(-) diff --git a/object/grpc/service.go b/object/grpc/service.go index 74dc168..44b5f4a 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -109,7 +109,7 @@ func (m *PutRequest_Body_Init) SetHeader(v *Header) { } // SetCopiesNumber sets number of the copies to save. -func (m *PutRequest_Body_Init) SetCopiesNumber(v []uint32) { +func (m *PutRequest_Body_Init) SetCopiesNumber(v uint32) { m.CopiesNumber = v } diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index 6ba4090..207b0b0 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -1452,17 +1452,9 @@ type PutRequest_Body_Init struct { Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // Object's Header Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` - // Number of copies of the object to store within the RPC call. By default, + // Number of the object copies to store within the RPC call. By default // object is processed according to the container's placement policy. - // Can be one of: - // 1. A single number; applied to the whole request and is treated as - // a minimal number of nodes that must store an object to complete the - // request successfully. - // 2. An ordered array; every number is treated as a minimal number of - // nodes in a corresponding placement vector that must store an object - // to complete the request successfully. The length MUST equal the placement - // vectors number, otherwise request is considered malformed. - CopiesNumber []uint32 `protobuf:"varint,4,rep,packed,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` + CopiesNumber uint32 `protobuf:"varint,4,opt,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` } func (x *PutRequest_Body_Init) Reset() { @@ -1518,11 +1510,11 @@ func (x *PutRequest_Body_Init) GetHeader() *Header { return nil } -func (x *PutRequest_Body_Init) GetCopiesNumber() []uint32 { +func (x *PutRequest_Body_Init) GetCopiesNumber() uint32 { if x != nil { return x.CopiesNumber } - return nil + return 0 } // PUT Object response body @@ -2465,7 +2457,7 @@ var file_object_grpc_service_proto_rawDesc = []byte{ 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, - 0x70, 0x69, 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x70, 0x69, 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x22, 0xa0, 0x02, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, diff --git a/object/marshal.go b/object/marshal.go index 7a89b97..b918e69 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -516,7 +516,7 @@ func (r *PutObjectPartInit) StableMarshal(buf []byte) []byte { offset += proto.NestedStructureMarshal(putReqInitObjectIDField, buf[offset:], r.id) offset += proto.NestedStructureMarshal(putReqInitSignatureField, buf[offset:], r.sig) offset += proto.NestedStructureMarshal(putReqInitHeaderField, buf[offset:], r.hdr) - proto.RepeatedUInt32Marshal(putReqInitCopiesNumField, buf[offset:], r.copyNum) + proto.UInt32Marshal(putReqInitCopiesNumField, buf[offset:], r.copyNum) return buf } @@ -529,9 +529,7 @@ func (r *PutObjectPartInit) StableSize() (size int) { size += proto.NestedStructureSize(putReqInitObjectIDField, r.id) size += proto.NestedStructureSize(putReqInitSignatureField, r.sig) size += proto.NestedStructureSize(putReqInitHeaderField, r.hdr) - - arrSize, _ := proto.RepeatedUInt32Size(putReqInitCopiesNumField, r.copyNum) - size += arrSize + size += proto.UInt32Size(putReqInitCopiesNumField, r.copyNum) return size } diff --git a/object/test/generate.go b/object/test/generate.go index 32d7a3c..0816ffc 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -216,7 +216,7 @@ func GeneratePutObjectPartInit(empty bool) *object.PutObjectPartInit { m := new(object.PutObjectPartInit) if !empty { - m.SetCopiesNumber([]uint32{234}) + m.SetCopiesNumber(234) m.SetObjectID(refstest.GenerateObjectID(false)) } diff --git a/object/types.go b/object/types.go index a40de57..f076b74 100644 --- a/object/types.go +++ b/object/types.go @@ -128,7 +128,7 @@ type PutObjectPartInit struct { hdr *Header - copyNum []uint32 + copyNum uint32 } type PutObjectPartChunk struct { @@ -894,15 +894,15 @@ func (r *PutObjectPartInit) SetHeader(v *Header) { r.hdr = v } -func (r *PutObjectPartInit) GetCopiesNumber() []uint32 { +func (r *PutObjectPartInit) GetCopiesNumber() uint32 { if r != nil { return r.copyNum } - return nil + return 0 } -func (r *PutObjectPartInit) SetCopiesNumber(v []uint32) { +func (r *PutObjectPartInit) SetCopiesNumber(v uint32) { r.copyNum = v } From 84dc99a0456566c7ba28d0a072b3a7954db98118 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 11 Apr 2023 10:35:21 +0300 Subject: [PATCH 027/169] Release v2.15.0 Signed-off-by: Evgenii Stratonikov --- CHANGELOG.md | 860 +-------------------------------------------------- 1 file changed, 13 insertions(+), 847 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da58198..7ab694e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,856 +2,22 @@ ## [Unreleased] +### Added +### Fixed +### Changed +### Updated + +## 2.15.0 - 2023-04-11 + ### Added - Basic tracing support (#12) -### Fixed -### Changed -### Updated +- Optimize signature checking (#3) -## [2.14.0] - 2022-10-17 - Anmado (안마도, 鞍馬島) +Initial public release. -### Added -- Maintenance status and node state (#415) -- `NetmapSnapshot` RPC (#418) +## Older versions -### Fixed -- Marshal repeated `[]byte` fields correctly (#413) -- Block until client connection is up (#419) +This project is a fork of [NeoFS](https://github.com/nspcc-dev/neofs-api-go) from version v2.14.0. +To see CHANGELOG for older versions, refer to https://github.com/nspcc-dev/neofs-api-go/blob/master/CHANGELOG.md. -### Changed -- Support new object session context format (#416) -- Mark all expiration methods as deprecated (#417) - -### Updated -- Minimal go version to 1.17 (#412) -- `neofs-crypto` to `v0.4.0` (#412) -- `google.golang.org/grpc` to `v1.48.0` (#415) -- `google.golang.org/protobuf` to `v1.28.0` (#415) - -## [2.13.1] - 2022-08-01 - -### Added -- `EACL_NOT_FOUND` status code support (#409) - -## [2.13.0] - 2022-07-04 - Yeonpyeongdo (연평도, 延坪島) - -NeoFS API v2.13 support - -### Added -- WalletConnect signature scheme (#386) -- `object.StatusOutOfRange` enum value (#407) -- Functionality to disable homomorphic hashing in container (#399) -- `status.SignatureVerificationFail` enum value (#405) - -## [2.12.2] - 2022-06-03 - -### Added -- `util/protogen` tool to compile Protocol Buffers with stable marshaling - -### Fixed -- `refs.ObjectIDNestedListMarshal` incorrect encoding (#401) -- incorrect conversion of `oneof` field in `GetRangeResponseBody.FromGRPCMessage` (#401) - -### Changed -- Setters don't check call on `nil` (#388) -- `StableMarshal` methods don't return `error` -- `oneof` fields are now randomly initialized in test generators (#401) - -## [2.12.1] - 2022-03-15 - -### Fixed -- Incompatible changes in signature scheme (#380) - -### Added -- Public URI-parsing function `client.ParseURI()` (#383) - -### Changed -- Slices with pointers `[]*T` replaced with regular structure slices `[]T` in - v2 structures (#376) - -## [2.12.0] - 2022-02-25 - Heuksando (흑산도, 黑山島) - -NeoFS API v2.12 support - -### Added -- Network magic field (`uint64`) to `session.RequestMetaHeader` (#367) -- Constants for attributes related to object notifications (#372) -- `refs.SignatureScheme` enum and corresponding field to `session.Signature` message (#55) -- New status codes in `container`, `object` and `session` packages (#371) -- `object.TypeLock` type enum value and `object.Lock` type of its content (#371) - -### Changed -- API of `signature` package (#55) - -### Deprecated -- `SessionToken`, `SessionTokenBody` and `SessionTokenContext` types from `session` package - -## [2.11.1] - 2021-12-28 - -### Added -- Timeout for single message transmission in `rpc/client` (#366) - -## [2.11.0] - 2021-12-02 - Sinjido (신지도, 薪智島) - -NeoFS API v2.11 support. High level packages are moved to -[neofs-sdk-go](https://github.com/nspcc-dev/neofs-sdk-go) repository. -Repository restructured as Go module version 2 and synced with -[neofs-api](https://github.com/nspcc-dev/neofs-api) release version. - -### Fixed -- Protobuf recompile script handles path with special symbols correctly (#354) -- `make dep` command (#364) - -### Added -- Status codes in response messages (#350) -- Storage subnetwork types (#355, #356, #360, #362) - -### Changed -- neofs-api-go is now Go module version 2 (#201) - -### Removed -- All packages from `pkg` moved to - [neofs-sdk-go](https://github.com/nspcc-dev/neofs-sdk-go) (#201) - -## [1.30.0] - 2021-10-19 - Udo (우도, 牛島) - -NeoFS API v2.10 support. - -### Fixed - -- Potential NPE in NEO3Wallet related functions (#340) -- Incorrect return of reputation intermediate announcement (#342) - -### Added - -- pkg/client callback to parse internal response information (#337) -- Service filter type in extended ACL from API v2.10 (#338) -- Enhanced network info structures from API v2.10 (#339) -- Well-known public-append basic ACL constant (#341) -- Native contract names support (#351) - -### Changed - -- Updated grpc to v1.41.0 (#176) - -## [1.29.0] - 2021-08-27 - Anmyeondo (안면도, 安眠島) - -### Fixed - -- Well-known BasicACL constants to fit the specification (#330, #334). -- Linter warnings (#335). - -### Added - -- Support for `COMMON_PREFIX` filter operation for object attributes (#331). -- Missing well-known eACL filter setters (#333). - -### Removed - -- `FilterObjectParent` well-known object related filter key (#333). - -### Updated - -- Go version to `1.16` (#335). -- Tests in CI to run on `1.16` and `1.17` Go versions (#335). - -## [1.28.3] - 2021-07-07 - -### Fixed - -- Regression of the session token corruption fix from v1.28.2 ([#326](https://github.com/nspcc-dev/neofs-api-go/issues/326)). - -## [1.28.2] - 2021-07-06 - -### Fixed - -- Data corruption of parameterized session token in `pkg/client.Client` ([#323](https://github.com/nspcc-dev/neofs-api-go/issues/323)). - -## [1.28.1] - 2021-07-01 - -### Fixed - -- Incorrect unsupported version error in `Client.GetContainer` of containers of newer versions. - -### Removed - -- No longer used `pkg.IsSupportedVersion` func. -- No longer used `container.NewVerifiedFromV2` func. - -## [1.28.0] - 2021-06-28 - Muuido (무의도, 舞衣島) - -### Added - -- `String` / `FromString` methods to work with text format of enums from `pkg`. -- `Marshal(JSON)` / `Unmarshal(JSON)` methods to `container.ContainerContext` type. -- Ability to handle the `io.Reader` of the object payload in `Client.GetObject`. -- `NumberOfAddresses` / `IterateAddresses` methods to node info types for support of multiple addresses. - -### Fixed - -- Added leading slash to format of gRPC method names. - -### Updated - -- Neo Go library to v0.95.3. - -## [1.27.1] - 2021-06-10 - -### Fixed - -- SDK version was updated (actualized) to `2.7`. - -### Changed - -- `pkg` wrappers' `ToV2` methods return `nil` if called on `nil`. -- `pkg` wrappers' `NewFromV2` functions constructs `nil` if called with `nil` argument. - -### Added - -- Getters and setters for lifetime fields of `pkg/session.Token`. -- `MarshalHeaderJSON` method to `pkg/object.Object`. -- Generators for types from `pkg` (for testing). -- Descriptions of default fields for `pkg` wrappers and unit tests for its constructors. -- Unit tests for `ToV2` methods and `NewFromV2` functions. - -## [1.27.0] - 2021-06-03 - Seongmodo (석모도, 席毛島) - -### Added - -- Message structures related to Container service sessions in `v2` and `pkg`. -- `session.Token` and `Signature` to `pkg/container.Container` and `pkg/acl/eacl.Table`. -- `Conn` method of clients to get the underlying connection. -- `WithTLSConfig` client option to specify TLS configuration. -- `WithNetworkURIAddress` client option to specify URI of the remote server. -- Generators of random container IDs, owner IDs and session tokens (for testing). - -### Replaced - -- `pkg/token.SessionToken` type to `pkg/session` package as `Token`. Old type is deprecated. -- `pkg/container.ID` type to `pkg/container/id` package. Old type is deprecated. - -### Updated - -- NEO Go library to v0.95.1. - -## [1.26.1] - 2021-05-19 - -### Changed - -- Updated neo-go to v0.95.0 release. - -### Removed - -- `pkg/errors` dependency (stdlib errors used instead). - -## [1.26.0] - 2021-05-07 - Daecheongdo (대청도, 大靑島) - -### Added - -- Implementation of `v2/reputation` package. -- Implementation of reputation methods in `pkg/client`. -- Float64 stable marshaling wrappers in `util/proto`. - -## [1.25.0] - 2021-03-22 - Jebudo (제부도, 濟扶島) - -Raw client and support of NeoFS API v2.5.0 "Jebudo" release. - -### Added - -- Raw client for peer to peer communication. -- `client.WithKey` option to sign messages with different keys within single - client. -- `Content-Type` well-known object attribute constant. - -### Changed - -- Refactored `v2` sub-packages to support single raw client in all RPC methods. -- Client constructor returns `Client` interface instead of structure. - -## [1.24.0] - 2021-02-26 - Ganghwado (강화도, 江華島) - -Support changes from NeoFS API v2.4.0 "Ganghwado" release. - -### Added - -- `netmap.NetworkInfo` definitions in `v2` and `pkg/netmap`. -- `netmap.NetworkInfo` RPC support in `pkg/client`. - -### Changed - -- Updated in-line docs from NeoFS API "Ganghwado" release. - -## [1.23.0] - 2021-02-11 - Seonyudo (선유도, 仙遊島) - -Support changes from NeoFS API v2.3.0 "Seonyudo" release. - -### Added - -- Fulfill backup factor for default attribute in placement. -- Support of `Container.AnnounceUsedSpace` RPC from NeoFS API. -- New `pkg/client.Client.AnnounceContainerUsedSpace` method. -- Support of `STRING_NOT_EQUAL` and `NOT_PRESENT` object search filters. -- Implementation of `json.Marshaler`/`json.Unmarshaler` on `v2/object/SearchFilter`. -- Implementation of `json.Marshaler`/`json.Unmarshaler` on `pkg/object/SearchFilters`. -- Named constants of well-known node attributes in `pkg/netmap`. - -### Renamed - -- `pkg/netmap/PriceAttr` to `pkg/netmap/AttrPrice`. -- `pkg/netmap/CapacityAttr` to `pkg/netmap/AttrCapacity`. - -## [1.22.2] - 2021-01-27 - -### Fixed - -- Fix size limit for grpc messages in object.Put operation. -- Fix `GetContainerNode()` function, so that it does not modify placement policy. - -## [1.22.1] - 2021-01-15 - -Support changes from NeoFS API v2.2.1 release. - -### Added - -- Constant prefix of the reserved keys to X-headers (`__NEOFS__`). -- Constant string key to netmap epoch X-header (`__NEOFS__NETMAP_EPOCH`). -- Constant string key to netmap lookup depth X-header (`__NEOFS__NETMAP_LOOKUP_DEPTH`). - -### Changed - -- Linter's configuration in `.golangci.yml`. - -### Fixed - -- Remarks of the updated linter. - -## [1.22.0] - 2020-12-30 - Yeouido (여의도, 汝矣島) - -Support changes from NeoFS API v2.2.0 "Yeouido" release. - -### Added - -- Payload hash field to `ShortHeader` message. -- Payload homomorphic hash field to `ShortHeader` message. -- Support of `StorageGroup` message. -- Support of `DataAuditResult` message. -- Stringer and string parser for `Checksum` type of client library. -- Stringer and string parser for `Type` message. -- Stringer and string parser for `Type` type of client library. -- `AddTypeFilter` method on `SearchFilters` type of client library - that adds filter by object type. -- Utility functions for working with `fixed64` protobuf type to `proto` library. -- Converters for `repeated` object ID messages in `v2` library. - -## [1.21.2] - 2020-12-24 - -### Added - -- `Container.NonceUUID` getter of container nonce in UUID format. -- `Container.SetNonceUUID` setter of container nonce in UUID format. -- `NewVerifiedContainerFromV2` container constructor that preliminary - checks if container message argument meets NeoFS API V2 specification. - -### Changed - -- `Container.Nonce`/`Container.SetNonce` marked as deprecated. -- `Client.GetContainer` method returns an error if received - container does not meet NeoFS API specification. - -### Fixed - -- `pkg.SDKVersion` to return version with minor `1`. -- `pkg.IsSupportedVersion` to consider `2.1` as supported. - -## [1.21.1] - 2020-12-18 - -Support neofs-api v2.1.1. - -### Added - -- `client.GetVerifiedContainerStructure` function to check - that the container structure matches the requested identifier. - -## [1.21.0] - 2020-12-11 - Modo (모도, 茅島) - -### Added - -- `SplitID` message support -- Search filter by `SplitID` field -- `SplitInfo` message support and related error -- `Raw` flag support in `Client.GetObject(Header)` -- Getters for parameter structures in `pkg/client` package -- `Tombstone` message support -- Tombstone address target parameter of `Client.DeleteObject` method -- `client.DeleteObject` helpful function -- Usage of default value for backup factor in placement builder - -### Removed - -- Object search filter by `CHILDFREE` property - -### Renamed - -- `AddLeafFilter` to `AddPhyFilter` - -### Fixed - -- NPE in `eacl.NewTargetFromV2` function -- Processing `REP X` policies in placement builder - - -## [1.20.3] - 2020-11-25 - -### Added - -- `AddObjectIDFilter` method of `SearchFilters` type -- `WithDialTimeout` option of v2 and SDK `Client`'s -- `GetEACLWithSignature` method of SDK `Client` type - -### Fixed - -- incorrect signature verification algorithm in `GetEACL` method of SDK `Client` - -## [1.20.2] - 2020-11-17 - -### Fixed - -- Readme badges - -## [1.20.1] - 2020-11-17 - -### Fixed - -- Signature check of head response in `pkg/client` (#202) - -## [1.20.0] - 2020-11-16 - Jindo (진도, 珍島) - -Major API refactoring and simplification. From now on this library will have -backward compatibility and support of major versions of NeoFS-API by having -**version specific** files in `vN` dirs and **version independent** SDK -structures and client in `pkg`. This version supports NeoFS-API v2.0.X - - -### Added -- cross-protocol ```v2``` message types -- utility functions for message signing/verification -- ```v2```/ ```gRPC``` back and forth conversions -- primary SDK - -### Removed -- v0 and v1 NeoFS API is not supported anymore - -## [1.3.0] - 2020-07-23 - -### Changed - -- Format of ```refs.OwnerID``` based on NEO3. -- Binary format of extended ACL table. -- ```acl``` package structure. - -## [1.2.0] - 2020-07-08 - -### Added - -- Extended ACL types. -- Getters and setters of ```EACLTable``` and its internal messages. -- Wrappers over ```EACLTable``` and its internal messages. -- Getters, setters and marshaling methods of wrappers. - -### Changed - -- Mechanism for signing requests on the principle of Matryoshka. - -### Updated - -- NeoFS API v1.1.0 => 1.2.0 - -## [1.1.0] - 2020-06-18 - -### Added - -- `container.SetExtendedACL` rpc. -- `container.GetExtendedACL` rpc. -- Bearer token to all request messages. -- X-headers to all request messages. - -### Changed - -- Implementation and signatures of Sign/Verify request functions. - -### Updated - -- NeoFS API v1.0.0 => 1.1.0 - -## [1.0.0] - 2020-05-26 - -- Bump major release - -### Updated - -- NeoFS API v0.7.5 => v1.0.0 -- github.com/golang/protobuf v1.4.0 => v1.4.2 -- github.com/prometheus/client_golang v1.5.1 => v1.6.0 -- github.com/spf13/viper v1.6.2 => v1.7.0 -- google.golang.org/grpc v1.28.1 => v1.29.1 - -## [0.7.6] - 2020-05-19 - -### Added - -- `session.PublicSessionToken` function for session public key bytes receiving. -- The implementation of `service.DataWithSignKeyAccumulator` methods on `object.IntegrityHeader`. - -### Changed - -- The implementation of `AddSignKey` method on `service.signedSessionToken` structure. -- `session.PrivateTOken` interface methods group. - -### Removed - -- `OwnerKey` from `service.SessionToken` signed payload. - -### Fixed - -- Incorrect `object.HeadRequest.ReadSignedData` method implementation. - -## [0.7.5] - 2020-05-16 - -### Added - -- Owner key to the `SessionToken` signed payload. - -### Changed - -- `OwnerKeyContainer` interface embedded to `SessionTokenInfo` interface. - -### Updated - -- NeoFS API v0.7.5 - -## [0.7.4] - 2020-05-12 - -### Added - -- Stringify for `object.Object`. - -### Changed - -- Mechanism for creating and verifying request message signatures. -- Implementation and interface of private token storage. -- File structure of packages. - -### Updated - -- NeoFS API v0.7.4 - -## [0.7.1] - 2020-04-20 - -### Added - -- Method to change current node state. (`state.ChangeState`) - -### Updated - -- NeoFS API v0.7.1 - -## [0.7.0] - 2020-04-16 - -### Updated -- NeoFS API v0.7.0 - -## [0.6.2] - 2020-04-16 - -### Updated -- NeoFS API v0.6.1 -- Protobuf v1.4.0 -- Netmap v1.7.0 -- Prometheus Client v1.5.1 -- Testify v1.5.1 -- gRPC v1.28.1 - -### Fixed -- formatting -- test coverage for Object.PutRequest.CID method - -## [0.6.1] - 2020-04-10 - -### Changed - -- License changed to Apache 2.0 - -### Fixed - -- NPE in PutRequest.CID() - - -## [0.6.0] - 2020-04-03 - -### Added - -- `RequestType` for object service requests -- `Type()` function in `Request` interface - -### Changed - -- Synced proto files with `neofs-api v0.6.0` - -## [0.5.0] - 2020-03-31 - -### Changed -- Rename repo to `neofs-api-go` -- Used public proto files - -## [0.4.2] - 2020-03-16 - -### Fixed -- NPE bug with CID method of object.PutRequest - -## [0.4.1] - 2020-03-02 - -### Changed -- Updated neofs-crypto library to v0.3.0 - -## [0.4.0] - 2020-02-18 - -### Added -- Meta header for all gRPC responses. It contains epoch stamp and version number. -### Changed -- Endianness in accounting cheque. Now it uses little endian for cheaper -decoding in neofs smart-contract. - -## [0.3.2] - 2020-02-10 - -### Added -- gRPC method DumpVars to State service -- add method `EncodeVariables` to encode debug variables to JSON (slice of bytes) -- increase test coverage for state package - -### Updated -- state proto file -- documentation for state service and messages - -## [0.3.1] - 2020-02-07 -### Fixed -- bug with `tz.Concat` - -### Updated -- dependencies: - - github.com/nspcc-dev/tzhash `v1.3.0 => v1.4.0` - - github.com/prometheus/client_golang `v1.4.0 => v1.4.1` - - google.golang.org/grpc `v1.27.0 => v1.27.1` - -## [0.3.0] - 2020-02-05 - -### Updated -- proto files -- dependencies - - github.com/golang/protobuf `v1.3.2 => v1.3.3` - - github.com/pkg/errors `v0.8.1 => v0.9.1` - - github.com/prometheus/client_golang `v1.2.1 => v1.4.0` - - github.com/prometheus/client_model `v0.0.0-20190812154241-14fe0d1b01d4 => v0.2.0` - - github.com/spf13/viper `v1.6.1 => v1.6.2` - - google.golang.org/grpc `v1.24.0 => v1.27.0` - -### Changed -- make object.GetRange to be server-side streaming RPC -- GetRange response struct - -### Added -- badges to readme - -## [0.2.14] - 2020-02-04 - -### Fixed -- Readme - -### Added -- Filename header - -### Updated -- Object.Search now uses streams - -## [0.2.13] - 2020-02-03 - -### Fixed -- Code format - -### Changed -- Use separated proto repository -- Rename neofs-proto to neofs-api - -## [0.2.12] - 2020-01-27 - -### Fixed -- Bug with ByteSize (0 bytes returns NaN) - -## [0.2.11] - 2020-01-21 - -### Added -- Raw flag in object head and get queries with docs - -## [0.2.10] - 2020-01-17 - -### Changed -- Private token contructor now takes public keys as an argument - -## [0.2.9] - 2020-01-17 - -### Added -- Docs for container ACL field -- Public key header in the object with docs -- Public key field in the session token with docs - -### Changed -- Routine to verify correct object checks if integrity header is last and -may use public key header if verification header is not present -- Routine to verify correct session token checks if keys in the token -associated with owner id -- Updated neofs-crypto to v0.2.3 - -### Removed -- Timestamp in object tombstone header - -## [0.2.8] - 2019-12-21 - -### Added -- Container access control type definitions - -### Changed -- Used sync.Pool for Sign/VerifyRequestHeader -- VerifiableRequest.Marshal method replace with MarshalTo and Size - -## [0.2.7] - 2019-12-17 - -### Fixed -- Bug with DecodeMetrics (empty metrics returns) - -## [0.2.6] - 2019-12-17 - -### Added -- Request to dump node config - -## [0.2.5] - 2019-12-05 - -### Removed -- proto.Message in Maintainable/Verifiable requests - -## [0.2.4] - 2019-12-03 - -### Added -- StorageGroup library - -### Changed -- Storage group part of object library moved into separate package -- Updated proto documentation - -## [0.2.3] - 2019-11-28 - -### Removed -- service: SignRequest / VerifyRequest and accompanying code -- proto: Signature field from requests -- object: bytefmt package not used anymore - -### Changed -- service: rename EpochRequest to EpochHeader and merge with MetaHeader -- service: get status error even if it is wrapped - -### Added -- service: RequestVerificationHeader's method to validate owner -- service: test coverage for CheckOwner -- service: test coverage for wrapped status errors - -## [0.2.2] - 2019-11-22 - -### Changed -- ProcessRequestTTL don't changes status errors from TTLCondition - -## [0.2.1] - 2019-11-22 - -### Changed -- Removed SendPutRequest -- MakePutRequestHeader sets only object and token - -## [0.2.0] - 2019-11-21 - -### Added -- Container not found error -- GitHub Actions as CI and Codecov -- Auto-generated proto documentation -- RequestMetaHeader to all RPC requests -- RequestVerificationHeader to all RPC requests - -### Changed -- Moved TTL and Epoch fields to RequestMetaHeader -- Renamed Version in object.SearchRequest to QueryVersion -- Removed SetTTL, GetTTL, SetEpoch, GetEpoch from all RPC requests - -## 0.1.0 - 2019-11-18 - -Initial public release - -[0.2.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.1.0...v0.2.0 -[0.2.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.0...v0.2.1 -[0.2.2]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.1...v0.2.2 -[0.2.3]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.2...v0.2.3 -[0.2.4]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.3...v0.2.4 -[0.2.5]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.4...v0.2.5 -[0.2.6]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.5...v0.2.6 -[0.2.7]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.6...v0.2.7 -[0.2.8]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.7...v0.2.8 -[0.2.9]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.8...v0.2.9 -[0.2.10]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.9...v0.2.10 -[0.2.11]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.10...v0.2.11 -[0.2.12]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.11...v0.2.12 -[0.2.13]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.12...v0.2.13 -[0.2.14]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.13...v0.2.14 -[0.3.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.2.14...v0.3.0 -[0.3.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.3.0...v0.3.1 -[0.3.2]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.3.1...v0.3.2 -[0.4.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.3.2...v0.4.0 -[0.4.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.4.0...v0.4.1 -[0.4.2]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.4.1...v0.4.2 -[0.5.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.4.2...v0.5.0 -[0.6.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.5.0...v0.6.0 -[0.6.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.6.0...v0.6.1 -[0.6.2]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.6.1...v0.6.2 -[0.7.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.6.2...v0.7.0 -[0.7.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.7.0...v0.7.1 -[0.7.4]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.7.1...v0.7.4 -[0.7.5]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.7.4...v0.7.5 -[0.7.6]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.7.5...v0.7.6 -[1.0.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v0.7.6...v1.0.0 -[1.1.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.0.0...v1.1.0 -[1.2.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.1.0...v1.2.0 -[1.3.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.2.0...v1.3.0 -[1.20.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.3.0...v1.20.0 -[1.20.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.20.0...v1.20.1 -[1.20.2]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.20.1...v1.20.2 -[1.20.3]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.20.2...v1.20.3 -[1.21.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.20.3...v1.21.0 -[1.21.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.21.0...v1.21.1 -[1.21.2]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.21.1...v1.21.2 -[1.22.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.21.2...v1.22.0 -[1.22.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.22.0...v1.22.1 -[1.22.2]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.22.1...v1.22.2 -[1.23.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.22.2...v1.23.0 -[1.24.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.23.0...v1.24.0 -[1.25.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.24.0...v1.25.0 -[1.26.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.25.0...v1.26.0 -[1.26.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.26.0...v1.26.1 -[1.27.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.26.1...v1.27.0 -[1.27.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.27.0...v1.27.1 -[1.28.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.27.1...v1.28.0 -[1.28.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.28.0...v1.28.1 -[1.28.2]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.28.1...v1.28.2 -[1.28.3]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.28.2...v1.28.3 -[1.29.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.28.3...v1.29.0 -[1.30.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.29.0...v1.30.0 -[2.11.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v1.30.0...v2.11.0 -[2.11.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v2.11.0...v2.11.1 -[2.12.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v2.11.1...v2.12.0 -[2.12.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v2.12.0...v2.12.1 -[2.12.2]: https://github.com/nspcc-dev/neofs-api-go/compare/v2.12.1...v2.12.2 -[2.13.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v2.12.2...v2.13.0 -[2.13.1]: https://github.com/nspcc-dev/neofs-api-go/compare/v2.13.0...v2.13.1 -[2.14.0]: https://github.com/nspcc-dev/neofs-api-go/compare/v2.13.1...v2.14.0 +[Unreleased]: https://github.com/TrueCloudLab/compare/v2.15.0...master From 3b938873cc1de440d6e4152331081889d8e25ead Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 11 Apr 2023 10:37:11 +0300 Subject: [PATCH 028/169] Revert "Revert "[#16] object: Allow set `copy_number` for every placement vector"" This reverts commit 4a34188c9ef4b7404e1abaac5f72d1c302d322e7. --- object/grpc/service.go | 2 +- object/grpc/service.pb.go | 18 +++++++++++++----- object/marshal.go | 6 ++++-- object/test/generate.go | 2 +- object/types.go | 8 ++++---- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/object/grpc/service.go b/object/grpc/service.go index 44b5f4a..74dc168 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -109,7 +109,7 @@ func (m *PutRequest_Body_Init) SetHeader(v *Header) { } // SetCopiesNumber sets number of the copies to save. -func (m *PutRequest_Body_Init) SetCopiesNumber(v uint32) { +func (m *PutRequest_Body_Init) SetCopiesNumber(v []uint32) { m.CopiesNumber = v } diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index 207b0b0..6ba4090 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -1452,9 +1452,17 @@ type PutRequest_Body_Init struct { Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // Object's Header Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` - // Number of the object copies to store within the RPC call. By default + // Number of copies of the object to store within the RPC call. By default, // object is processed according to the container's placement policy. - CopiesNumber uint32 `protobuf:"varint,4,opt,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` + // Can be one of: + // 1. A single number; applied to the whole request and is treated as + // a minimal number of nodes that must store an object to complete the + // request successfully. + // 2. An ordered array; every number is treated as a minimal number of + // nodes in a corresponding placement vector that must store an object + // to complete the request successfully. The length MUST equal the placement + // vectors number, otherwise request is considered malformed. + CopiesNumber []uint32 `protobuf:"varint,4,rep,packed,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` } func (x *PutRequest_Body_Init) Reset() { @@ -1510,11 +1518,11 @@ func (x *PutRequest_Body_Init) GetHeader() *Header { return nil } -func (x *PutRequest_Body_Init) GetCopiesNumber() uint32 { +func (x *PutRequest_Body_Init) GetCopiesNumber() []uint32 { if x != nil { return x.CopiesNumber } - return 0 + return nil } // PUT Object response body @@ -2457,7 +2465,7 @@ var file_object_grpc_service_proto_rawDesc = []byte{ 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, - 0x70, 0x69, 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x70, 0x69, 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x22, 0xa0, 0x02, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, diff --git a/object/marshal.go b/object/marshal.go index b918e69..7a89b97 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -516,7 +516,7 @@ func (r *PutObjectPartInit) StableMarshal(buf []byte) []byte { offset += proto.NestedStructureMarshal(putReqInitObjectIDField, buf[offset:], r.id) offset += proto.NestedStructureMarshal(putReqInitSignatureField, buf[offset:], r.sig) offset += proto.NestedStructureMarshal(putReqInitHeaderField, buf[offset:], r.hdr) - proto.UInt32Marshal(putReqInitCopiesNumField, buf[offset:], r.copyNum) + proto.RepeatedUInt32Marshal(putReqInitCopiesNumField, buf[offset:], r.copyNum) return buf } @@ -529,7 +529,9 @@ func (r *PutObjectPartInit) StableSize() (size int) { size += proto.NestedStructureSize(putReqInitObjectIDField, r.id) size += proto.NestedStructureSize(putReqInitSignatureField, r.sig) size += proto.NestedStructureSize(putReqInitHeaderField, r.hdr) - size += proto.UInt32Size(putReqInitCopiesNumField, r.copyNum) + + arrSize, _ := proto.RepeatedUInt32Size(putReqInitCopiesNumField, r.copyNum) + size += arrSize return size } diff --git a/object/test/generate.go b/object/test/generate.go index 0816ffc..32d7a3c 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -216,7 +216,7 @@ func GeneratePutObjectPartInit(empty bool) *object.PutObjectPartInit { m := new(object.PutObjectPartInit) if !empty { - m.SetCopiesNumber(234) + m.SetCopiesNumber([]uint32{234}) m.SetObjectID(refstest.GenerateObjectID(false)) } diff --git a/object/types.go b/object/types.go index f076b74..a40de57 100644 --- a/object/types.go +++ b/object/types.go @@ -128,7 +128,7 @@ type PutObjectPartInit struct { hdr *Header - copyNum uint32 + copyNum []uint32 } type PutObjectPartChunk struct { @@ -894,15 +894,15 @@ func (r *PutObjectPartInit) SetHeader(v *Header) { r.hdr = v } -func (r *PutObjectPartInit) GetCopiesNumber() uint32 { +func (r *PutObjectPartInit) GetCopiesNumber() []uint32 { if r != nil { return r.copyNum } - return 0 + return nil } -func (r *PutObjectPartInit) SetCopiesNumber(v uint32) { +func (r *PutObjectPartInit) SetCopiesNumber(v []uint32) { r.copyNum = v } From 5f318f0b75f640cfcd9a3308a76a37f340771214 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 11 Apr 2023 10:37:12 +0300 Subject: [PATCH 029/169] Revert "Revert "[#16] container, object: Regenerate service comments"" This reverts commit b02ec516e72fbc9030d6dc71f956e23ac93c54da. --- container/grpc/service_grpc.pb.go | 108 +++--- object/grpc/service_grpc.pb.go | 530 +++++++++++++++--------------- 2 files changed, 318 insertions(+), 320 deletions(-) diff --git a/container/grpc/service_grpc.pb.go b/container/grpc/service_grpc.pb.go index 3af498b..1de8b5f 100644 --- a/container/grpc/service_grpc.pb.go +++ b/container/grpc/service_grpc.pb.go @@ -28,9 +28,9 @@ type ContainerServiceClient interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -38,53 +38,53 @@ type ContainerServiceClient interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) } @@ -169,9 +169,9 @@ type ContainerServiceServer interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Put(context.Context, *PutRequest) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -179,53 +179,53 @@ type ContainerServiceServer interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. Get(context.Context, *GetRequest) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). List(context.Context, *ListRequest) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error) } diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 23906d6..6b1c32a 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -30,32 +30,32 @@ type ObjectServiceClient interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -65,107 +65,106 @@ type ObjectServiceClient interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object storage container not found; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has - // + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation SEARCH of the object is denied; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, 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 @@ -173,33 +172,33 @@ type ObjectServiceClient interface { // order. // // Extended headers can change `GetRange` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -207,31 +206,31 @@ type ObjectServiceClient interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) } @@ -412,32 +411,32 @@ type ObjectServiceServer interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Get(*GetRequest, ObjectService_GetServer) error // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -447,107 +446,106 @@ type ObjectServiceServer interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object storage container not found; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has - // + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Put(ObjectService_PutServer) error // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Head(context.Context, *HeadRequest) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation SEARCH of the object is denied; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Search(*SearchRequest, ObjectService_SearchServer) 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 @@ -555,33 +553,33 @@ type ObjectServiceServer interface { // order. // // Extended headers can change `GetRange` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -589,31 +587,31 @@ type ObjectServiceServer interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // - [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) } From b3ccd0166f503cb7dad13cef6fa2ae18d61f3218 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Tue, 21 Feb 2023 11:23:08 +0300 Subject: [PATCH 030/169] [#17] acl: Add impersonate flag to bearer token Signed-off-by: Denis Kirillov --- CHANGELOG.md | 2 + acl/convert.go | 3 ++ acl/grpc/types.go | 5 +++ acl/grpc/types.pb.go | 91 +++++++++++++++++++++++++------------------- acl/marshal.go | 5 ++- acl/types.go | 14 +++++++ 6 files changed, 80 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab694e..8f7a84e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## [Unreleased] ### Added +- Add impersonate flag to bearer token (#17) + ### Fixed ### Changed ### Updated diff --git a/acl/convert.go b/acl/convert.go index d42aebd..3020f4d 100644 --- a/acl/convert.go +++ b/acl/convert.go @@ -427,6 +427,7 @@ func (bt *BearerTokenBody) ToGRPCMessage() grpc.Message { m.SetOwnerId(bt.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) m.SetLifetime(bt.lifetime.ToGRPCMessage().(*acl.BearerToken_Body_TokenLifetime)) m.SetEaclTable(bt.eacl.ToGRPCMessage().(*acl.EACLTable)) + m.SetImpersonate(bt.impersonate) } return m @@ -479,6 +480,8 @@ func (bt *BearerTokenBody) FromGRPCMessage(m grpc.Message) error { err = bt.eacl.FromGRPCMessage(eacl) } + bt.impersonate = v.GetAllowImpersonate() + return err } diff --git a/acl/grpc/types.go b/acl/grpc/types.go index e1e5336..b07f893 100644 --- a/acl/grpc/types.go +++ b/acl/grpc/types.go @@ -84,6 +84,11 @@ func (m *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) { m.Lifetime = v } +// SetImpersonate allows impersonate. +func (m *BearerToken_Body) SetImpersonate(v bool) { + m.AllowImpersonate = v +} + // SetBody sets bearer token body. func (m *BearerToken) SetBody(v *BearerToken_Body) { m.Body = v diff --git a/acl/grpc/types.pb.go b/acl/grpc/types.pb.go index 3581b88..583f89a 100644 --- a/acl/grpc/types.pb.go +++ b/acl/grpc/types.pb.go @@ -712,6 +712,9 @@ type BearerToken_Body struct { OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` // Token expiration and valid time period parameters Lifetime *BearerToken_Body_TokenLifetime `protobuf:"bytes,3,opt,name=lifetime,proto3" json:"lifetime,omitempty"` + // AllowImpersonate flag to consider token signer as request owner. + // If this field is true extended ACL table in token body isn't processed. + AllowImpersonate bool `protobuf:"varint,4,opt,name=allow_impersonate,json=allowImpersonate,proto3" json:"allow_impersonate,omitempty"` } func (x *BearerToken_Body) Reset() { @@ -767,6 +770,13 @@ func (x *BearerToken_Body) GetLifetime() *BearerToken_Body_TokenLifetime { return nil } +func (x *BearerToken_Body) GetAllowImpersonate() bool { + if x != nil { + return x.AllowImpersonate + } + return false +} + // Lifetime parameters of the token. Field names taken from // [rfc7519](https://tools.ietf.org/html/rfc7519). type BearerToken_Body_TokenLifetime struct { @@ -883,14 +893,14 @@ var file_acl_grpc_types_proto_rawDesc = []byte{ 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, - 0x83, 0x03, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0xb0, 0x03, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x33, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x85, 0x02, + 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0xb2, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x0a, 0x65, 0x61, 0x63, 0x6c, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x54, @@ -902,43 +912,46 @@ var file_acl_grpc_types_proto_rawDesc = []byte{ 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, - 0x74, 0x69, 0x6d, 0x65, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x45, - 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, - 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x65, 0x78, - 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x62, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, - 0x6e, 0x62, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x03, 0x69, 0x61, 0x74, 0x2a, 0x3e, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, - 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, - 0x06, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x54, 0x48, - 0x45, 0x52, 0x53, 0x10, 0x03, 0x2a, 0x4f, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, - 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, - 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, - 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x2a, 0x7a, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, - 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x45, 0x41, 0x44, 0x10, - 0x02, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, - 0x4c, 0x45, 0x54, 0x45, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, - 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x47, 0x45, 0x54, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x06, - 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x45, 0x54, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, - 0x10, 0x07, 0x2a, 0x35, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, - 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, - 0x08, 0x0a, 0x04, 0x44, 0x45, 0x4e, 0x59, 0x10, 0x02, 0x2a, 0x4a, 0x0a, 0x0a, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x48, 0x45, 0x41, 0x44, 0x45, - 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, - 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, - 0x49, 0x43, 0x45, 0x10, 0x03, 0x42, 0x58, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, - 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, - 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, - 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x3b, 0x61, 0x63, 0x6c, 0xaa, 0x02, 0x17, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x6c, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x6d, 0x65, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2b, + 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x6d, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x49, 0x6d, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x1a, 0x45, 0x0a, 0x0d, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, + 0x0a, 0x03, 0x6e, 0x62, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6e, 0x62, 0x66, + 0x12, 0x10, 0x0a, 0x03, 0x69, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x69, + 0x61, 0x74, 0x2a, 0x3e, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, + 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x59, + 0x53, 0x54, 0x45, 0x4d, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x53, + 0x10, 0x03, 0x2a, 0x4f, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, + 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, + 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, + 0x4c, 0x10, 0x02, 0x2a, 0x7a, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x47, + 0x45, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x07, + 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, + 0x45, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x10, 0x05, 0x12, + 0x0c, 0x0a, 0x08, 0x47, 0x45, 0x54, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x06, 0x12, 0x10, 0x0a, + 0x0c, 0x47, 0x45, 0x54, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, 0x10, 0x07, 0x2a, + 0x35, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, + 0x44, 0x45, 0x4e, 0x59, 0x10, 0x02, 0x2a, 0x4a, 0x0a, 0x0a, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, + 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x42, 0x4a, + 0x45, 0x43, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, + 0x10, 0x03, 0x42, 0x58, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, + 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, + 0x63, 0x6c, 0xaa, 0x02, 0x17, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x6c, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/acl/marshal.go b/acl/marshal.go index c56b90f..cd6c6dd 100644 --- a/acl/marshal.go +++ b/acl/marshal.go @@ -31,6 +31,7 @@ const ( bearerTokenBodyACLField = 1 bearerTokenBodyOwnerField = 2 bearerTokenBodyLifetimeField = 3 + bearerTokenBodyImpersonate = 4 bearerTokenBodyField = 1 bearerTokenSignatureField = 2 @@ -251,7 +252,8 @@ func (bt *BearerTokenBody) StableMarshal(buf []byte) []byte { offset += protoutil.NestedStructureMarshal(bearerTokenBodyACLField, buf[offset:], bt.eacl) offset += protoutil.NestedStructureMarshal(bearerTokenBodyOwnerField, buf[offset:], bt.ownerID) - protoutil.NestedStructureMarshal(bearerTokenBodyLifetimeField, buf[offset:], bt.lifetime) + offset += protoutil.NestedStructureMarshal(bearerTokenBodyLifetimeField, buf[offset:], bt.lifetime) + protoutil.BoolMarshal(bearerTokenBodyImpersonate, buf[offset:], bt.impersonate) return buf } @@ -264,6 +266,7 @@ func (bt *BearerTokenBody) StableSize() (size int) { size += protoutil.NestedStructureSize(bearerTokenBodyACLField, bt.eacl) size += protoutil.NestedStructureSize(bearerTokenBodyOwnerField, bt.ownerID) size += protoutil.NestedStructureSize(bearerTokenBodyLifetimeField, bt.lifetime) + size += protoutil.BoolSize(bearerTokenBodyImpersonate, bt.impersonate) return size } diff --git a/acl/types.go b/acl/types.go index 71d83ce..1524e7b 100644 --- a/acl/types.go +++ b/acl/types.go @@ -52,6 +52,8 @@ type BearerTokenBody struct { ownerID *refs.OwnerID lifetime *TokenLifetime + + impersonate bool } type BearerToken struct { @@ -340,6 +342,18 @@ func (bt *BearerTokenBody) SetLifetime(v *TokenLifetime) { bt.lifetime = v } +func (bt *BearerTokenBody) GetImpersonate() bool { + if bt != nil { + return bt.impersonate + } + + return false +} + +func (bt *BearerTokenBody) SetImpersonate(v bool) { + bt.impersonate = v +} + func (bt *BearerToken) GetBody() *BearerTokenBody { if bt != nil { return bt.body From d9347a05f027d337b214e80c4dfa9f3b11220cfb Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 17 Apr 2023 15:44:35 +0300 Subject: [PATCH 031/169] [#21] *: Drop reputation system Signed-off-by: Pavel Karpy --- CHANGELOG.md | 3 + accounting/grpc/service.pb.go | 2 +- accounting/grpc/service_grpc.pb.go | 10 +- accounting/grpc/types.pb.go | 2 +- acl/grpc/types.pb.go | 2 +- audit/grpc/types.pb.go | 2 +- container/grpc/service.pb.go | 2 +- container/grpc/service_grpc.pb.go | 148 +++--- container/grpc/types.pb.go | 2 +- lock/grpc/types.pb.go | 2 +- netmap/grpc/service.pb.go | 2 +- netmap/grpc/service_grpc.pb.go | 20 +- netmap/grpc/types.pb.go | 2 +- object/grpc/service.pb.go | 2 +- object/grpc/service_grpc.pb.go | 562 ++++++++++---------- object/grpc/types.pb.go | 2 +- refs/grpc/types.pb.go | 2 +- reputation/convert.go | 604 --------------------- reputation/grpc/service.go | 90 ---- reputation/grpc/service.pb.go | 808 ----------------------------- reputation/grpc/service_grpc.pb.go | 165 ------ reputation/grpc/types.go | 55 -- reputation/grpc/types.pb.go | 500 ------------------ reputation/json.go | 38 -- reputation/marshal.go | 276 ---------- reputation/message_test.go | 34 -- reputation/test/generate.go | 160 ------ reputation/types.go | 366 ------------- rpc/reputation.go | 46 -- session/grpc/service.pb.go | 2 +- session/grpc/service_grpc.pb.go | 10 +- session/grpc/types.pb.go | 2 +- signature/body.go | 11 - status/grpc/types.pb.go | 2 +- storagegroup/grpc/types.pb.go | 2 +- subnet/grpc/types.pb.go | 2 +- tombstone/grpc/types.pb.go | 2 +- util/proto/test/test.pb.go | 2 +- 38 files changed, 415 insertions(+), 3529 deletions(-) delete mode 100644 reputation/convert.go delete mode 100644 reputation/grpc/service.go delete mode 100644 reputation/grpc/service.pb.go delete mode 100644 reputation/grpc/service_grpc.pb.go delete mode 100644 reputation/grpc/types.go delete mode 100644 reputation/grpc/types.pb.go delete mode 100644 reputation/json.go delete mode 100644 reputation/marshal.go delete mode 100644 reputation/message_test.go delete mode 100644 reputation/test/generate.go delete mode 100644 reputation/types.go delete mode 100644 rpc/reputation.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f7a84e..27506b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ ### Fixed ### Changed +### Removed +- Reputation system (#21) + ### Updated ## 2.15.0 - 2023-04-11 diff --git a/accounting/grpc/service.pb.go b/accounting/grpc/service.pb.go index 196c7ab..9699622 100644 --- a/accounting/grpc/service.pb.go +++ b/accounting/grpc/service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: accounting/grpc/service.proto diff --git a/accounting/grpc/service_grpc.pb.go b/accounting/grpc/service_grpc.pb.go index f1cfeb5..1e1b17e 100644 --- a/accounting/grpc/service_grpc.pb.go +++ b/accounting/grpc/service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.9 // source: accounting/grpc/service.proto @@ -18,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + AccountingService_Balance_FullMethodName = "/neo.fs.v2.accounting.AccountingService/Balance" +) + // 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. @@ -41,7 +45,7 @@ func NewAccountingServiceClient(cc grpc.ClientConnInterface) AccountingServiceCl func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) { out := new(BalanceResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.accounting.AccountingService/Balance", in, out, opts...) + err := c.cc.Invoke(ctx, AccountingService_Balance_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -90,7 +94,7 @@ func _AccountingService_Balance_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.accounting.AccountingService/Balance", + FullMethod: AccountingService_Balance_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AccountingServiceServer).Balance(ctx, req.(*BalanceRequest)) diff --git a/accounting/grpc/types.pb.go b/accounting/grpc/types.pb.go index 322a56c..b8dff21 100644 --- a/accounting/grpc/types.pb.go +++ b/accounting/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: accounting/grpc/types.proto diff --git a/acl/grpc/types.pb.go b/acl/grpc/types.pb.go index 583f89a..94a8e47 100644 --- a/acl/grpc/types.pb.go +++ b/acl/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: acl/grpc/types.proto diff --git a/audit/grpc/types.pb.go b/audit/grpc/types.pb.go index b542ec2..a2cac43 100644 --- a/audit/grpc/types.pb.go +++ b/audit/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: audit/grpc/types.proto diff --git a/container/grpc/service.pb.go b/container/grpc/service.pb.go index 6786337..e3bdaf0 100644 --- a/container/grpc/service.pb.go +++ b/container/grpc/service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: container/grpc/service.proto diff --git a/container/grpc/service_grpc.pb.go b/container/grpc/service_grpc.pb.go index 1de8b5f..c70bce7 100644 --- a/container/grpc/service_grpc.pb.go +++ b/container/grpc/service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.9 // source: container/grpc/service.proto @@ -18,6 +18,16 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + ContainerService_Put_FullMethodName = "/neo.fs.v2.container.ContainerService/Put" + ContainerService_Delete_FullMethodName = "/neo.fs.v2.container.ContainerService/Delete" + ContainerService_Get_FullMethodName = "/neo.fs.v2.container.ContainerService/Get" + ContainerService_List_FullMethodName = "/neo.fs.v2.container.ContainerService/List" + ContainerService_SetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/SetExtendedACL" + ContainerService_GetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/GetExtendedACL" + ContainerService_AnnounceUsedSpace_FullMethodName = "/neo.fs.v2.container.ContainerService/AnnounceUsedSpace" +) + // 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. @@ -28,9 +38,9 @@ type ContainerServiceClient interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -38,53 +48,53 @@ type ContainerServiceClient interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) } @@ -98,7 +108,7 @@ func NewContainerServiceClient(cc grpc.ClientConnInterface) ContainerServiceClie func (c *containerServiceClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) { out := new(PutResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.container.ContainerService/Put", in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_Put_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -107,7 +117,7 @@ func (c *containerServiceClient) Put(ctx context.Context, in *PutRequest, opts . func (c *containerServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { out := new(DeleteResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.container.ContainerService/Delete", in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_Delete_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -116,7 +126,7 @@ func (c *containerServiceClient) Delete(ctx context.Context, in *DeleteRequest, func (c *containerServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { out := new(GetResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.container.ContainerService/Get", in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_Get_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -125,7 +135,7 @@ func (c *containerServiceClient) Get(ctx context.Context, in *GetRequest, opts . func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { out := new(ListResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.container.ContainerService/List", in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_List_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -134,7 +144,7 @@ func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts func (c *containerServiceClient) SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) { out := new(SetExtendedACLResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.container.ContainerService/SetExtendedACL", in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_SetExtendedACL_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -143,7 +153,7 @@ func (c *containerServiceClient) SetExtendedACL(ctx context.Context, in *SetExte func (c *containerServiceClient) GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) { out := new(GetExtendedACLResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.container.ContainerService/GetExtendedACL", in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_GetExtendedACL_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -152,7 +162,7 @@ func (c *containerServiceClient) GetExtendedACL(ctx context.Context, in *GetExte func (c *containerServiceClient) AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) { out := new(AnnounceUsedSpaceResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.container.ContainerService/AnnounceUsedSpace", in, out, opts...) + err := c.cc.Invoke(ctx, ContainerService_AnnounceUsedSpace_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -169,9 +179,9 @@ type ContainerServiceServer interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Put(context.Context, *PutRequest) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -179,53 +189,53 @@ type ContainerServiceServer interface { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. Get(context.Context, *GetRequest) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). List(context.Context, *ListRequest) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error) } @@ -276,7 +286,7 @@ func _ContainerService_Put_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.container.ContainerService/Put", + FullMethod: ContainerService_Put_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ContainerServiceServer).Put(ctx, req.(*PutRequest)) @@ -294,7 +304,7 @@ func _ContainerService_Delete_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.container.ContainerService/Delete", + FullMethod: ContainerService_Delete_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ContainerServiceServer).Delete(ctx, req.(*DeleteRequest)) @@ -312,7 +322,7 @@ func _ContainerService_Get_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.container.ContainerService/Get", + FullMethod: ContainerService_Get_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ContainerServiceServer).Get(ctx, req.(*GetRequest)) @@ -330,7 +340,7 @@ func _ContainerService_List_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.container.ContainerService/List", + FullMethod: ContainerService_List_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ContainerServiceServer).List(ctx, req.(*ListRequest)) @@ -348,7 +358,7 @@ func _ContainerService_SetExtendedACL_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.container.ContainerService/SetExtendedACL", + FullMethod: ContainerService_SetExtendedACL_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ContainerServiceServer).SetExtendedACL(ctx, req.(*SetExtendedACLRequest)) @@ -366,7 +376,7 @@ func _ContainerService_GetExtendedACL_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.container.ContainerService/GetExtendedACL", + FullMethod: ContainerService_GetExtendedACL_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ContainerServiceServer).GetExtendedACL(ctx, req.(*GetExtendedACLRequest)) @@ -384,7 +394,7 @@ func _ContainerService_AnnounceUsedSpace_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.container.ContainerService/AnnounceUsedSpace", + FullMethod: ContainerService_AnnounceUsedSpace_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ContainerServiceServer).AnnounceUsedSpace(ctx, req.(*AnnounceUsedSpaceRequest)) diff --git a/container/grpc/types.pb.go b/container/grpc/types.pb.go index 1044617..7f0cc1b 100644 --- a/container/grpc/types.pb.go +++ b/container/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: container/grpc/types.proto diff --git a/lock/grpc/types.pb.go b/lock/grpc/types.pb.go index 22758c1..958476c 100644 --- a/lock/grpc/types.pb.go +++ b/lock/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: lock/grpc/types.proto diff --git a/netmap/grpc/service.pb.go b/netmap/grpc/service.pb.go index d74d7c3..acfe43c 100644 --- a/netmap/grpc/service.pb.go +++ b/netmap/grpc/service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: netmap/grpc/service.proto diff --git a/netmap/grpc/service_grpc.pb.go b/netmap/grpc/service_grpc.pb.go index 9ac25db..3834c3d 100644 --- a/netmap/grpc/service_grpc.pb.go +++ b/netmap/grpc/service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.9 // source: netmap/grpc/service.proto @@ -18,6 +18,12 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + NetmapService_LocalNodeInfo_FullMethodName = "/neo.fs.v2.netmap.NetmapService/LocalNodeInfo" + NetmapService_NetworkInfo_FullMethodName = "/neo.fs.v2.netmap.NetmapService/NetworkInfo" + NetmapService_NetmapSnapshot_FullMethodName = "/neo.fs.v2.netmap.NetmapService/NetmapSnapshot" +) + // 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. @@ -59,7 +65,7 @@ func NewNetmapServiceClient(cc grpc.ClientConnInterface) NetmapServiceClient { func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error) { out := new(LocalNodeInfoResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.netmap.NetmapService/LocalNodeInfo", in, out, opts...) + err := c.cc.Invoke(ctx, NetmapService_LocalNodeInfo_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -68,7 +74,7 @@ func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeIn func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) { out := new(NetworkInfoResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.netmap.NetmapService/NetworkInfo", in, out, opts...) + err := c.cc.Invoke(ctx, NetmapService_NetworkInfo_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -77,7 +83,7 @@ func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRe func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnapshotRequest, opts ...grpc.CallOption) (*NetmapSnapshotResponse, error) { out := new(NetmapSnapshotResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.netmap.NetmapService/NetmapSnapshot", in, out, opts...) + err := c.cc.Invoke(ctx, NetmapService_NetmapSnapshot_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -150,7 +156,7 @@ func _NetmapService_LocalNodeInfo_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.netmap.NetmapService/LocalNodeInfo", + FullMethod: NetmapService_LocalNodeInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NetmapServiceServer).LocalNodeInfo(ctx, req.(*LocalNodeInfoRequest)) @@ -168,7 +174,7 @@ func _NetmapService_NetworkInfo_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.netmap.NetmapService/NetworkInfo", + FullMethod: NetmapService_NetworkInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NetmapServiceServer).NetworkInfo(ctx, req.(*NetworkInfoRequest)) @@ -186,7 +192,7 @@ func _NetmapService_NetmapSnapshot_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.netmap.NetmapService/NetmapSnapshot", + FullMethod: NetmapService_NetmapSnapshot_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NetmapServiceServer).NetmapSnapshot(ctx, req.(*NetmapSnapshotRequest)) diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index 0f017da..276e648 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: netmap/grpc/types.proto diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index 6ba4090..ddda473 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: object/grpc/service.proto diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 6b1c32a..10f33b8 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.9 // source: object/grpc/service.proto @@ -18,6 +18,16 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + ObjectService_Get_FullMethodName = "/neo.fs.v2.object.ObjectService/Get" + ObjectService_Put_FullMethodName = "/neo.fs.v2.object.ObjectService/Put" + ObjectService_Delete_FullMethodName = "/neo.fs.v2.object.ObjectService/Delete" + ObjectService_Head_FullMethodName = "/neo.fs.v2.object.ObjectService/Head" + ObjectService_Search_FullMethodName = "/neo.fs.v2.object.ObjectService/Search" + ObjectService_GetRange_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRange" + ObjectService_GetRangeHash_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRangeHash" +) + // 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. @@ -30,32 +40,32 @@ type ObjectServiceClient interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (ObjectService_GetClient, error) // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -65,106 +75,107 @@ type ObjectServiceClient interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object storage container not found; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation SEARCH of the object is denied; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, 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 @@ -172,33 +183,33 @@ type ObjectServiceClient interface { // order. // // Extended headers can change `GetRange` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRange(ctx context.Context, in *GetRangeRequest, opts ...grpc.CallOption) (ObjectService_GetRangeClient, error) // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -206,31 +217,31 @@ type ObjectServiceClient interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) } @@ -243,7 +254,7 @@ func NewObjectServiceClient(cc grpc.ClientConnInterface) ObjectServiceClient { } 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], "/neo.fs.v2.object.ObjectService/Get", opts...) + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[0], ObjectService_Get_FullMethodName, opts...) if err != nil { return nil, err } @@ -275,7 +286,7 @@ func (x *objectServiceGetClient) Recv() (*GetResponse, error) { } func (c *objectServiceClient) Put(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PutClient, error) { - stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[1], "/neo.fs.v2.object.ObjectService/Put", opts...) + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[1], ObjectService_Put_FullMethodName, opts...) if err != nil { return nil, err } @@ -310,7 +321,7 @@ func (x *objectServicePutClient) CloseAndRecv() (*PutResponse, error) { func (c *objectServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { out := new(DeleteResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.object.ObjectService/Delete", in, out, opts...) + err := c.cc.Invoke(ctx, ObjectService_Delete_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -319,7 +330,7 @@ func (c *objectServiceClient) Delete(ctx context.Context, in *DeleteRequest, opt func (c *objectServiceClient) Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) { out := new(HeadResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.object.ObjectService/Head", in, out, opts...) + err := c.cc.Invoke(ctx, ObjectService_Head_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -327,7 +338,7 @@ func (c *objectServiceClient) Head(ctx context.Context, in *HeadRequest, opts .. } 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], "/neo.fs.v2.object.ObjectService/Search", opts...) + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[2], ObjectService_Search_FullMethodName, opts...) if err != nil { return nil, err } @@ -359,7 +370,7 @@ func (x *objectServiceSearchClient) Recv() (*SearchResponse, error) { } 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], "/neo.fs.v2.object.ObjectService/GetRange", opts...) + stream, err := c.cc.NewStream(ctx, &ObjectService_ServiceDesc.Streams[3], ObjectService_GetRange_FullMethodName, opts...) if err != nil { return nil, err } @@ -392,7 +403,7 @@ func (x *objectServiceGetRangeClient) Recv() (*GetRangeResponse, error) { func (c *objectServiceClient) GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) { out := new(GetRangeHashResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.object.ObjectService/GetRangeHash", in, out, opts...) + err := c.cc.Invoke(ctx, ObjectService_GetRangeHash_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -411,32 +422,32 @@ type ObjectServiceServer interface { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Get(*GetRequest, ObjectService_GetServer) error // Put the object into container. Request uses gRPC stream. First message // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object @@ -446,106 +457,107 @@ type ObjectServiceServer interface { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requsted version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object storage container not found; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Put(ObjectService_PutServer) error // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; - // - **LOCKED** (2050, SECTION_OBJECT): \ - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Head(context.Context, *HeadRequest) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation SEARCH of the object is denied; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. Search(*SearchRequest, ObjectService_SearchServer) 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 @@ -553,33 +565,33 @@ type ObjectServiceServer interface { // order. // // Extended headers can change `GetRange` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, @@ -587,31 +599,31 @@ type ObjectServiceServer interface { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // * [ __SYSTEM__NETMAP_EPOCH ] \ - // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ - // Will use the requested version of Network Map for object placement - // calculation. - // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ - // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions of Network Map to find an object until the depth - // limit is reached. + // - [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON); - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ - // object not found in container; - // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired. + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) } @@ -709,7 +721,7 @@ func _ObjectService_Delete_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.object.ObjectService/Delete", + FullMethod: ObjectService_Delete_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ObjectServiceServer).Delete(ctx, req.(*DeleteRequest)) @@ -727,7 +739,7 @@ func _ObjectService_Head_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.object.ObjectService/Head", + FullMethod: ObjectService_Head_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ObjectServiceServer).Head(ctx, req.(*HeadRequest)) @@ -787,7 +799,7 @@ func _ObjectService_GetRangeHash_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.object.ObjectService/GetRangeHash", + FullMethod: ObjectService_GetRangeHash_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ObjectServiceServer).GetRangeHash(ctx, req.(*GetRangeHashRequest)) diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 506adda..11cb63e 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: object/grpc/types.proto diff --git a/refs/grpc/types.pb.go b/refs/grpc/types.pb.go index 5e9bfb5..0d6b671 100644 --- a/refs/grpc/types.pb.go +++ b/refs/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: refs/grpc/types.proto diff --git a/reputation/convert.go b/reputation/convert.go deleted file mode 100644 index ca54261..0000000 --- a/reputation/convert.go +++ /dev/null @@ -1,604 +0,0 @@ -package reputation - -import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - reputation "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" -) - -// ToGRPCMessage converts PeerID to gRPC-generated -// reputation.PeerID message. -func (x *PeerID) ToGRPCMessage() grpc.Message { - var m *reputation.PeerID - - if x != nil { - m = new(reputation.PeerID) - - m.SetPublicKey(x.publicKey) - } - - return m -} - -// FromGRPCMessage tries to restore PeerID from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.PeerID message. -func (x *PeerID) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.PeerID) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - x.publicKey = v.GetPublicKey() - - return nil -} - -// ToGRPCMessage converts Trust to gRPC-generated -// reputation.Trust message. -func (x *Trust) ToGRPCMessage() grpc.Message { - var m *reputation.Trust - - if x != nil { - m = new(reputation.Trust) - - m.SetValue(x.val) - m.SetPeer(x.peer.ToGRPCMessage().(*reputation.PeerID)) - } - - return m -} - -// FromGRPCMessage tries to restore Trust from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.Trust message. -func (x *Trust) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.Trust) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - peer := v.GetPeer() - if peer == nil { - x.peer = nil - } else { - if x.peer == nil { - x.peer = new(PeerID) - } - - err := x.peer.FromGRPCMessage(peer) - if err != nil { - return err - } - } - - x.val = v.GetValue() - - return nil -} - -// ToGRPCMessage converts PeerToPeerTrust to gRPC-generated -// reputation.PeerToPeerTrust message. -func (x *PeerToPeerTrust) ToGRPCMessage() grpc.Message { - var m *reputation.PeerToPeerTrust - - if x != nil { - m = new(reputation.PeerToPeerTrust) - - m.SetTrustingPeer(x.trusting.ToGRPCMessage().(*reputation.PeerID)) - m.SetTrust(x.trust.ToGRPCMessage().(*reputation.Trust)) - } - - return m -} - -// FromGRPCMessage tries to restore PeerToPeerTrust from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.PeerToPeerTrust message. -func (x *PeerToPeerTrust) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.PeerToPeerTrust) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - trusting := v.GetTrustingPeer() - if trusting == nil { - x.trusting = nil - } else { - if x.trusting == nil { - x.trusting = new(PeerID) - } - - err = x.trusting.FromGRPCMessage(trusting) - if err != nil { - return err - } - } - - trust := v.GetTrust() - if trust == nil { - x.trust = nil - } else { - if x.trust == nil { - x.trust = new(Trust) - } - - err = x.trust.FromGRPCMessage(trust) - } - - return err -} - -// TrustsToGRPC converts slice of Trust structures -// to slice of gRPC-generated Trust messages. -func TrustsToGRPC(xs []Trust) (res []*reputation.Trust) { - if xs != nil { - res = make([]*reputation.Trust, 0, len(xs)) - - for i := range xs { - res = append(res, xs[i].ToGRPCMessage().(*reputation.Trust)) - } - } - - return -} - -// TrustsFromGRPC tries to restore slice of Trust structures from -// slice of gRPC-generated reputation.Trust messages. -func TrustsFromGRPC(xs []*reputation.Trust) (res []Trust, err error) { - if xs != nil { - res = make([]Trust, len(xs)) - - for i := range xs { - if xs[i] != nil { - err = res[i].FromGRPCMessage(xs[i]) - if err != nil { - return - } - } - } - } - - return -} - -// ToGRPCMessage converts GlobalTrustBody to gRPC-generated -// reputation.GlobalTrust_Body message. -func (x *GlobalTrustBody) ToGRPCMessage() grpc.Message { - var m *reputation.GlobalTrust_Body - - if x != nil { - m = new(reputation.GlobalTrust_Body) - - m.SetManager(x.manager.ToGRPCMessage().(*reputation.PeerID)) - m.SetTrust(x.trust.ToGRPCMessage().(*reputation.Trust)) - } - - return m -} - -// FromGRPCMessage tries to restore GlobalTrustBody from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.GlobalTrust_Body message. -func (x *GlobalTrustBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.GlobalTrust_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - manager := v.GetManager() - if manager == nil { - x.manager = nil - } else { - if x.manager == nil { - x.manager = new(PeerID) - } - - err = x.manager.FromGRPCMessage(manager) - if err != nil { - return err - } - } - - trust := v.GetTrust() - if trust == nil { - x.trust = nil - } else { - if x.trust == nil { - x.trust = new(Trust) - } - - err = x.trust.FromGRPCMessage(trust) - } - - return err -} - -// ToGRPCMessage converts GlobalTrust to gRPC-generated -// reputation.GlobalTrust message. -func (x *GlobalTrust) ToGRPCMessage() grpc.Message { - var m *reputation.GlobalTrust - - if x != nil { - m = new(reputation.GlobalTrust) - - m.SetVersion(x.version.ToGRPCMessage().(*refsGRPC.Version)) - m.SetBody(x.body.ToGRPCMessage().(*reputation.GlobalTrust_Body)) - m.SetSignature(x.sig.ToGRPCMessage().(*refsGRPC.Signature)) - } - - return m -} - -// FromGRPCMessage tries to restore GlobalTrust from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.GlobalTrust message. -func (x *GlobalTrust) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.GlobalTrust) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - version := v.GetVersion() - if version == nil { - x.version = nil - } else { - if x.version == nil { - x.version = new(refs.Version) - } - - err = x.version.FromGRPCMessage(version) - if err != nil { - return err - } - } - - body := v.GetBody() - if body == nil { - x.body = nil - } else { - if x.body == nil { - x.body = new(GlobalTrustBody) - } - - err = x.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - sig := v.GetSignature() - if sig == nil { - x.sig = nil - } else { - if x.sig == nil { - x.sig = new(refs.Signature) - } - - err = x.sig.FromGRPCMessage(sig) - } - - return err -} - -// ToGRPCMessage converts AnnounceLocalTrustRequestBody to gRPC-generated -// reputation.AnnounceLocalTrustRequest_Body message. -func (x *AnnounceLocalTrustRequestBody) ToGRPCMessage() grpc.Message { - var m *reputation.AnnounceLocalTrustRequest_Body - - if x != nil { - m = new(reputation.AnnounceLocalTrustRequest_Body) - - m.SetEpoch(x.epoch) - m.SetTrusts(TrustsToGRPC(x.trusts)) - } - - return m -} - -// FromGRPCMessage tries to restore AnnounceLocalTrustRequestBody from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.AnnounceLocalTrustRequest_Body message. -func (x *AnnounceLocalTrustRequestBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.AnnounceLocalTrustRequest_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - x.trusts, err = TrustsFromGRPC(v.GetTrusts()) - if err != nil { - return err - } - - x.epoch = v.GetEpoch() - - return nil -} - -// ToGRPCMessage converts AnnounceLocalTrustRequest to gRPC-generated -// reputation.AnnounceLocalTrustRequest message. -func (x *AnnounceLocalTrustRequest) ToGRPCMessage() grpc.Message { - var m *reputation.AnnounceLocalTrustRequest - - if x != nil { - m = new(reputation.AnnounceLocalTrustRequest) - - m.SetBody(x.body.ToGRPCMessage().(*reputation.AnnounceLocalTrustRequest_Body)) - x.RequestHeaders.ToMessage(m) - } - - return m -} - -// FromGRPCMessage tries to restore AnnounceLocalTrustRequest from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.AnnounceLocalTrustRequest message. -func (x *AnnounceLocalTrustRequest) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.AnnounceLocalTrustRequest) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - body := v.GetBody() - if body == nil { - x.body = nil - } else { - if x.body == nil { - x.body = new(AnnounceLocalTrustRequestBody) - } - - err = x.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - return x.RequestHeaders.FromMessage(v) -} - -// ToGRPCMessage converts AnnounceLocalTrustResponseBody to gRPC-generated -// reputation.AnnounceLocalTrustResponse_Body message. -func (x *AnnounceLocalTrustResponseBody) ToGRPCMessage() grpc.Message { - var m *reputation.AnnounceLocalTrustResponse_Body - - if x != nil { - m = new(reputation.AnnounceLocalTrustResponse_Body) - } - - return m -} - -// FromGRPCMessage tries to restore AnnounceLocalTrustResponseBody from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.AnnounceLocalTrustResponse_Body message. -func (x *AnnounceLocalTrustResponseBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.AnnounceLocalTrustResponse_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - return nil -} - -// ToGRPCMessage converts AnnounceLocalTrustResponse to gRPC-generated -// reputation.AnnounceLocalTrustResponse message. -func (x *AnnounceLocalTrustResponse) ToGRPCMessage() grpc.Message { - var m *reputation.AnnounceLocalTrustResponse - - if x != nil { - m = new(reputation.AnnounceLocalTrustResponse) - - m.SetBody(x.body.ToGRPCMessage().(*reputation.AnnounceLocalTrustResponse_Body)) - x.ResponseHeaders.ToMessage(m) - } - - return m -} - -// FromGRPCMessage tries to restore AnnounceLocalTrustResponse from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.AnnounceLocalTrustResponse message. -func (x *AnnounceLocalTrustResponse) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.AnnounceLocalTrustResponse) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - body := v.GetBody() - if body == nil { - x.body = nil - } else { - if x.body == nil { - x.body = new(AnnounceLocalTrustResponseBody) - } - - err = x.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - return x.ResponseHeaders.FromMessage(v) -} - -// ToGRPCMessage converts AnnounceIntermediateResultRequestBody to gRPC-generated -// reputation.AnnounceIntermediateResultRequest_Body message. -func (x *AnnounceIntermediateResultRequestBody) ToGRPCMessage() grpc.Message { - var m *reputation.AnnounceIntermediateResultRequest_Body - - if x != nil { - m = new(reputation.AnnounceIntermediateResultRequest_Body) - - m.SetEpoch(x.epoch) - m.SetIteration(x.iter) - m.SetTrust(x.trust.ToGRPCMessage().(*reputation.PeerToPeerTrust)) - } - - return m -} - -// FromGRPCMessage tries to restore AnnounceIntermediateResultRequestBody from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.AnnounceIntermediateResultRequest_Body message. -func (x *AnnounceIntermediateResultRequestBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.AnnounceIntermediateResultRequest_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - trust := v.GetTrust() - if trust == nil { - x.trust = nil - } else { - if x.trust == nil { - x.trust = new(PeerToPeerTrust) - } - - err := x.trust.FromGRPCMessage(trust) - if err != nil { - return err - } - } - - x.epoch = v.GetEpoch() - x.iter = v.GetIteration() - - return nil -} - -// ToGRPCMessage converts AnnounceIntermediateResultRequest to gRPC-generated -// reputation.AnnounceIntermediateResultRequest message. -func (x *AnnounceIntermediateResultRequest) ToGRPCMessage() grpc.Message { - var m *reputation.AnnounceIntermediateResultRequest - - if x != nil { - m = new(reputation.AnnounceIntermediateResultRequest) - - m.SetBody(x.body.ToGRPCMessage().(*reputation.AnnounceIntermediateResultRequest_Body)) - x.RequestHeaders.ToMessage(m) - } - - return m -} - -// FromGRPCMessage tries to restore AnnounceIntermediateResultRequest from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.AnnounceIntermediateResultRequest message. -func (x *AnnounceIntermediateResultRequest) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.AnnounceIntermediateResultRequest) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - body := v.GetBody() - if body == nil { - x.body = nil - } else { - if x.body == nil { - x.body = new(AnnounceIntermediateResultRequestBody) - } - - err = x.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - return x.RequestHeaders.FromMessage(v) -} - -// ToGRPCMessage converts AnnounceIntermediateResultResponseBody to gRPC-generated -// reputation.AnnounceIntermediateResultResponse_Body message. -func (x *AnnounceIntermediateResultResponseBody) ToGRPCMessage() grpc.Message { - var m *reputation.AnnounceIntermediateResultResponse_Body - - if x != nil { - m = new(reputation.AnnounceIntermediateResultResponse_Body) - } - - return m -} - -// FromGRPCMessage tries to restore AnnounceIntermediateResultResponseBody from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.AnnounceIntermediateResultResponse_Body message. -func (x *AnnounceIntermediateResultResponseBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.AnnounceIntermediateResultResponse_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - return nil -} - -// ToGRPCMessage converts AnnounceIntermediateResultResponse to gRPC-generated -// reputation.AnnounceIntermediateResultResponse message. -func (x *AnnounceIntermediateResultResponse) ToGRPCMessage() grpc.Message { - var m *reputation.AnnounceIntermediateResultResponse - - if x != nil { - m = new(reputation.AnnounceIntermediateResultResponse) - - m.SetBody(x.body.ToGRPCMessage().(*reputation.AnnounceIntermediateResultResponse_Body)) - x.ResponseHeaders.ToMessage(m) - } - - return m -} - -// FromGRPCMessage tries to restore AnnounceIntermediateResultResponse from grpc.Message. -// -// Returns message.ErrUnexpectedMessageType if m is not -// a gRPC-generated reputation.AnnounceIntermediateResultResponse message. -func (x *AnnounceIntermediateResultResponse) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*reputation.AnnounceIntermediateResultResponse) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - body := v.GetBody() - if body == nil { - x.body = nil - } else { - if x.body == nil { - x.body = new(AnnounceIntermediateResultResponseBody) - } - - err = x.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - return x.ResponseHeaders.FromMessage(v) -} diff --git a/reputation/grpc/service.go b/reputation/grpc/service.go deleted file mode 100644 index 81ed890..0000000 --- a/reputation/grpc/service.go +++ /dev/null @@ -1,90 +0,0 @@ -package reputation - -import ( - session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" -) - -// SetEpoch sets epoch in which the trust was assessed. -func (x *AnnounceLocalTrustRequest_Body) SetEpoch(v uint64) { - x.Epoch = v -} - -// SetTrusts sets list of normalized trust values. -func (x *AnnounceLocalTrustRequest_Body) SetTrusts(v []*Trust) { - x.Trusts = v -} - -// SetBody sets body of the request. -func (x *AnnounceLocalTrustRequest) SetBody(v *AnnounceLocalTrustRequest_Body) { - x.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (x *AnnounceLocalTrustRequest) SetMetaHeader(v *session.RequestMetaHeader) { - x.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (x *AnnounceLocalTrustRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - x.VerifyHeader = v -} - -// SetBody sets body of the response. -func (x *AnnounceLocalTrustResponse) SetBody(v *AnnounceLocalTrustResponse_Body) { - x.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (x *AnnounceLocalTrustResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - x.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (x *AnnounceLocalTrustResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - x.VerifyHeader = v -} - -// SetEpoch sets epoch in which the intermediate trust was assessed. -func (x *AnnounceIntermediateResultRequest_Body) SetEpoch(v uint64) { - x.Epoch = v -} - -// SetIteration sets sequence number of the iteration. -func (x *AnnounceIntermediateResultRequest_Body) SetIteration(v uint32) { - x.Iteration = v -} - -// SetTrust sets current global trust value. -func (x *AnnounceIntermediateResultRequest_Body) SetTrust(v *PeerToPeerTrust) { - x.Trust = v -} - -// SetBody sets body of the request. -func (x *AnnounceIntermediateResultRequest) SetBody(v *AnnounceIntermediateResultRequest_Body) { - x.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (x *AnnounceIntermediateResultRequest) SetMetaHeader(v *session.RequestMetaHeader) { - x.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (x *AnnounceIntermediateResultRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - x.VerifyHeader = v -} - -// SetBody sets body of the response. -func (x *AnnounceIntermediateResultResponse) SetBody(v *AnnounceIntermediateResultResponse_Body) { - x.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (x *AnnounceIntermediateResultResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - x.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (x *AnnounceIntermediateResultResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - x.VerifyHeader = v -} diff --git a/reputation/grpc/service.pb.go b/reputation/grpc/service.pb.go deleted file mode 100644 index 2d0f61f..0000000 --- a/reputation/grpc/service.pb.go +++ /dev/null @@ -1,808 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc v3.21.9 -// source: reputation/grpc/service.proto - -package reputation - -import ( - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Announce node's local trust information. -type AnnounceLocalTrustRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of the request message. - Body *AnnounceLocalTrustRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *AnnounceLocalTrustRequest) Reset() { - *x = AnnounceLocalTrustRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceLocalTrustRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceLocalTrustRequest) ProtoMessage() {} - -func (x *AnnounceLocalTrustRequest) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceLocalTrustRequest.ProtoReflect.Descriptor instead. -func (*AnnounceLocalTrustRequest) Descriptor() ([]byte, []int) { - return file_reputation_grpc_service_proto_rawDescGZIP(), []int{0} -} - -func (x *AnnounceLocalTrustRequest) GetBody() *AnnounceLocalTrustRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *AnnounceLocalTrustRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *AnnounceLocalTrustRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Node's local trust information announcement response. -type AnnounceLocalTrustResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of the response message. - Body *AnnounceLocalTrustResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *AnnounceLocalTrustResponse) Reset() { - *x = AnnounceLocalTrustResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceLocalTrustResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceLocalTrustResponse) ProtoMessage() {} - -func (x *AnnounceLocalTrustResponse) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceLocalTrustResponse.ProtoReflect.Descriptor instead. -func (*AnnounceLocalTrustResponse) Descriptor() ([]byte, []int) { - return file_reputation_grpc_service_proto_rawDescGZIP(), []int{1} -} - -func (x *AnnounceLocalTrustResponse) GetBody() *AnnounceLocalTrustResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *AnnounceLocalTrustResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *AnnounceLocalTrustResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Announce intermediate global trust information. -type AnnounceIntermediateResultRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of the request message. - Body *AnnounceIntermediateResultRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *AnnounceIntermediateResultRequest) Reset() { - *x = AnnounceIntermediateResultRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceIntermediateResultRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceIntermediateResultRequest) ProtoMessage() {} - -func (x *AnnounceIntermediateResultRequest) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceIntermediateResultRequest.ProtoReflect.Descriptor instead. -func (*AnnounceIntermediateResultRequest) Descriptor() ([]byte, []int) { - return file_reputation_grpc_service_proto_rawDescGZIP(), []int{2} -} - -func (x *AnnounceIntermediateResultRequest) GetBody() *AnnounceIntermediateResultRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *AnnounceIntermediateResultRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *AnnounceIntermediateResultRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Intermediate global trust information announcement response. -type AnnounceIntermediateResultResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of the response message. - Body *AnnounceIntermediateResultResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *AnnounceIntermediateResultResponse) Reset() { - *x = AnnounceIntermediateResultResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceIntermediateResultResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceIntermediateResultResponse) ProtoMessage() {} - -func (x *AnnounceIntermediateResultResponse) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceIntermediateResultResponse.ProtoReflect.Descriptor instead. -func (*AnnounceIntermediateResultResponse) Descriptor() ([]byte, []int) { - return file_reputation_grpc_service_proto_rawDescGZIP(), []int{3} -} - -func (x *AnnounceIntermediateResultResponse) GetBody() *AnnounceIntermediateResultResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *AnnounceIntermediateResultResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *AnnounceIntermediateResultResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Announce node's local trust information. -type AnnounceLocalTrustRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Trust assessment Epoch number - Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` - // List of normalized local trust values to other NeoFS nodes. The value - // is calculated according to EigenTrust++ algorithm and must be a - // floating point number in [0;1] range. - Trusts []*Trust `protobuf:"bytes,2,rep,name=trusts,proto3" json:"trusts,omitempty"` -} - -func (x *AnnounceLocalTrustRequest_Body) Reset() { - *x = AnnounceLocalTrustRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceLocalTrustRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceLocalTrustRequest_Body) ProtoMessage() {} - -func (x *AnnounceLocalTrustRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceLocalTrustRequest_Body.ProtoReflect.Descriptor instead. -func (*AnnounceLocalTrustRequest_Body) Descriptor() ([]byte, []int) { - return file_reputation_grpc_service_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *AnnounceLocalTrustRequest_Body) GetEpoch() uint64 { - if x != nil { - return x.Epoch - } - return 0 -} - -func (x *AnnounceLocalTrustRequest_Body) GetTrusts() []*Trust { - if x != nil { - return x.Trusts - } - return nil -} - -// Response to the node's local trust information announcement has an empty body -// because the trust exchange operation is asynchronous. If Trust information -// does not pass sanity checks, it is silently ignored. -type AnnounceLocalTrustResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AnnounceLocalTrustResponse_Body) Reset() { - *x = AnnounceLocalTrustResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceLocalTrustResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceLocalTrustResponse_Body) ProtoMessage() {} - -func (x *AnnounceLocalTrustResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_service_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceLocalTrustResponse_Body.ProtoReflect.Descriptor instead. -func (*AnnounceLocalTrustResponse_Body) Descriptor() ([]byte, []int) { - return file_reputation_grpc_service_proto_rawDescGZIP(), []int{1, 0} -} - -// Announce intermediate global trust information. -type AnnounceIntermediateResultRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Iteration execution Epoch number - Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` - // Iteration sequence number - Iteration uint32 `protobuf:"varint,2,opt,name=iteration,proto3" json:"iteration,omitempty"` - // Current global trust value calculated at the specified iteration - Trust *PeerToPeerTrust `protobuf:"bytes,3,opt,name=trust,proto3" json:"trust,omitempty"` -} - -func (x *AnnounceIntermediateResultRequest_Body) Reset() { - *x = AnnounceIntermediateResultRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceIntermediateResultRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceIntermediateResultRequest_Body) ProtoMessage() {} - -func (x *AnnounceIntermediateResultRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_service_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceIntermediateResultRequest_Body.ProtoReflect.Descriptor instead. -func (*AnnounceIntermediateResultRequest_Body) Descriptor() ([]byte, []int) { - return file_reputation_grpc_service_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *AnnounceIntermediateResultRequest_Body) GetEpoch() uint64 { - if x != nil { - return x.Epoch - } - return 0 -} - -func (x *AnnounceIntermediateResultRequest_Body) GetIteration() uint32 { - if x != nil { - return x.Iteration - } - return 0 -} - -func (x *AnnounceIntermediateResultRequest_Body) GetTrust() *PeerToPeerTrust { - if x != nil { - return x.Trust - } - return nil -} - -// Response to the node's intermediate global trust information announcement has -// an empty body because the trust exchange operation is asynchronous. If -// Trust information does not pass sanity checks, it is silently ignored. -type AnnounceIntermediateResultResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AnnounceIntermediateResultResponse_Body) Reset() { - *x = AnnounceIntermediateResultResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_service_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceIntermediateResultResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceIntermediateResultResponse_Body) ProtoMessage() {} - -func (x *AnnounceIntermediateResultResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_service_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceIntermediateResultResponse_Body.ProtoReflect.Descriptor instead. -func (*AnnounceIntermediateResultResponse_Body) Descriptor() ([]byte, []int) { - return file_reputation_grpc_service_proto_rawDescGZIP(), []int{3, 0} -} - -var File_reputation_grpc_service_proto protoreflect.FileDescriptor - -var file_reputation_grpc_service_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x72, 0x65, 0x70, 0x75, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x1b, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd2, 0x02, 0x0a, - 0x19, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x72, - 0x75, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x72, 0x75, - 0x73, 0x74, 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, 0x51, - 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x33, 0x0a, 0x06, - 0x74, 0x72, 0x75, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, 0x06, 0x74, 0x72, 0x75, 0x73, 0x74, - 0x73, 0x22, 0x8b, 0x02, 0x0a, 0x1a, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, - 0x63, 0x61, 0x6c, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x49, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, - 0x63, 0x61, 0x6c, 0x54, 0x72, 0x75, 0x73, 0x74, 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, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, - 0x88, 0x03, 0x0a, 0x21, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, - 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 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, 0x77, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, - 0x1c, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, - 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x54, 0x6f, 0x50, 0x65, 0x65, 0x72, 0x54, 0x72, - 0x75, 0x73, 0x74, 0x52, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x22, 0x9b, 0x02, 0x0a, 0x22, 0x41, - 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x51, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x3d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 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, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x32, 0x9e, 0x02, 0x0a, 0x11, 0x52, 0x65, 0x70, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x77, - 0x0a, 0x12, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x54, - 0x72, 0x75, 0x73, 0x74, 0x12, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, - 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, - 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x1a, 0x41, 0x6e, 0x6e, 0x6f, - 0x75, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x37, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, - 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x38, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74, - 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, - 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x70, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, 0x70, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, - 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_reputation_grpc_service_proto_rawDescOnce sync.Once - file_reputation_grpc_service_proto_rawDescData = file_reputation_grpc_service_proto_rawDesc -) - -func file_reputation_grpc_service_proto_rawDescGZIP() []byte { - file_reputation_grpc_service_proto_rawDescOnce.Do(func() { - file_reputation_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_reputation_grpc_service_proto_rawDescData) - }) - return file_reputation_grpc_service_proto_rawDescData -} - -var file_reputation_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_reputation_grpc_service_proto_goTypes = []interface{}{ - (*AnnounceLocalTrustRequest)(nil), // 0: neo.fs.v2.reputation.AnnounceLocalTrustRequest - (*AnnounceLocalTrustResponse)(nil), // 1: neo.fs.v2.reputation.AnnounceLocalTrustResponse - (*AnnounceIntermediateResultRequest)(nil), // 2: neo.fs.v2.reputation.AnnounceIntermediateResultRequest - (*AnnounceIntermediateResultResponse)(nil), // 3: neo.fs.v2.reputation.AnnounceIntermediateResultResponse - (*AnnounceLocalTrustRequest_Body)(nil), // 4: neo.fs.v2.reputation.AnnounceLocalTrustRequest.Body - (*AnnounceLocalTrustResponse_Body)(nil), // 5: neo.fs.v2.reputation.AnnounceLocalTrustResponse.Body - (*AnnounceIntermediateResultRequest_Body)(nil), // 6: neo.fs.v2.reputation.AnnounceIntermediateResultRequest.Body - (*AnnounceIntermediateResultResponse_Body)(nil), // 7: neo.fs.v2.reputation.AnnounceIntermediateResultResponse.Body - (*grpc.RequestMetaHeader)(nil), // 8: neo.fs.v2.session.RequestMetaHeader - (*grpc.RequestVerificationHeader)(nil), // 9: neo.fs.v2.session.RequestVerificationHeader - (*grpc.ResponseMetaHeader)(nil), // 10: neo.fs.v2.session.ResponseMetaHeader - (*grpc.ResponseVerificationHeader)(nil), // 11: neo.fs.v2.session.ResponseVerificationHeader - (*Trust)(nil), // 12: neo.fs.v2.reputation.Trust - (*PeerToPeerTrust)(nil), // 13: neo.fs.v2.reputation.PeerToPeerTrust -} -var file_reputation_grpc_service_proto_depIdxs = []int32{ - 4, // 0: neo.fs.v2.reputation.AnnounceLocalTrustRequest.body:type_name -> neo.fs.v2.reputation.AnnounceLocalTrustRequest.Body - 8, // 1: neo.fs.v2.reputation.AnnounceLocalTrustRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 9, // 2: neo.fs.v2.reputation.AnnounceLocalTrustRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 5, // 3: neo.fs.v2.reputation.AnnounceLocalTrustResponse.body:type_name -> neo.fs.v2.reputation.AnnounceLocalTrustResponse.Body - 10, // 4: neo.fs.v2.reputation.AnnounceLocalTrustResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 11, // 5: neo.fs.v2.reputation.AnnounceLocalTrustResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 6, // 6: neo.fs.v2.reputation.AnnounceIntermediateResultRequest.body:type_name -> neo.fs.v2.reputation.AnnounceIntermediateResultRequest.Body - 8, // 7: neo.fs.v2.reputation.AnnounceIntermediateResultRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 9, // 8: neo.fs.v2.reputation.AnnounceIntermediateResultRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 7, // 9: neo.fs.v2.reputation.AnnounceIntermediateResultResponse.body:type_name -> neo.fs.v2.reputation.AnnounceIntermediateResultResponse.Body - 10, // 10: neo.fs.v2.reputation.AnnounceIntermediateResultResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 11, // 11: neo.fs.v2.reputation.AnnounceIntermediateResultResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 12, // 12: neo.fs.v2.reputation.AnnounceLocalTrustRequest.Body.trusts:type_name -> neo.fs.v2.reputation.Trust - 13, // 13: neo.fs.v2.reputation.AnnounceIntermediateResultRequest.Body.trust:type_name -> neo.fs.v2.reputation.PeerToPeerTrust - 0, // 14: neo.fs.v2.reputation.ReputationService.AnnounceLocalTrust:input_type -> neo.fs.v2.reputation.AnnounceLocalTrustRequest - 2, // 15: neo.fs.v2.reputation.ReputationService.AnnounceIntermediateResult:input_type -> neo.fs.v2.reputation.AnnounceIntermediateResultRequest - 1, // 16: neo.fs.v2.reputation.ReputationService.AnnounceLocalTrust:output_type -> neo.fs.v2.reputation.AnnounceLocalTrustResponse - 3, // 17: neo.fs.v2.reputation.ReputationService.AnnounceIntermediateResult:output_type -> neo.fs.v2.reputation.AnnounceIntermediateResultResponse - 16, // [16:18] is the sub-list for method output_type - 14, // [14:16] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name -} - -func init() { file_reputation_grpc_service_proto_init() } -func file_reputation_grpc_service_proto_init() { - if File_reputation_grpc_service_proto != nil { - return - } - file_reputation_grpc_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_reputation_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceLocalTrustRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceLocalTrustResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceIntermediateResultRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceIntermediateResultResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceLocalTrustRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceLocalTrustResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceIntermediateResultRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceIntermediateResultResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_reputation_grpc_service_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_reputation_grpc_service_proto_goTypes, - DependencyIndexes: file_reputation_grpc_service_proto_depIdxs, - MessageInfos: file_reputation_grpc_service_proto_msgTypes, - }.Build() - File_reputation_grpc_service_proto = out.File - file_reputation_grpc_service_proto_rawDesc = nil - file_reputation_grpc_service_proto_goTypes = nil - file_reputation_grpc_service_proto_depIdxs = nil -} diff --git a/reputation/grpc/service_grpc.pb.go b/reputation/grpc/service_grpc.pb.go deleted file mode 100644 index 582a8cd..0000000 --- a/reputation/grpc/service_grpc.pb.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.9 -// source: reputation/grpc/service.proto - -package reputation - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -// ReputationServiceClient is the client API for ReputationService 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. -type ReputationServiceClient interface { - // Announce local client trust information to any node in NeoFS network. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // local trust has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). - AnnounceLocalTrust(ctx context.Context, in *AnnounceLocalTrustRequest, opts ...grpc.CallOption) (*AnnounceLocalTrustResponse, error) - // Announce the intermediate result of the iterative algorithm for - // calculating the global reputation of the node in NeoFS network. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // intermediate trust estimation has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). - AnnounceIntermediateResult(ctx context.Context, in *AnnounceIntermediateResultRequest, opts ...grpc.CallOption) (*AnnounceIntermediateResultResponse, error) -} - -type reputationServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewReputationServiceClient(cc grpc.ClientConnInterface) ReputationServiceClient { - return &reputationServiceClient{cc} -} - -func (c *reputationServiceClient) AnnounceLocalTrust(ctx context.Context, in *AnnounceLocalTrustRequest, opts ...grpc.CallOption) (*AnnounceLocalTrustResponse, error) { - out := new(AnnounceLocalTrustResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.reputation.ReputationService/AnnounceLocalTrust", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reputationServiceClient) AnnounceIntermediateResult(ctx context.Context, in *AnnounceIntermediateResultRequest, opts ...grpc.CallOption) (*AnnounceIntermediateResultResponse, error) { - out := new(AnnounceIntermediateResultResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.reputation.ReputationService/AnnounceIntermediateResult", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ReputationServiceServer is the server API for ReputationService service. -// All implementations should embed UnimplementedReputationServiceServer -// for forward compatibility -type ReputationServiceServer interface { - // Announce local client trust information to any node in NeoFS network. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // local trust has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). - AnnounceLocalTrust(context.Context, *AnnounceLocalTrustRequest) (*AnnounceLocalTrustResponse, error) - // Announce the intermediate result of the iterative algorithm for - // calculating the global reputation of the node in NeoFS network. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // intermediate trust estimation has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). - AnnounceIntermediateResult(context.Context, *AnnounceIntermediateResultRequest) (*AnnounceIntermediateResultResponse, error) -} - -// UnimplementedReputationServiceServer should be embedded to have forward compatible implementations. -type UnimplementedReputationServiceServer struct { -} - -func (UnimplementedReputationServiceServer) AnnounceLocalTrust(context.Context, *AnnounceLocalTrustRequest) (*AnnounceLocalTrustResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AnnounceLocalTrust not implemented") -} -func (UnimplementedReputationServiceServer) AnnounceIntermediateResult(context.Context, *AnnounceIntermediateResultRequest) (*AnnounceIntermediateResultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AnnounceIntermediateResult not implemented") -} - -// UnsafeReputationServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ReputationServiceServer will -// result in compilation errors. -type UnsafeReputationServiceServer interface { - mustEmbedUnimplementedReputationServiceServer() -} - -func RegisterReputationServiceServer(s grpc.ServiceRegistrar, srv ReputationServiceServer) { - s.RegisterService(&ReputationService_ServiceDesc, srv) -} - -func _ReputationService_AnnounceLocalTrust_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AnnounceLocalTrustRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReputationServiceServer).AnnounceLocalTrust(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neo.fs.v2.reputation.ReputationService/AnnounceLocalTrust", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReputationServiceServer).AnnounceLocalTrust(ctx, req.(*AnnounceLocalTrustRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReputationService_AnnounceIntermediateResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AnnounceIntermediateResultRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReputationServiceServer).AnnounceIntermediateResult(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/neo.fs.v2.reputation.ReputationService/AnnounceIntermediateResult", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReputationServiceServer).AnnounceIntermediateResult(ctx, req.(*AnnounceIntermediateResultRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ReputationService_ServiceDesc is the grpc.ServiceDesc for ReputationService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ReputationService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "neo.fs.v2.reputation.ReputationService", - HandlerType: (*ReputationServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AnnounceLocalTrust", - Handler: _ReputationService_AnnounceLocalTrust_Handler, - }, - { - MethodName: "AnnounceIntermediateResult", - Handler: _ReputationService_AnnounceIntermediateResult_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "reputation/grpc/service.proto", -} diff --git a/reputation/grpc/types.go b/reputation/grpc/types.go deleted file mode 100644 index 63f2d34..0000000 --- a/reputation/grpc/types.go +++ /dev/null @@ -1,55 +0,0 @@ -package reputation - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" -) - -// SetPublicKey sets binary public key of ID. -func (x *PeerID) SetPublicKey(v []byte) { - x.PublicKey = v -} - -// SetPeer sets trusted peer's ID. -func (x *Trust) SetPeer(v *PeerID) { - x.Peer = v -} - -// SetValue sets trust value. -func (x *Trust) SetValue(v float64) { - x.Value = v -} - -// SetTrustingPeer sets trusting peer ID. -func (x *PeerToPeerTrust) SetTrustingPeer(v *PeerID) { - x.TrustingPeer = v -} - -// SetTrust sets trust value of trusting peer to the trusted one. -func (x *PeerToPeerTrust) SetTrust(v *Trust) { - x.Trust = v -} - -// SetManager sets manager ID. -func (x *GlobalTrust_Body) SetManager(v *PeerID) { - x.Manager = v -} - -// SetTrust sets global trust value. -func (x *GlobalTrust_Body) SetTrust(v *Trust) { - x.Trust = v -} - -// SetVersion sets message format version. -func (x *GlobalTrust) SetVersion(v *refs.Version) { - x.Version = v -} - -// SetBody sets message body. -func (x *GlobalTrust) SetBody(v *GlobalTrust_Body) { - x.Body = v -} - -// SetSignature sets body signature. -func (x *GlobalTrust) SetSignature(v *refs.Signature) { - x.Signature = v -} diff --git a/reputation/grpc/types.pb.go b/reputation/grpc/types.pb.go deleted file mode 100644 index b95b240..0000000 --- a/reputation/grpc/types.pb.go +++ /dev/null @@ -1,500 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc v3.21.9 -// source: reputation/grpc/types.proto - -package reputation - -import ( - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// NeoFS unique peer identifier is a 33 byte long compressed public key of the -// node, the same as the one stored in the network map. -// -// String presentation is a -// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. -// -// JSON value will be data encoded as a string using standard base64 -// encoding with paddings. Either -// [standard](https://tools.ietf.org/html/rfc4648#section-4) or -// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding -// with/without paddings are accepted. -type PeerID struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Peer node's public key - PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` -} - -func (x *PeerID) Reset() { - *x = PeerID{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PeerID) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PeerID) ProtoMessage() {} - -func (x *PeerID) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PeerID.ProtoReflect.Descriptor instead. -func (*PeerID) Descriptor() ([]byte, []int) { - return file_reputation_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *PeerID) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -// Trust level to a NeoFS network peer. -type Trust struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the trusted peer - Peer *PeerID `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"` - // Trust level in [0:1] range - Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Trust) Reset() { - *x = Trust{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Trust) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Trust) ProtoMessage() {} - -func (x *Trust) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Trust.ProtoReflect.Descriptor instead. -func (*Trust) Descriptor() ([]byte, []int) { - return file_reputation_grpc_types_proto_rawDescGZIP(), []int{1} -} - -func (x *Trust) GetPeer() *PeerID { - if x != nil { - return x.Peer - } - return nil -} - -func (x *Trust) GetValue() float64 { - if x != nil { - return x.Value - } - return 0 -} - -// Trust level of a peer to a peer. -type PeerToPeerTrust struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the trusting peer - TrustingPeer *PeerID `protobuf:"bytes,1,opt,name=trusting_peer,json=trustingPeer,proto3" json:"trusting_peer,omitempty"` - // Trust level - Trust *Trust `protobuf:"bytes,2,opt,name=trust,proto3" json:"trust,omitempty"` -} - -func (x *PeerToPeerTrust) Reset() { - *x = PeerToPeerTrust{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PeerToPeerTrust) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PeerToPeerTrust) ProtoMessage() {} - -func (x *PeerToPeerTrust) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_types_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PeerToPeerTrust.ProtoReflect.Descriptor instead. -func (*PeerToPeerTrust) Descriptor() ([]byte, []int) { - return file_reputation_grpc_types_proto_rawDescGZIP(), []int{2} -} - -func (x *PeerToPeerTrust) GetTrustingPeer() *PeerID { - if x != nil { - return x.TrustingPeer - } - return nil -} - -func (x *PeerToPeerTrust) GetTrust() *Trust { - if x != nil { - return x.Trust - } - return nil -} - -// Global trust level to NeoFS node. -type GlobalTrust struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Message format version. Effectively, the version of API library used to create - // the message. - Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Message body - Body *GlobalTrust_Body `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` - // Signature of the binary `body` field by the manager. - Signature *grpc.Signature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *GlobalTrust) Reset() { - *x = GlobalTrust{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GlobalTrust) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GlobalTrust) ProtoMessage() {} - -func (x *GlobalTrust) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_types_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GlobalTrust.ProtoReflect.Descriptor instead. -func (*GlobalTrust) Descriptor() ([]byte, []int) { - return file_reputation_grpc_types_proto_rawDescGZIP(), []int{3} -} - -func (x *GlobalTrust) GetVersion() *grpc.Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *GlobalTrust) GetBody() *GlobalTrust_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GlobalTrust) GetSignature() *grpc.Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Message body structure. -type GlobalTrust_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Node manager ID - Manager *PeerID `protobuf:"bytes,1,opt,name=manager,proto3" json:"manager,omitempty"` - // Global trust level - Trust *Trust `protobuf:"bytes,2,opt,name=trust,proto3" json:"trust,omitempty"` -} - -func (x *GlobalTrust_Body) Reset() { - *x = GlobalTrust_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_reputation_grpc_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GlobalTrust_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GlobalTrust_Body) ProtoMessage() {} - -func (x *GlobalTrust_Body) ProtoReflect() protoreflect.Message { - mi := &file_reputation_grpc_types_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GlobalTrust_Body.ProtoReflect.Descriptor instead. -func (*GlobalTrust_Body) Descriptor() ([]byte, []int) { - return file_reputation_grpc_types_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *GlobalTrust_Body) GetManager() *PeerID { - if x != nil { - return x.Manager - } - return nil -} - -func (x *GlobalTrust_Body) GetTrust() *Trust { - if x != nil { - return x.Trust - } - return nil -} - -var File_reputation_grpc_types_proto protoreflect.FileDescriptor - -var file_reputation_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x27, 0x0a, 0x06, 0x50, 0x65, - 0x65, 0x72, 0x49, 0x44, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x22, 0x4f, 0x0a, 0x05, 0x54, 0x72, 0x75, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x04, - 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x87, 0x01, 0x0a, 0x0f, 0x50, 0x65, 0x65, 0x72, 0x54, 0x6f, 0x50, - 0x65, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x74, 0x72, 0x75, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0c, 0x74, - 0x72, 0x75, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x05, 0x74, - 0x72, 0x75, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x54, 0x72, 0x75, 0x73, 0x74, 0x52, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x22, 0xa8, - 0x02, 0x0a, 0x0b, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x54, 0x72, 0x75, 0x73, 0x74, 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, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x54, 0x72, 0x75, - 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, - 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x71, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x36, - 0x0a, 0x07, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x72, 0x65, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x75, - 0x73, 0x74, 0x52, 0x05, 0x74, 0x72, 0x75, 0x73, 0x74, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74, - 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, - 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x70, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, 0x70, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, - 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_reputation_grpc_types_proto_rawDescOnce sync.Once - file_reputation_grpc_types_proto_rawDescData = file_reputation_grpc_types_proto_rawDesc -) - -func file_reputation_grpc_types_proto_rawDescGZIP() []byte { - file_reputation_grpc_types_proto_rawDescOnce.Do(func() { - file_reputation_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_reputation_grpc_types_proto_rawDescData) - }) - return file_reputation_grpc_types_proto_rawDescData -} - -var file_reputation_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_reputation_grpc_types_proto_goTypes = []interface{}{ - (*PeerID)(nil), // 0: neo.fs.v2.reputation.PeerID - (*Trust)(nil), // 1: neo.fs.v2.reputation.Trust - (*PeerToPeerTrust)(nil), // 2: neo.fs.v2.reputation.PeerToPeerTrust - (*GlobalTrust)(nil), // 3: neo.fs.v2.reputation.GlobalTrust - (*GlobalTrust_Body)(nil), // 4: neo.fs.v2.reputation.GlobalTrust.Body - (*grpc.Version)(nil), // 5: neo.fs.v2.refs.Version - (*grpc.Signature)(nil), // 6: neo.fs.v2.refs.Signature -} -var file_reputation_grpc_types_proto_depIdxs = []int32{ - 0, // 0: neo.fs.v2.reputation.Trust.peer:type_name -> neo.fs.v2.reputation.PeerID - 0, // 1: neo.fs.v2.reputation.PeerToPeerTrust.trusting_peer:type_name -> neo.fs.v2.reputation.PeerID - 1, // 2: neo.fs.v2.reputation.PeerToPeerTrust.trust:type_name -> neo.fs.v2.reputation.Trust - 5, // 3: neo.fs.v2.reputation.GlobalTrust.version:type_name -> neo.fs.v2.refs.Version - 4, // 4: neo.fs.v2.reputation.GlobalTrust.body:type_name -> neo.fs.v2.reputation.GlobalTrust.Body - 6, // 5: neo.fs.v2.reputation.GlobalTrust.signature:type_name -> neo.fs.v2.refs.Signature - 0, // 6: neo.fs.v2.reputation.GlobalTrust.Body.manager:type_name -> neo.fs.v2.reputation.PeerID - 1, // 7: neo.fs.v2.reputation.GlobalTrust.Body.trust:type_name -> neo.fs.v2.reputation.Trust - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] 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_reputation_grpc_types_proto_init() } -func file_reputation_grpc_types_proto_init() { - if File_reputation_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_reputation_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerID); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Trust); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerToPeerTrust); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GlobalTrust); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_reputation_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GlobalTrust_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_reputation_grpc_types_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_reputation_grpc_types_proto_goTypes, - DependencyIndexes: file_reputation_grpc_types_proto_depIdxs, - MessageInfos: file_reputation_grpc_types_proto_msgTypes, - }.Build() - File_reputation_grpc_types_proto = out.File - file_reputation_grpc_types_proto_rawDesc = nil - file_reputation_grpc_types_proto_goTypes = nil - file_reputation_grpc_types_proto_depIdxs = nil -} diff --git a/reputation/json.go b/reputation/json.go deleted file mode 100644 index 3976462..0000000 --- a/reputation/json.go +++ /dev/null @@ -1,38 +0,0 @@ -package reputation - -import ( - reputation "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" -) - -func (x *PeerID) MarshalJSON() ([]byte, error) { - return message.MarshalJSON(x) -} - -func (x *PeerID) UnmarshalJSON(data []byte) error { - return message.UnmarshalJSON(x, data, new(reputation.PeerID)) -} - -func (x *Trust) MarshalJSON() ([]byte, error) { - return message.MarshalJSON(x) -} - -func (x *Trust) UnmarshalJSON(data []byte) error { - return message.UnmarshalJSON(x, data, new(reputation.Trust)) -} - -func (x *PeerToPeerTrust) MarshalJSON() ([]byte, error) { - return message.MarshalJSON(x) -} - -func (x *PeerToPeerTrust) UnmarshalJSON(data []byte) error { - return message.UnmarshalJSON(x, data, new(reputation.PeerToPeerTrust)) -} - -func (x *GlobalTrust) MarshalJSON() ([]byte, error) { - return message.MarshalJSON(x) -} - -func (x *GlobalTrust) UnmarshalJSON(data []byte) error { - return message.UnmarshalJSON(x, data, new(reputation.GlobalTrust)) -} diff --git a/reputation/marshal.go b/reputation/marshal.go deleted file mode 100644 index a64e822..0000000 --- a/reputation/marshal.go +++ /dev/null @@ -1,276 +0,0 @@ -package reputation - -import ( - reputation "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" - protoutil "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" -) - -const ( - _ = iota - peerIDPubKeyFNum -) - -func (x *PeerID) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, x.StableSize()) - } - - protoutil.BytesMarshal(peerIDPubKeyFNum, buf, x.publicKey) - - return buf -} - -func (x *PeerID) StableSize() (size int) { - size += protoutil.BytesSize(peerIDPubKeyFNum, x.publicKey) - - return -} - -func (x *PeerID) Unmarshal(data []byte) error { - return message.Unmarshal(x, data, new(reputation.PeerID)) -} - -const ( - _ = iota - trustPeerFNum - trustValueFNum -) - -func (x *Trust) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, x.StableSize()) - } - - var offset int - - offset += protoutil.NestedStructureMarshal(trustPeerFNum, buf[offset:], x.peer) - protoutil.Float64Marshal(trustValueFNum, buf[offset:], x.val) - - return buf -} - -func (x *Trust) StableSize() (size int) { - size += protoutil.NestedStructureSize(trustPeerFNum, x.peer) - size += protoutil.Float64Size(trustValueFNum, x.val) - - return -} - -func (x *Trust) Unmarshal(data []byte) error { - return message.Unmarshal(x, data, new(reputation.Trust)) -} - -const ( - _ = iota - p2pTrustTrustingFNum - p2pTrustValueFNum -) - -func (x *PeerToPeerTrust) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, x.StableSize()) - } - - var offset int - - offset += protoutil.NestedStructureMarshal(p2pTrustTrustingFNum, buf, x.trusting) - protoutil.NestedStructureMarshal(p2pTrustValueFNum, buf[offset:], x.trust) - - return buf -} - -func (x *PeerToPeerTrust) StableSize() (size int) { - size += protoutil.NestedStructureSize(p2pTrustTrustingFNum, x.trusting) - size += protoutil.NestedStructureSize(p2pTrustValueFNum, x.trust) - - return -} - -func (x *PeerToPeerTrust) Unmarshal(data []byte) error { - return message.Unmarshal(x, data, new(reputation.PeerToPeerTrust)) -} - -const ( - _ = iota - globalTrustBodyManagerFNum - globalTrustBodyValueFNum -) - -func (x *GlobalTrustBody) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, x.StableSize()) - } - - var offset int - - offset += protoutil.NestedStructureMarshal(globalTrustBodyManagerFNum, buf, x.manager) - protoutil.NestedStructureMarshal(globalTrustBodyValueFNum, buf[offset:], x.trust) - - return buf -} - -func (x *GlobalTrustBody) StableSize() (size int) { - size += protoutil.NestedStructureSize(globalTrustBodyManagerFNum, x.manager) - size += protoutil.NestedStructureSize(globalTrustBodyValueFNum, x.trust) - - return -} - -func (x *GlobalTrustBody) Unmarshal(data []byte) error { - return message.Unmarshal(x, data, new(reputation.GlobalTrust_Body)) -} - -const ( - _ = iota - globalTrustVersionFNum - globalTrustBodyFNum - globalTrustSigFNum -) - -func (x *GlobalTrust) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, x.StableSize()) - } - - var offset int - - offset += protoutil.NestedStructureMarshal(globalTrustVersionFNum, buf, x.version) - offset += protoutil.NestedStructureMarshal(globalTrustBodyFNum, buf[offset:], x.body) - protoutil.NestedStructureMarshal(globalTrustSigFNum, buf[offset:], x.sig) - - return buf -} - -func (x *GlobalTrust) StableSize() (size int) { - size += protoutil.NestedStructureSize(globalTrustVersionFNum, x.version) - size += protoutil.NestedStructureSize(globalTrustBodyFNum, x.body) - size += protoutil.NestedStructureSize(globalTrustSigFNum, x.sig) - - return -} - -func (x *GlobalTrust) Unmarshal(data []byte) error { - return message.Unmarshal(x, data, new(reputation.GlobalTrust)) -} - -const ( - _ = iota - announceLocalTrustBodyEpochFNum - announceLocalTrustBodyTrustsFNum -) - -func (x *AnnounceLocalTrustRequestBody) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, x.StableSize()) - } - - var offset int - - offset += protoutil.UInt64Marshal(announceLocalTrustBodyEpochFNum, buf[offset:], x.epoch) - - for i := range x.trusts { - offset += protoutil.NestedStructureMarshal(announceLocalTrustBodyTrustsFNum, buf[offset:], &x.trusts[i]) - } - - return buf -} - -func (x *AnnounceLocalTrustRequestBody) StableSize() (size int) { - size += protoutil.UInt64Size(announceLocalTrustBodyEpochFNum, x.epoch) - - for i := range x.trusts { - size += protoutil.NestedStructureSize(announceLocalTrustBodyTrustsFNum, &x.trusts[i]) - } - - return -} - -func (x *AnnounceLocalTrustRequestBody) Unmarshal(data []byte) error { - return message.Unmarshal(x, data, new(reputation.AnnounceLocalTrustRequest_Body)) -} - -func (x *AnnounceLocalTrustResponseBody) StableMarshal(buf []byte) []byte { - return buf -} - -func (x *AnnounceLocalTrustResponseBody) StableSize() int { - return 0 -} - -func (x *AnnounceLocalTrustResponseBody) Unmarshal(data []byte) error { - return message.Unmarshal(x, data, new(reputation.AnnounceLocalTrustResponse_Body)) -} - -const ( - _ = iota - announceInterResBodyEpochFNum - announceInterResBodyIterFNum - announceInterResBodyTrustFNum -) - -func (x *AnnounceIntermediateResultRequestBody) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, x.StableSize()) - } - - var offset int - - offset += protoutil.UInt64Marshal(announceInterResBodyEpochFNum, buf, x.epoch) - offset += protoutil.UInt32Marshal(announceInterResBodyIterFNum, buf[offset:], x.iter) - protoutil.NestedStructureMarshal(announceInterResBodyTrustFNum, buf[offset:], x.trust) - - return buf -} - -func (x *AnnounceIntermediateResultRequestBody) StableSize() (size int) { - size += protoutil.UInt64Size(announceInterResBodyEpochFNum, x.epoch) - size += protoutil.UInt32Size(announceInterResBodyIterFNum, x.iter) - size += protoutil.NestedStructureSize(announceInterResBodyTrustFNum, x.trust) - - return -} - -func (x *AnnounceIntermediateResultRequestBody) Unmarshal(data []byte) error { - return message.Unmarshal(x, data, new(reputation.AnnounceIntermediateResultRequest_Body)) -} - -func (x *AnnounceIntermediateResultResponseBody) StableMarshal(buf []byte) []byte { - return buf -} - -func (x *AnnounceIntermediateResultResponseBody) StableSize() int { - return 0 -} - -func (x *AnnounceIntermediateResultResponseBody) Unmarshal(data []byte) error { - return message.Unmarshal(x, data, new(reputation.AnnounceIntermediateResultResponse_Body)) -} diff --git a/reputation/message_test.go b/reputation/message_test.go deleted file mode 100644 index 891c2e4..0000000 --- a/reputation/message_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package reputation_test - -import ( - "testing" - - reputationtest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/test" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" -) - -func TestMessageConvert(t *testing.T) { - messagetest.TestRPCMessage(t, - func(empty bool) message.Message { return reputationtest.GenerateTrust(empty) }, - func(empty bool) message.Message { return reputationtest.GenerateAnnounceLocalTrustRequestBody(empty) }, - func(empty bool) message.Message { return reputationtest.GenerateAnnounceLocalTrustRequest(empty) }, - func(empty bool) message.Message { return reputationtest.GenerateAnnounceLocalTrustResponseBody(empty) }, - func(empty bool) message.Message { return reputationtest.GenerateAnnounceLocalTrustResponse(empty) }, - func(empty bool) message.Message { - return reputationtest.GenerateAnnounceIntermediateResultRequestBody(empty) - }, - func(empty bool) message.Message { - return reputationtest.GenerateAnnounceIntermediateResultRequest(empty) - }, - func(empty bool) message.Message { - return reputationtest.GenerateAnnounceIntermediateResultResponseBody(empty) - }, - func(empty bool) message.Message { - return reputationtest.GenerateAnnounceIntermediateResultResponse(empty) - }, - func(empty bool) message.Message { return reputationtest.GenerateGlobalTrustBody(empty) }, - func(empty bool) message.Message { return reputationtest.GenerateGlobalTrust(empty) }, - func(empty bool) message.Message { return reputationtest.GeneratePeerToPeerTrust(empty) }, - ) -} diff --git a/reputation/test/generate.go b/reputation/test/generate.go deleted file mode 100644 index 7731ad9..0000000 --- a/reputation/test/generate.go +++ /dev/null @@ -1,160 +0,0 @@ -package reputationtest - -import ( - refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation" - sessiontest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/test" -) - -func GeneratePeerID(empty bool) *reputation.PeerID { - m := new(reputation.PeerID) - - if !empty { - m.SetPublicKey([]byte{1, 2, 3}) - } - - return m -} - -func GenerateTrust(empty bool) *reputation.Trust { - m := new(reputation.Trust) - - if !empty { - m.SetValue(1) - m.SetPeer(GeneratePeerID(false)) - } - - return m -} - -func GeneratePeerToPeerTrust(empty bool) *reputation.PeerToPeerTrust { - m := new(reputation.PeerToPeerTrust) - - if !empty { - m.SetTrustingPeer(GeneratePeerID(false)) - m.SetTrust(GenerateTrust(false)) - } - - return m -} - -func GenerateGlobalTrustBody(empty bool) *reputation.GlobalTrustBody { - m := new(reputation.GlobalTrustBody) - - if !empty { - m.SetManager(GeneratePeerID(false)) - m.SetTrust(GenerateTrust(false)) - } - - return m -} - -func GenerateGlobalTrust(empty bool) *reputation.GlobalTrust { - m := new(reputation.GlobalTrust) - - if !empty { - m.SetVersion(refstest.GenerateVersion(false)) - m.SetBody(GenerateGlobalTrustBody(false)) - m.SetSignature(refstest.GenerateSignature(empty)) - } - - return m -} - -func GenerateTrusts(empty bool) []reputation.Trust { - var res []reputation.Trust - - if !empty { - res = append(res, - *GenerateTrust(false), - *GenerateTrust(false), - ) - } - - return res -} - -func GenerateAnnounceLocalTrustRequestBody(empty bool) *reputation.AnnounceLocalTrustRequestBody { - m := new(reputation.AnnounceLocalTrustRequestBody) - - if !empty { - m.SetEpoch(13) - m.SetTrusts(GenerateTrusts(false)) - } - - return m -} - -func GenerateAnnounceLocalTrustRequest(empty bool) *reputation.AnnounceLocalTrustRequest { - m := new(reputation.AnnounceLocalTrustRequest) - - if !empty { - m.SetBody(GenerateAnnounceLocalTrustRequestBody(false)) - m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) - m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) - } - - return m -} - -func GenerateAnnounceLocalTrustResponseBody(empty bool) *reputation.AnnounceLocalTrustResponseBody { - m := new(reputation.AnnounceLocalTrustResponseBody) - - return m -} - -func GenerateAnnounceLocalTrustResponse(empty bool) *reputation.AnnounceLocalTrustResponse { - m := new(reputation.AnnounceLocalTrustResponse) - - if !empty { - m.SetBody(GenerateAnnounceLocalTrustResponseBody(false)) - m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) - m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) - } - - return m -} - -func GenerateAnnounceIntermediateResultRequestBody(empty bool) *reputation.AnnounceIntermediateResultRequestBody { - m := new(reputation.AnnounceIntermediateResultRequestBody) - - if !empty { - m.SetEpoch(123) - m.SetIteration(564) - m.SetTrust(GeneratePeerToPeerTrust(false)) - } - - return m -} - -func GenerateAnnounceIntermediateResultRequest(empty bool) *reputation.AnnounceIntermediateResultRequest { - m := new(reputation.AnnounceIntermediateResultRequest) - - if !empty { - m.SetBody(GenerateAnnounceIntermediateResultRequestBody(false)) - } - - m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) - m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) - - return m -} - -func GenerateAnnounceIntermediateResultResponseBody(empty bool) *reputation.AnnounceIntermediateResultResponseBody { - m := new(reputation.AnnounceIntermediateResultResponseBody) - - return m -} - -func GenerateAnnounceIntermediateResultResponse(empty bool) *reputation.AnnounceIntermediateResultResponse { - m := new(reputation.AnnounceIntermediateResultResponse) - - if !empty { - m.SetBody(GenerateAnnounceIntermediateResultResponseBody(false)) - } - - m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) - m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) - - return m -} diff --git a/reputation/types.go b/reputation/types.go deleted file mode 100644 index a339183..0000000 --- a/reputation/types.go +++ /dev/null @@ -1,366 +0,0 @@ -package reputation - -import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" -) - -// PeerID represents reputation.PeerID message -// from NeoFS API v2. -type PeerID struct { - publicKey []byte -} - -// GetPublicKey returns peer's binary public key of ID. -func (x *PeerID) GetPublicKey() []byte { - if x != nil { - return x.publicKey - } - - return nil -} - -// SetPublicKey sets peer's binary public key of ID. -func (x *PeerID) SetPublicKey(v []byte) { - x.publicKey = v -} - -// Trust represents reputation.Trust message -// from NeoFS API v2. -type Trust struct { - val float64 - - peer *PeerID -} - -// GetPeer returns trusted peer's ID. -func (x *Trust) GetPeer() *PeerID { - if x != nil { - return x.peer - } - - return nil -} - -// SetPeer sets trusted peer's ID. -func (x *Trust) SetPeer(v *PeerID) { - x.peer = v -} - -// GetValue returns trust value. -func (x *Trust) GetValue() float64 { - if x != nil { - return x.val - } - - return 0 -} - -// SetValue sets trust value. -func (x *Trust) SetValue(v float64) { - x.val = v -} - -// PeerToPeerTrust represents reputation.PeerToPeerTrust message -// from NeoFS API v2. -type PeerToPeerTrust struct { - trusting *PeerID - - trust *Trust -} - -// GetTrustingPeer returns trusting peer ID. -func (x *PeerToPeerTrust) GetTrustingPeer() *PeerID { - if x != nil { - return x.trusting - } - - return nil -} - -// SetTrustingPeer sets trusting peer ID. -func (x *PeerToPeerTrust) SetTrustingPeer(v *PeerID) { - x.trusting = v -} - -// GetTrust returns trust value of trusting peer to the trusted one. -func (x *PeerToPeerTrust) GetTrust() *Trust { - if x != nil { - return x.trust - } - - return nil -} - -// SetTrust sets trust value of trusting peer to the trusted one. -func (x *PeerToPeerTrust) SetTrust(v *Trust) { - x.trust = v -} - -// GlobalTrustBody represents reputation.GlobalTrust.Body message -// from NeoFS API v2. -type GlobalTrustBody struct { - manager *PeerID - - trust *Trust -} - -// GetManager returns node manager ID. -func (x *GlobalTrustBody) GetManager() *PeerID { - if x != nil { - return x.manager - } - - return nil -} - -// SetManager sets node manager ID. -func (x *GlobalTrustBody) SetManager(v *PeerID) { - x.manager = v -} - -// GetTrust returns global trust value. -func (x *GlobalTrustBody) GetTrust() *Trust { - if x != nil { - return x.trust - } - - return nil -} - -// SetTrust sets global trust value. -func (x *GlobalTrustBody) SetTrust(v *Trust) { - x.trust = v -} - -// GlobalTrust represents reputation.GlobalTrust message -// from NeoFS API v2. -type GlobalTrust struct { - version *refs.Version - - body *GlobalTrustBody - - sig *refs.Signature -} - -// GetVersion returns message format version. -func (x *GlobalTrust) GetVersion() *refs.Version { - if x != nil { - return x.version - } - - return nil -} - -// SetVersion sets message format version. -func (x *GlobalTrust) SetVersion(v *refs.Version) { - x.version = v -} - -// GetBody returns message body. -func (x *GlobalTrust) GetBody() *GlobalTrustBody { - if x != nil { - return x.body - } - - return nil -} - -// SetBody sets message body. -func (x *GlobalTrust) SetBody(v *GlobalTrustBody) { - x.body = v -} - -// GetSignature returns body signature. -func (x *GlobalTrust) GetSignature() *refs.Signature { - if x != nil { - return x.sig - } - - return nil -} - -// SetSignature sets body signature. -func (x *GlobalTrust) SetSignature(v *refs.Signature) { - x.sig = v -} - -// AnnounceLocalTrustRequestBody is a structure of AnnounceLocalTrust request body. -type AnnounceLocalTrustRequestBody struct { - epoch uint64 - - trusts []Trust -} - -// GetEpoch returns epoch in which the trust was assessed. -func (x *AnnounceLocalTrustRequestBody) GetEpoch() uint64 { - if x != nil { - return x.epoch - } - - return 0 -} - -// SetEpoch sets epoch in which the trust was assessed. -func (x *AnnounceLocalTrustRequestBody) SetEpoch(v uint64) { - x.epoch = v -} - -// GetTrusts returns list of normalized trust values. -func (x *AnnounceLocalTrustRequestBody) GetTrusts() []Trust { - if x != nil { - return x.trusts - } - - return nil -} - -// SetTrusts sets list of normalized trust values. -func (x *AnnounceLocalTrustRequestBody) SetTrusts(v []Trust) { - x.trusts = v -} - -// AnnounceLocalTrustResponseBody is a structure of AnnounceLocalTrust response body. -type AnnounceLocalTrustResponseBody struct{} - -// AnnounceLocalTrustRequest represents reputation.AnnounceLocalTrustRequest -// message from NeoFS API v2. -type AnnounceLocalTrustRequest struct { - body *AnnounceLocalTrustRequestBody - - session.RequestHeaders -} - -// GetBody returns request body. -func (x *AnnounceLocalTrustRequest) GetBody() *AnnounceLocalTrustRequestBody { - if x != nil { - return x.body - } - - return nil -} - -// SetBody sets request body. -func (x *AnnounceLocalTrustRequest) SetBody(v *AnnounceLocalTrustRequestBody) { - x.body = v -} - -// AnnounceLocalTrustResponse represents reputation.AnnounceLocalTrustResponse -// message from NeoFS API v2. -type AnnounceLocalTrustResponse struct { - body *AnnounceLocalTrustResponseBody - - session.ResponseHeaders -} - -// GetBody returns response body. -func (x *AnnounceLocalTrustResponse) GetBody() *AnnounceLocalTrustResponseBody { - if x != nil { - return x.body - } - - return nil -} - -// SetBody sets response body. -func (x *AnnounceLocalTrustResponse) SetBody(v *AnnounceLocalTrustResponseBody) { - x.body = v -} - -// AnnounceIntermediateResultRequestBody is a structure of AnnounceIntermediateResult request body. -type AnnounceIntermediateResultRequestBody struct { - epoch uint64 - - iter uint32 - - trust *PeerToPeerTrust -} - -// GetEpoch returns epoch number in which the intermediate trust was assessed. -func (x *AnnounceIntermediateResultRequestBody) GetEpoch() uint64 { - if x != nil { - return x.epoch - } - - return 0 -} - -// SetEpoch sets epoch number in which the intermediate trust was assessed. -func (x *AnnounceIntermediateResultRequestBody) SetEpoch(v uint64) { - x.epoch = v -} - -// GetIteration returns sequence number of the iteration. -func (x *AnnounceIntermediateResultRequestBody) GetIteration() uint32 { - if x != nil { - return x.iter - } - - return 0 -} - -// SetIteration sets sequence number of the iteration. -func (x *AnnounceIntermediateResultRequestBody) SetIteration(v uint32) { - x.iter = v -} - -// GetTrust returns current global trust value. -func (x *AnnounceIntermediateResultRequestBody) GetTrust() *PeerToPeerTrust { - if x != nil { - return x.trust - } - - return nil -} - -// SetTrust sets current global trust value. -func (x *AnnounceIntermediateResultRequestBody) SetTrust(v *PeerToPeerTrust) { - x.trust = v -} - -// AnnounceIntermediateResultResponseBody is a structure of AnnounceIntermediateResult response body. -type AnnounceIntermediateResultResponseBody struct{} - -// AnnounceIntermediateResultRequest represents reputation.AnnounceIntermediateResult -// message from NeoFS API v2. -type AnnounceIntermediateResultRequest struct { - body *AnnounceIntermediateResultRequestBody - - session.RequestHeaders -} - -// GetBody returns request body. -func (x *AnnounceIntermediateResultRequest) GetBody() *AnnounceIntermediateResultRequestBody { - if x != nil { - return x.body - } - - return nil -} - -// SetBody sets request body. -func (x *AnnounceIntermediateResultRequest) SetBody(v *AnnounceIntermediateResultRequestBody) { - x.body = v -} - -// AnnounceIntermediateResultResponse represents reputation.AnnounceIntermediateResultResponse -// message from NeoFS API v2. -type AnnounceIntermediateResultResponse struct { - body *AnnounceIntermediateResultResponseBody - - session.ResponseHeaders -} - -// GetBody returns response body. -func (x *AnnounceIntermediateResultResponse) GetBody() *AnnounceIntermediateResultResponseBody { - if x != nil { - return x.body - } - - return nil -} - -// SetBody sets response body. -func (x *AnnounceIntermediateResultResponse) SetBody(v *AnnounceIntermediateResultResponseBody) { - x.body = v -} diff --git a/rpc/reputation.go b/rpc/reputation.go deleted file mode 100644 index 3d036b2..0000000 --- a/rpc/reputation.go +++ /dev/null @@ -1,46 +0,0 @@ -package rpc - -import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" -) - -const serviceReputation = serviceNamePrefix + "reputation.ReputationService" - -const ( - rpcReputationAnnounceLocalTrust = "AnnounceLocalTrust" - rpcReputationAnnounceIntermediateResult = "AnnounceIntermediateResult" -) - -// AnnounceLocalTrust executes ReputationService.AnnounceLocalTrust RPC. -func AnnounceLocalTrust( - cli *client.Client, - req *reputation.AnnounceLocalTrustRequest, - opts ...client.CallOption, -) (*reputation.AnnounceLocalTrustResponse, error) { - resp := new(reputation.AnnounceLocalTrustResponse) - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceReputation, rpcReputationAnnounceLocalTrust), req, resp, opts...) - if err != nil { - return nil, err - } - - return resp, nil -} - -// AnnounceIntermediateResult executes ReputationService.AnnounceIntermediateResult RPC. -func AnnounceIntermediateResult( - cli *client.Client, - req *reputation.AnnounceIntermediateResultRequest, - opts ...client.CallOption, -) (*reputation.AnnounceIntermediateResultResponse, error) { - resp := new(reputation.AnnounceIntermediateResultResponse) - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceReputation, rpcReputationAnnounceIntermediateResult), req, resp, opts...) - if err != nil { - return nil, err - } - - return resp, nil -} diff --git a/session/grpc/service.pb.go b/session/grpc/service.pb.go index 23d6913..5ba114d 100644 --- a/session/grpc/service.pb.go +++ b/session/grpc/service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: session/grpc/service.proto diff --git a/session/grpc/service_grpc.pb.go b/session/grpc/service_grpc.pb.go index a056280..32793fe 100644 --- a/session/grpc/service_grpc.pb.go +++ b/session/grpc/service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.9 // source: session/grpc/service.proto @@ -18,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + SessionService_Create_FullMethodName = "/neo.fs.v2.session.SessionService/Create" +) + // 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. @@ -41,7 +45,7 @@ func NewSessionServiceClient(cc grpc.ClientConnInterface) SessionServiceClient { func (c *sessionServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { out := new(CreateResponse) - err := c.cc.Invoke(ctx, "/neo.fs.v2.session.SessionService/Create", in, out, opts...) + err := c.cc.Invoke(ctx, SessionService_Create_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -90,7 +94,7 @@ func _SessionService_Create_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/neo.fs.v2.session.SessionService/Create", + FullMethod: SessionService_Create_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SessionServiceServer).Create(ctx, req.(*CreateRequest)) diff --git a/session/grpc/types.pb.go b/session/grpc/types.pb.go index ed76725..25e0715 100644 --- a/session/grpc/types.pb.go +++ b/session/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: session/grpc/types.proto diff --git a/signature/body.go b/signature/body.go index bf3ab6c..a160ed3 100644 --- a/signature/body.go +++ b/signature/body.go @@ -7,7 +7,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" ) @@ -101,15 +100,5 @@ func serviceMessageBody(req interface{}) stableMarshaler { return v.GetBody() case *netmap.SnapshotResponse: return v.GetBody() - - /* Reputation */ - case *reputation.AnnounceLocalTrustRequest: - return v.GetBody() - case *reputation.AnnounceLocalTrustResponse: - return v.GetBody() - case *reputation.AnnounceIntermediateResultRequest: - return v.GetBody() - case *reputation.AnnounceIntermediateResultResponse: - return v.GetBody() } } diff --git a/status/grpc/types.pb.go b/status/grpc/types.pb.go index f6fd81c..a30533f 100644 --- a/status/grpc/types.pb.go +++ b/status/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: status/grpc/types.proto diff --git a/storagegroup/grpc/types.pb.go b/storagegroup/grpc/types.pb.go index 6629364..75f5b46 100644 --- a/storagegroup/grpc/types.pb.go +++ b/storagegroup/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: storagegroup/grpc/types.proto diff --git a/subnet/grpc/types.pb.go b/subnet/grpc/types.pb.go index c2d7529..032ba6c 100644 --- a/subnet/grpc/types.pb.go +++ b/subnet/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: subnet/grpc/types.proto diff --git a/tombstone/grpc/types.pb.go b/tombstone/grpc/types.pb.go index 3365912..d1065ba 100644 --- a/tombstone/grpc/types.pb.go +++ b/tombstone/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: tombstone/grpc/types.proto diff --git a/util/proto/test/test.pb.go b/util/proto/test/test.pb.go index de6f380..0dfa4dc 100644 --- a/util/proto/test/test.pb.go +++ b/util/proto/test/test.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.21.9 // source: util/proto/test/test.proto From bd44a3f47b85117d73ae283ace45e71ec3ddafaa Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 18 Apr 2023 10:43:11 +0300 Subject: [PATCH 032/169] [#24] tracing: Fix panic on closed channel Closed channel is also ready for communication, so select statement can write to it. Signed-off-by: Dmitrii Stepanov --- pkg/tracing/grpc.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/tracing/grpc.go b/pkg/tracing/grpc.go index cea59b0..884ecb2 100644 --- a/pkg/tracing/grpc.go +++ b/pkg/tracing/grpc.go @@ -51,7 +51,6 @@ func NewGRPCStreamClientInterceptor() grpc.StreamClientInterceptor { strWrp := newgRPCClientStream(str, desc, finished, done) go func() { - defer close(finished) defer close(done) defer span.End() From ff6d8db7410b4d69cc8bacc7d5ad97681717c91e Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 18 Apr 2023 08:40:42 +0300 Subject: [PATCH 033/169] [#19] subnet: Drop related types and fields Signed-off-by: Dmitrii Stepanov --- container/attributes.go | 7 - container/grpc/types.pb.go | 4 - netmap/attributes.go | 232 ------------------------ netmap/attributes_test.go | 361 ------------------------------------- netmap/convert.go | 15 -- netmap/grpc/types.go | 7 - netmap/grpc/types.pb.go | 259 ++++++++++++-------------- netmap/marshal.go | 5 - netmap/test/generate.go | 1 - netmap/types.go | 9 - refs/convert.go | 28 --- refs/grpc/types.go | 5 - refs/grpc/types.pb.go | 184 ++++++------------- refs/marshal.go | 40 ---- refs/message_test.go | 1 - refs/test/generate.go | 10 - refs/types.go | 59 ------ refs/types_test.go | 72 -------- subnet/encoding_test.go | 15 -- subnet/grpc/types.go | 15 -- subnet/grpc/types.pb.go | 171 ------------------ subnet/info.go | 138 -------------- subnet/test/generate.go | 17 -- 23 files changed, 171 insertions(+), 1484 deletions(-) delete mode 100644 netmap/attributes.go delete mode 100644 netmap/attributes_test.go delete mode 100644 refs/types_test.go delete mode 100644 subnet/encoding_test.go delete mode 100644 subnet/grpc/types.go delete mode 100644 subnet/grpc/types.pb.go delete mode 100644 subnet/info.go delete mode 100644 subnet/test/generate.go diff --git a/container/attributes.go b/container/attributes.go index 1d7c94a..12277ed 100644 --- a/container/attributes.go +++ b/container/attributes.go @@ -4,9 +4,6 @@ package container const SysAttributePrefix = "__SYSTEM__" const ( - // SysAttributeSubnet is a string ID of container's storage subnet. - SysAttributeSubnet = SysAttributePrefix + "SUBNET" - // SysAttributeName is a string of human-friendly container name registered as the domain in NNS contract. SysAttributeName = SysAttributePrefix + "NAME" @@ -22,10 +19,6 @@ const ( const SysAttributePrefixNeoFS = "__NEOFS__" const ( - // SysAttributeSubnetNeoFS is a string ID of container's storage subnet. - // Deprecated: use SysAttributeSubnet - SysAttributeSubnetNeoFS = SysAttributePrefixNeoFS + "SUBNET" - // SysAttributeNameNeoFS is a string of human-friendly container name registered as the domain in NNS contract. // Deprecated: use SysAttributeName SysAttributeNameNeoFS = SysAttributePrefixNeoFS + "NAME" diff --git a/container/grpc/types.pb.go b/container/grpc/types.pb.go index 7f0cc1b..0cd53eb 100644 --- a/container/grpc/types.pb.go +++ b/container/grpc/types.pb.go @@ -131,10 +131,6 @@ func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { // // There are some "well-known" attributes affecting system behaviour: // -// - [ __SYSTEM__SUBNET ] \ -// (`__NEOFS__SUBNET` is deprecated) \ -// String ID of a container's storage subnet. Any container can be attached to -// one subnet only. // - [ __SYSTEM__NAME ] \ // (`__NEOFS__NAME` is deprecated) \ // String of a human-friendly container name registered as a domain in diff --git a/netmap/attributes.go b/netmap/attributes.go deleted file mode 100644 index 205376b..0000000 --- a/netmap/attributes.go +++ /dev/null @@ -1,232 +0,0 @@ -package netmap - -import ( - "errors" - "fmt" - "strings" - - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" -) - -// prefix of keys to subnet attributes. -const attrSubnetPrefix = "__SYSTEM__SUBNET_" - -// prefix of keys to subnet attributes. -// Deprecated: use attrSubnetPrefix -const attrSubnetPrefixNeoFS = "__NEOFS__SUBNET_" - -const ( - // subnet attribute's value denoting subnet entry - attrSubnetValEntry = "True" - - // subnet attribute's value denoting subnet exit - attrSubnetValExit = "False" -) - -// NodeSubnetInfo groups information about subnet which can be written to NodeInfo. -// -// Zero value represents entry to zero subnet. -type NodeSubnetInfo struct { - exit bool - - id *refs.SubnetID -} - -// Enabled returns true iff subnet membership is enabled for the node. -func (x NodeSubnetInfo) Enabled() bool { - return !x.exit -} - -// SetEntryFlag sets the subnet entry flag. -func (x *NodeSubnetInfo) SetEntryFlag(enters bool) { - x.exit = !enters -} - -// ID returns identifier of the subnet. -func (x NodeSubnetInfo) ID() *refs.SubnetID { - return x.id -} - -// SetID sets identifier of the subnet. -func (x *NodeSubnetInfo) SetID(id *refs.SubnetID) { - x.id = id -} - -func subnetAttributeKey(id *refs.SubnetID) string { - txt, _ := id.MarshalText() // never returns an error - - return attrSubnetPrefix + string(txt) -} - -// WriteSubnetInfo writes NodeSubnetInfo to NodeInfo via attributes. NodeInfo must not be nil. -// -// Existing subnet attributes are expected to be key-unique, otherwise undefined behavior. -// -// Does not add (removes existing) attribute if node: -// - disables non-zero subnet; -// - enables zero subnet. -// -// Attribute key is calculated from ID using format `__SYSTEM__SUBNET_%s`. -// Attribute Value is: -// - `True` if node enters the subnet; -// - `False`, otherwise. -func WriteSubnetInfo(node *NodeInfo, info NodeSubnetInfo) { - attrs := node.GetAttributes() - - id := info.ID() - enters := info.Enabled() - - // calculate attribute key - key := subnetAttributeKey(id) - - if refs.IsZeroSubnet(id) == enters { - for i := range attrs { - if attrs[i].GetKey() == key { - attrs = append(attrs[:i], attrs[i+1:]...) - break // attributes are expected to be key-unique - } - } - } else { - var val string - - if enters { - val = attrSubnetValEntry - } else { - val = attrSubnetValExit - } - - presented := false - - for i := range attrs { - if attrs[i].GetKey() == key { - attrs[i].SetValue(val) - presented = true - } - } - - if !presented { - index := len(attrs) - attrs = append(attrs, Attribute{}) - attrs[index].SetKey(key) - attrs[index].SetValue(val) - } - } - - node.SetAttributes(attrs) -} - -// ErrRemoveSubnet is returned when a node needs to leave the subnet. -var ErrRemoveSubnet = errors.New("remove subnet") - -var errNoSubnets = errors.New("no subnets") - -// IterateSubnets iterates over all subnets the node belongs to and passes the IDs to f. -// Handler must not be nil. -// -// Subnet attributes are expected to be key-unique, otherwise undefined behavior. -// -// If f returns ErrRemoveSubnet, then removes subnet entry. Note that this leads to an instant mutation of NodeInfo. -// Breaks on any other non-nil error and returns it. -// -// Returns an error if any subnet attribute has wrong format. -// Returns an error if the node is not included in any subnet by the end of the loop. -func IterateSubnets(node *NodeInfo, f func(refs.SubnetID) error) error { - attrs := node.GetAttributes() - - var ( - err error - id refs.SubnetID - entries uint - - zeroEntry = true - ) - - for i := 0; i < len(attrs); i++ { // range must not be used because of attrs mutation in body - key := attrs[i].GetKey() - - // cut subnet ID string - idTxt := strings.TrimPrefix(key, attrSubnetPrefix) - if len(idTxt) == len(key) { - idTxt = strings.TrimPrefix(key, attrSubnetPrefixNeoFS) - if len(idTxt) == len(key) { - // not a subnet attribute - continue - } - } - - // check value - val := attrs[i].GetValue() - if val != attrSubnetValExit && val != attrSubnetValEntry { - return fmt.Errorf("invalid attribute value: %s", val) - } - - // decode subnet ID - if err = id.UnmarshalText([]byte(idTxt)); err != nil { - return fmt.Errorf("invalid ID text: %w", err) - } - - // update status of zero subnet - isZero := refs.IsZeroSubnet(&id) - - if isZero { - zeroEntry = val == attrSubnetValEntry - } - - // continue to process only the subnets to which the node belongs - if val == attrSubnetValExit { - continue - } - - // pass ID to the handler - err = f(id) - - isRemoveErr := errors.Is(err, ErrRemoveSubnet) - - if err != nil && !isRemoveErr { - return err - } - - if isRemoveErr { - if isZero { - // we can't remove attribute of zero subnet because it means entry - attrs[i].SetValue(attrSubnetValExit) - } else { - // we can set False or remove attribute, latter is more memory/network efficient. - attrs = append(attrs[:i], attrs[i+1:]...) - i-- - } - - continue - } - - entries++ - } - - if zeroEntry { - // missing attribute of zero subnet equivalent to entry - refs.MakeZeroSubnet(&id) - - err = f(id) - if err != nil { - if !errors.Is(err, ErrRemoveSubnet) { - return err - } - - // zero subnet should be clearly removed with False value - index := len(attrs) - attrs = append(attrs, Attribute{}) - attrs[index].SetKey(subnetAttributeKey(&id)) - attrs[index].SetValue(attrSubnetValExit) - } else { - entries++ - } - } - - if entries <= 0 { - return errNoSubnets - } - - node.SetAttributes(attrs) - - return nil -} diff --git a/netmap/attributes_test.go b/netmap/attributes_test.go deleted file mode 100644 index 1a340bd..0000000 --- a/netmap/attributes_test.go +++ /dev/null @@ -1,361 +0,0 @@ -package netmap_test - -import ( - "strconv" - "testing" - - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" - netmaptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/test" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/stretchr/testify/require" -) - -func subnetAttrKey(val string) string { - return "__SYSTEM__SUBNET_" + val -} - -func assertSubnetAttrKey(t *testing.T, attr *netmap.Attribute, num uint32) { - require.Equal(t, subnetAttrKey(strconv.FormatUint(uint64(num), 10)), attr.GetKey()) -} - -func BenchmarkNodeAttributes(b *testing.B) { - const size = 50 - - id := new(refs.SubnetID) - id.SetValue(12) - - attrs := make([]netmap.Attribute, size) - for i := range attrs { - if i == size/2 { - attrs[i] = *netmaptest.GenerateAttribute(false) - } else { - data, err := id.MarshalText() - require.NoError(b, err) - - attrs[i].SetKey(subnetAttrKey(string(data))) - attrs[i].SetValue("True") - } - } - - var info netmap.NodeSubnetInfo - info.SetID(id) - info.SetEntryFlag(false) - - node := new(netmap.NodeInfo) - - // When using a single slice `StartTimer` overhead is comparable to the - // function execution time, so we reduce this cost by updating slices in groups. - const cacheSize = 1000 - a := make([][]netmap.Attribute, cacheSize) - for i := range a { - a[i] = make([]netmap.Attribute, size) - } - - b.ResetTimer() - b.ReportAllocs() - for i := 0; i < b.N; i++ { - if i%cacheSize == 0 { - b.StopTimer() - for j := range a { - copy(a[j], attrs) - } - b.StartTimer() - } - node.SetAttributes(a[i%cacheSize]) - netmap.WriteSubnetInfo(node, info) - if len(node.GetAttributes())+1 != len(attrs) { - b.FailNow() - } - } -} - -func TestWriteSubnetInfo(t *testing.T) { - t.Run("entry", func(t *testing.T) { - t.Run("zero subnet", func(t *testing.T) { - var ( - node netmap.NodeInfo - info netmap.NodeSubnetInfo - ) - - netmap.WriteSubnetInfo(&node, info) - - // entry to zero subnet does not require an attribute - attrs := node.GetAttributes() - require.Empty(t, attrs) - - // exit the subnet - info.SetEntryFlag(false) - - netmap.WriteSubnetInfo(&node, info) - - // exit from zero subnet should be clearly reflected in attributes - attrs = node.GetAttributes() - require.Len(t, attrs, 1) - - attr := &attrs[0] - assertSubnetAttrKey(t, attr, 0) - require.Equal(t, "False", attr.GetValue()) - - // again enter to zero subnet - info.SetEntryFlag(true) - - netmap.WriteSubnetInfo(&node, info) - - // attribute should be removed - attrs = node.GetAttributes() - require.Empty(t, attrs) - }) - - t.Run("non-zero subnet", func(t *testing.T) { - var ( - node netmap.NodeInfo - info netmap.NodeSubnetInfo - id refs.SubnetID - ) - - // create non-zero subnet ID - const num = 15 - - id.SetValue(num) - - // enter to the subnet - info.SetID(&id) - info.SetEntryFlag(true) - - netmap.WriteSubnetInfo(&node, info) - - // check attribute format - attrs := node.GetAttributes() - require.Len(t, attrs, 1) - - attr := &attrs[0] - assertSubnetAttrKey(t, attr, num) - require.Equal(t, "True", attr.GetValue()) - - // again exit the subnet - info.SetEntryFlag(false) - - netmap.WriteSubnetInfo(&node, info) - - // attribute should be removed - attrs = node.GetAttributes() - require.Empty(t, attrs) - }) - }) -} - -func TestSubnets(t *testing.T) { - t.Run("empty", func(t *testing.T) { - var node netmap.NodeInfo - - called := 0 - - err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error { - called++ - - require.True(t, refs.IsZeroSubnet(&id)) - - return nil - }) - - require.NoError(t, err) - require.EqualValues(t, 1, called) - }) - - t.Run("with correct attribute", func(t *testing.T) { - var ( - node netmap.NodeInfo - - attrEntry, attrExit netmap.Attribute - ) - - const ( - numEntry = 13 - numExit = 14 - ) - - attrEntry.SetKey(subnetAttrKey(strconv.FormatUint(numEntry, 10))) - attrEntry.SetValue("True") - - attrExit.SetKey(subnetAttrKey(strconv.FormatUint(numExit, 10))) - attrExit.SetValue("False") - - attrs := []netmap.Attribute{attrEntry, attrEntry} - - node.SetAttributes(attrs) - - mCalledNums := make(map[uint32]struct{}) - - err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error { - mCalledNums[id.GetValue()] = struct{}{} - - return nil - }) - - require.NoError(t, err) - require.Len(t, mCalledNums, 2) - - _, ok := mCalledNums[numEntry] - require.True(t, ok) - - _, ok = mCalledNums[numExit] - require.False(t, ok) - - _, ok = mCalledNums[0] - require.True(t, ok) - }) - - t.Run("with incorrect attribute", func(t *testing.T) { - assertErr := func(attr netmap.Attribute) { - var node netmap.NodeInfo - - node.SetAttributes([]netmap.Attribute{attr}) - - require.Error(t, netmap.IterateSubnets(&node, func(refs.SubnetID) error { - return nil - })) - } - - t.Run("incorrect key", func(t *testing.T) { - var attr netmap.Attribute - - attr.SetKey(subnetAttrKey("one-two-three")) - - assertErr(attr) - }) - - t.Run("incorrect value", func(t *testing.T) { - var attr netmap.Attribute - - attr.SetKey(subnetAttrKey("1")) - - for _, invalidVal := range []string{ - "", - "Troo", - "Fols", - } { - attr.SetValue(invalidVal) - assertErr(attr) - } - - assertErr(attr) - }) - }) - - t.Run("remove entry", func(t *testing.T) { - t.Run("zero", func(t *testing.T) { - var node netmap.NodeInfo - - // enter to some non-zero subnet so that zero is not the only one - var attr netmap.Attribute - - attr.SetKey(subnetAttrKey("321")) - attr.SetValue("True") - - attrs := []netmap.Attribute{attr} - node.SetAttributes(attrs) - - err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error { - if refs.IsZeroSubnet(&id) { - return netmap.ErrRemoveSubnet - } - - return nil - }) - - require.NoError(t, err) - - attrs = node.GetAttributes() - require.Len(t, attrs, 2) - - found := false - - for i := range attrs { - if attrs[i].GetKey() == subnetAttrKey("0") { - require.Equal(t, "False", attrs[i].GetValue()) - found = true - } - } - - require.True(t, found) - }) - - t.Run("non-zero", func(t *testing.T) { - var ( - node netmap.NodeInfo - attr netmap.Attribute - ) - - attr.SetKey(subnetAttrKey("99")) - attr.SetValue("True") - - attrs := []netmap.Attribute{attr} - node.SetAttributes(attrs) - - err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error { - if !refs.IsZeroSubnet(&id) { - return netmap.ErrRemoveSubnet - } - - return nil - }) - - require.NoError(t, err) - - attrs = node.GetAttributes() - require.Empty(t, attrs) - }) - - t.Run("all", func(t *testing.T) { - var ( - node netmap.NodeInfo - attrs []netmap.Attribute - ) - - // enter to some non-zero subnet so that zero is not the only one - for i := 1; i <= 5; i++ { - var attr netmap.Attribute - - attr.SetKey(subnetAttrKey(strconv.Itoa(i))) - attr.SetValue("True") - - attrs = append(attrs, attr) - } - - node.SetAttributes(attrs) - - err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error { - return netmap.ErrRemoveSubnet - }) - - require.Error(t, err) - }) - }) - - t.Run("zero subnet removal via attribute", func(t *testing.T) { - var ( - node netmap.NodeInfo - - attrZero, attrOther netmap.Attribute - ) - - attrZero.SetKey(subnetAttrKey("0")) - attrZero.SetValue("False") - - attrOther.SetKey(subnetAttrKey("1")) - attrOther.SetValue("True") - - node.SetAttributes([]netmap.Attribute{attrZero, attrOther}) - - calledCount := 0 - - err := netmap.IterateSubnets(&node, func(id refs.SubnetID) error { - require.False(t, refs.IsZeroSubnet(&id)) - calledCount++ - return nil - }) - - require.NoError(t, err) - require.EqualValues(t, 1, calledCount) - }) -} diff --git a/netmap/convert.go b/netmap/convert.go index cc20d36..6bb1525 100644 --- a/netmap/convert.go +++ b/netmap/convert.go @@ -198,7 +198,6 @@ func (p *PlacementPolicy) ToGRPCMessage() grpc.Message { m.SetSelectors(SelectorsToGRPC(p.selectors)) m.SetReplicas(ReplicasToGRPC(p.replicas)) m.SetContainerBackupFactor(p.backupFactor) - m.SetSubnetID(p.subnetID.ToGRPCMessage().(*refsGRPC.SubnetID)) } return m @@ -227,20 +226,6 @@ func (p *PlacementPolicy) FromGRPCMessage(m grpc.Message) error { return err } - subnetID := v.GetSubnetId() - if subnetID == nil { - p.subnetID = nil - } else { - if p.subnetID == nil { - p.subnetID = new(refs.SubnetID) - } - - err = p.subnetID.FromGRPCMessage(subnetID) - if err != nil { - return err - } - } - p.backupFactor = v.GetContainerBackupFactor() return nil diff --git a/netmap/grpc/types.go b/netmap/grpc/types.go index d0bf41a..f312bbb 100644 --- a/netmap/grpc/types.go +++ b/netmap/grpc/types.go @@ -1,7 +1,5 @@ package netmap -import refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - // SetReplicas of placement policy. func (m *PlacementPolicy) SetReplicas(v []*Replica) { m.Replicas = v @@ -22,11 +20,6 @@ func (m *PlacementPolicy) SetFilters(v []*Filter) { m.Filters = v } -// SetSubnetID sets ID of subnet. -func (m *PlacementPolicy) SetSubnetID(v *refs.SubnetID) { - m.SubnetId = v -} - // SetName of placement filter. func (m *Filter) SetName(v string) { m.Name = v diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index 276e648..f1d5ef0 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -7,7 +7,6 @@ package netmap import ( - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -464,9 +463,6 @@ type PlacementPolicy struct { Selectors []*Selector `protobuf:"bytes,3,rep,name=selectors,proto3" json:"selectors,omitempty"` // List of named filters to reference in selectors Filters []*Filter `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters,omitempty"` - // Subnetwork ID to select nodes from. Zero subnet (default) represents - // all of the nodes which didn't explicitly opt out of membership. - SubnetId *grpc.SubnetID `protobuf:"bytes,5,opt,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` } func (x *PlacementPolicy) Reset() { @@ -529,13 +525,6 @@ func (x *PlacementPolicy) GetFilters() []*Filter { return nil } -func (x *PlacementPolicy) GetSubnetId() *grpc.SubnetID { - if x != nil { - return x.SubnetId - } - return nil -} - // NeoFS node description type NodeInfo struct { state protoimpl.MessageState @@ -827,14 +816,6 @@ func (x *NetworkInfo) GetNetworkConfig() *NetworkConfig { // attributes it's a string presenting floating point number with comma or // point delimiter for decimal part. In the Network Map it will be saved as // 64-bit unsigned integer representing number of minimal token fractions. -// - [ __SYSTEM__SUBNET_%s ] \ -// (`__NEOFS__SUBNET_%s` is deprecated) \ -// `True` or `False`. Defines if the node is included in the `%s` subnetwork -// or not. `%s` must be an existing subnetwork's ID (non-negative integer number). -// A node can be included in more than one subnetwork and, therefore, can contain -// more than one subnet attribute. A missing attribute is equivalent to the -// presence of the attribute with `False` value (except default zero subnetwork -// (with `%s` == 0) for which missing attribute means inclusion in that network). // - UN-LOCODE \ // Node's geographic location in // [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) @@ -956,13 +937,6 @@ func (x *NodeInfo_Attribute) GetParents() []string { // - **ContainerFee** \ // Fee paid for container creation by the container owner. // Value: little-endian integer. Default: 0. -// - **EigenTrustAlpha** \ -// Alpha parameter of EigenTrust algorithm used in the Reputation system. -// Value: decimal floating-point number in UTF-8 string representation. -// Default: 0. -// - **EigenTrustIterations** \ -// Number of EigenTrust algorithm iterations to pass in the Reputation system. -// Value: little-endian integer. Default: 0. // - **EpochDuration** \ // NeoFS epoch duration measured in Sidechain blocks. // Value: little-endian integer. Default: 0. @@ -1043,116 +1017,111 @@ var File_netmap_grpc_types_proto protoreflect.FileDescriptor var file_netmap_grpc_types_proto_rawDesc = []byte{ 0x0a, 0x17, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 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, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x1a, 0x15, 0x72, 0x65, 0x66, - 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, - 0x61, 0x70, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x08, 0x53, - 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, - 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x52, 0x06, 0x63, 0x6c, 0x61, - 0x75, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x07, 0x52, 0x65, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0xa5, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, - 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x73, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x62, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x35, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x6e, 0x65, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x75, 0x62, 0x6e, - 0x65, 0x74, 0x49, 0x44, 0x52, 0x08, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x22, 0xd8, - 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, - 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x36, - 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x22, 0xa5, 0x01, 0x0a, 0x06, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x02, + 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, + 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x08, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6c, + 0x61, 0x75, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x43, 0x6c, + 0x61, 0x75, 0x73, 0x65, 0x52, 0x06, 0x63, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x07, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x14, 0x0a, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, + 0xee, 0x01, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x66, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x46, 0x61, 0x63, 0x74, + 0x6f, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x52, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x07, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x4d, 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, 0x12, 0x18, 0x0a, 0x07, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x42, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, - 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4f, - 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e, - 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x22, 0x50, 0x0a, 0x06, 0x4e, 0x65, 0x74, - 0x6d, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x30, 0x0a, 0x05, 0x6e, 0x6f, 0x64, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x0d, - 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x49, 0x0a, - 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, + 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, + 0x22, 0xd8, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, + 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, + 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x12, 0x36, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, + 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x4d, 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, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x42, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, + 0x07, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, + 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x22, 0x50, 0x0a, 0x06, 0x4e, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x30, 0x0a, 0x05, 0x6e, + 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, + 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x8f, 0x01, + 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x49, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x33, 0x0a, 0x09, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0xbf, 0x01, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x67, 0x69, + 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x73, 0x5f, 0x70, 0x65, + 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, + 0x73, 0x50, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x46, 0x0a, 0x0e, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x33, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbf, 0x01, - 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, - 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f, 0x6e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x73, 0x50, - 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x46, 0x0a, 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, - 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, - 0x67, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, - 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10, 0x01, 0x12, - 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x54, 0x10, 0x03, 0x12, - 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10, 0x05, 0x12, - 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10, 0x07, 0x12, - 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x08, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c, 0x61, 0x75, - 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, - 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, 0x43, 0x54, - 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, - 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, - 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2a, 0x67, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, + 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10, + 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x54, 0x10, + 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10, + 0x05, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10, + 0x07, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x08, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c, + 0x61, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, + 0x53, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, + 0x43, 0x54, 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, + 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, + 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, + 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, + 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1183,7 +1152,6 @@ var file_netmap_grpc_types_proto_goTypes = []interface{}{ (*NetworkInfo)(nil), // 10: neo.fs.v2.netmap.NetworkInfo (*NodeInfo_Attribute)(nil), // 11: neo.fs.v2.netmap.NodeInfo.Attribute (*NetworkConfig_Parameter)(nil), // 12: neo.fs.v2.netmap.NetworkConfig.Parameter - (*grpc.SubnetID)(nil), // 13: neo.fs.v2.refs.SubnetID } var file_netmap_grpc_types_proto_depIdxs = []int32{ 0, // 0: neo.fs.v2.netmap.Filter.op:type_name -> neo.fs.v2.netmap.Operation @@ -1192,17 +1160,16 @@ var file_netmap_grpc_types_proto_depIdxs = []int32{ 5, // 3: neo.fs.v2.netmap.PlacementPolicy.replicas:type_name -> neo.fs.v2.netmap.Replica 4, // 4: neo.fs.v2.netmap.PlacementPolicy.selectors:type_name -> neo.fs.v2.netmap.Selector 3, // 5: neo.fs.v2.netmap.PlacementPolicy.filters:type_name -> neo.fs.v2.netmap.Filter - 13, // 6: neo.fs.v2.netmap.PlacementPolicy.subnet_id:type_name -> neo.fs.v2.refs.SubnetID - 11, // 7: neo.fs.v2.netmap.NodeInfo.attributes:type_name -> neo.fs.v2.netmap.NodeInfo.Attribute - 2, // 8: neo.fs.v2.netmap.NodeInfo.state:type_name -> neo.fs.v2.netmap.NodeInfo.State - 7, // 9: neo.fs.v2.netmap.Netmap.nodes:type_name -> neo.fs.v2.netmap.NodeInfo - 12, // 10: neo.fs.v2.netmap.NetworkConfig.parameters:type_name -> neo.fs.v2.netmap.NetworkConfig.Parameter - 9, // 11: neo.fs.v2.netmap.NetworkInfo.network_config:type_name -> neo.fs.v2.netmap.NetworkConfig - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 11, // 6: neo.fs.v2.netmap.NodeInfo.attributes:type_name -> neo.fs.v2.netmap.NodeInfo.Attribute + 2, // 7: neo.fs.v2.netmap.NodeInfo.state:type_name -> neo.fs.v2.netmap.NodeInfo.State + 7, // 8: neo.fs.v2.netmap.Netmap.nodes:type_name -> neo.fs.v2.netmap.NodeInfo + 12, // 9: neo.fs.v2.netmap.NetworkConfig.parameters:type_name -> neo.fs.v2.netmap.NetworkConfig.Parameter + 9, // 10: neo.fs.v2.netmap.NetworkInfo.network_config:type_name -> neo.fs.v2.netmap.NetworkConfig + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_netmap_grpc_types_proto_init() } diff --git a/netmap/marshal.go b/netmap/marshal.go index e08d6f0..5c8cf35 100644 --- a/netmap/marshal.go +++ b/netmap/marshal.go @@ -26,7 +26,6 @@ const ( backupPolicyField = 2 selectorsPolicyField = 3 filtersPolicyField = 4 - subnetIDPolicyField = 5 keyAttributeField = 1 valueAttributeField = 2 @@ -167,8 +166,6 @@ func (p *PlacementPolicy) StableMarshal(buf []byte) []byte { offset += protoutil.NestedStructureMarshal(filtersPolicyField, buf[offset:], &p.filters[i]) } - protoutil.NestedStructureMarshal(subnetIDPolicyField, buf[offset:], p.subnetID) - return buf } @@ -187,8 +184,6 @@ func (p *PlacementPolicy) StableSize() (size int) { size += protoutil.NestedStructureSize(filtersPolicyField, &p.filters[i]) } - size += protoutil.NestedStructureSize(subnetIDPolicyField, p.subnetID) - return size } diff --git a/netmap/test/generate.go b/netmap/test/generate.go index 30e200e..8889bab 100644 --- a/netmap/test/generate.go +++ b/netmap/test/generate.go @@ -102,7 +102,6 @@ func GeneratePlacementPolicy(empty bool) *netmap.PlacementPolicy { m.SetFilters(GenerateFilters(false)) m.SetSelectors(GenerateSelectors(false)) m.SetReplicas(GenerateReplicas(false)) - m.SetSubnetID(refstest.GenerateSubnetID(false)) } return m diff --git a/netmap/types.go b/netmap/types.go index c878184..27fc2ff 100644 --- a/netmap/types.go +++ b/netmap/types.go @@ -59,7 +59,6 @@ type PlacementPolicy struct { backupFactor uint32 selectors []Selector filters []Filter - subnetID *refs.SubnetID } // Attribute of storage node. @@ -302,14 +301,6 @@ func (p *PlacementPolicy) SetReplicas(replicas []Replica) { p.replicas = replicas } -func (p *PlacementPolicy) GetSubnetID() *refs.SubnetID { - return p.subnetID -} - -func (p *PlacementPolicy) SetSubnetID(id *refs.SubnetID) { - p.subnetID = id -} - func (a *Attribute) GetKey() string { if a != nil { return a.key diff --git a/refs/convert.go b/refs/convert.go index 028bd6a..b2c353c 100644 --- a/refs/convert.go +++ b/refs/convert.go @@ -266,31 +266,3 @@ func (s *Signature) FromGRPCMessage(m grpc.Message) error { return nil } - -// ToGRPCMessage forms refs.SubnetID message and returns it as grpc.Message. -func (s *SubnetID) ToGRPCMessage() grpc.Message { - var m *refs.SubnetID - - if s != nil { - m = new(refs.SubnetID) - - m.SetValue(s.value) - } - - return m -} - -// FromGRPCMessage restores Info from grpc.Message. -// -// Supported types: -// - refs.SubnetID. -func (s *SubnetID) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*refs.SubnetID) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - s.value = v.GetValue() - - return nil -} diff --git a/refs/grpc/types.go b/refs/grpc/types.go index 0cf7368..843a2ee 100644 --- a/refs/grpc/types.go +++ b/refs/grpc/types.go @@ -95,8 +95,3 @@ func (x *ChecksumType) FromString(s string) bool { return ok } - -// SetValue sets subnet identifier in a base-10 integer format. -func (x *SubnetID) SetValue(v uint32) { - x.Value = v -} diff --git a/refs/grpc/types.pb.go b/refs/grpc/types.pb.go index 0d6b671..f16583b 100644 --- a/refs/grpc/types.pb.go +++ b/refs/grpc/types.pb.go @@ -378,59 +378,6 @@ func (x *OwnerID) GetValue() []byte { return nil } -// NeoFS subnetwork identifier. -// -// String representation of a value is base-10 integer. -// -// JSON representation is an object containing a single `value` number field. -type SubnetID struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 4-byte integer subnetwork identifier. - Value uint32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *SubnetID) Reset() { - *x = SubnetID{} - if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubnetID) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubnetID) ProtoMessage() {} - -func (x *SubnetID) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubnetID.ProtoReflect.Descriptor instead. -func (*SubnetID) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{4} -} - -func (x *SubnetID) GetValue() uint32 { - if x != nil { - return x.Value - } - return 0 -} - // API version used by a node. // // String presentation is a Semantic Versioning 2.0.0 compatible version string @@ -449,7 +396,7 @@ type Version struct { func (x *Version) Reset() { *x = Version{} if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[5] + mi := &file_refs_grpc_types_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -462,7 +409,7 @@ func (x *Version) String() string { func (*Version) ProtoMessage() {} func (x *Version) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[5] + mi := &file_refs_grpc_types_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -475,7 +422,7 @@ func (x *Version) ProtoReflect() protoreflect.Message { // Deprecated: Use Version.ProtoReflect.Descriptor instead. func (*Version) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{5} + return file_refs_grpc_types_proto_rawDescGZIP(), []int{4} } func (x *Version) GetMajor() uint32 { @@ -509,7 +456,7 @@ type Signature struct { func (x *Signature) Reset() { *x = Signature{} if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[6] + mi := &file_refs_grpc_types_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -522,7 +469,7 @@ func (x *Signature) String() string { func (*Signature) ProtoMessage() {} func (x *Signature) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[6] + mi := &file_refs_grpc_types_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -535,7 +482,7 @@ func (x *Signature) ProtoReflect() protoreflect.Message { // Deprecated: Use Signature.ProtoReflect.Descriptor instead. func (*Signature) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{6} + return file_refs_grpc_types_proto_rawDescGZIP(), []int{5} } func (x *Signature) GetKey() []byte { @@ -574,7 +521,7 @@ type SignatureRFC6979 struct { func (x *SignatureRFC6979) Reset() { *x = SignatureRFC6979{} if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[7] + mi := &file_refs_grpc_types_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -587,7 +534,7 @@ func (x *SignatureRFC6979) String() string { func (*SignatureRFC6979) ProtoMessage() {} func (x *SignatureRFC6979) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[7] + mi := &file_refs_grpc_types_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -600,7 +547,7 @@ func (x *SignatureRFC6979) ProtoReflect() protoreflect.Message { // Deprecated: Use SignatureRFC6979.ProtoReflect.Descriptor instead. func (*SignatureRFC6979) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{7} + return file_refs_grpc_types_proto_rawDescGZIP(), []int{6} } func (x *SignatureRFC6979) GetKey() []byte { @@ -638,7 +585,7 @@ type Checksum struct { func (x *Checksum) Reset() { *x = Checksum{} if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[8] + mi := &file_refs_grpc_types_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -651,7 +598,7 @@ func (x *Checksum) String() string { func (*Checksum) ProtoMessage() {} func (x *Checksum) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[8] + mi := &file_refs_grpc_types_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -664,7 +611,7 @@ func (x *Checksum) ProtoReflect() protoreflect.Message { // Deprecated: Use Checksum.ProtoReflect.Descriptor instead. func (*Checksum) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{8} + return file_refs_grpc_types_proto_rawDescGZIP(), []int{7} } func (x *Checksum) GetType() ChecksumType { @@ -701,45 +648,43 @@ var file_refs_grpc_types_proto_rawDesc = []byte{ 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x1f, 0x0a, 0x07, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x20, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x44, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x35, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x6f, 0x0a, 0x09, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, - 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, - 0x68, 0x65, 0x6d, 0x65, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x10, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x4e, 0x0a, 0x08, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x2a, 0x66, 0x0a, 0x0f, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x10, - 0x0a, 0x0c, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x00, - 0x12, 0x18, 0x0a, 0x14, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, - 0x39, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x45, 0x43, - 0x44, 0x53, 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f, 0x53, 0x48, 0x41, 0x32, - 0x35, 0x36, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, - 0x54, 0x10, 0x02, 0x2a, 0x41, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x54, 0x5a, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, - 0x41, 0x32, 0x35, 0x36, 0x10, 0x02, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, - 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x3b, 0x72, 0x65, 0x66, 0x73, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, - 0x65, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x65, 0x22, 0x35, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, + 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x61, + 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x6f, 0x0a, 0x09, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, + 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x65, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x10, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x4e, 0x0a, 0x08, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x2a, 0x66, 0x0a, 0x0f, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x0c, + 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x00, 0x12, 0x18, + 0x0a, 0x14, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x45, 0x43, 0x44, 0x53, + 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x10, + 0x02, 0x2a, 0x41, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x06, 0x0a, 0x02, 0x54, 0x5a, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x10, 0x02, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, + 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, + 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x3b, 0x72, 0x65, 0x66, 0x73, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, + 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, 0x66, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -755,7 +700,7 @@ func file_refs_grpc_types_proto_rawDescGZIP() []byte { } var file_refs_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_refs_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_refs_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_refs_grpc_types_proto_goTypes = []interface{}{ (SignatureScheme)(0), // 0: neo.fs.v2.refs.SignatureScheme (ChecksumType)(0), // 1: neo.fs.v2.refs.ChecksumType @@ -763,11 +708,10 @@ var file_refs_grpc_types_proto_goTypes = []interface{}{ (*ObjectID)(nil), // 3: neo.fs.v2.refs.ObjectID (*ContainerID)(nil), // 4: neo.fs.v2.refs.ContainerID (*OwnerID)(nil), // 5: neo.fs.v2.refs.OwnerID - (*SubnetID)(nil), // 6: neo.fs.v2.refs.SubnetID - (*Version)(nil), // 7: neo.fs.v2.refs.Version - (*Signature)(nil), // 8: neo.fs.v2.refs.Signature - (*SignatureRFC6979)(nil), // 9: neo.fs.v2.refs.SignatureRFC6979 - (*Checksum)(nil), // 10: neo.fs.v2.refs.Checksum + (*Version)(nil), // 6: neo.fs.v2.refs.Version + (*Signature)(nil), // 7: neo.fs.v2.refs.Signature + (*SignatureRFC6979)(nil), // 8: neo.fs.v2.refs.SignatureRFC6979 + (*Checksum)(nil), // 9: neo.fs.v2.refs.Checksum } var file_refs_grpc_types_proto_depIdxs = []int32{ 4, // 0: neo.fs.v2.refs.Address.container_id:type_name -> neo.fs.v2.refs.ContainerID @@ -836,18 +780,6 @@ func file_refs_grpc_types_proto_init() { } } file_refs_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubnetID); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_refs_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Version); i { case 0: return &v.state @@ -859,7 +791,7 @@ func file_refs_grpc_types_proto_init() { return nil } } - file_refs_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_refs_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Signature); i { case 0: return &v.state @@ -871,7 +803,7 @@ func file_refs_grpc_types_proto_init() { return nil } } - file_refs_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_refs_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignatureRFC6979); i { case 0: return &v.state @@ -883,7 +815,7 @@ func file_refs_grpc_types_proto_init() { return nil } } - file_refs_grpc_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_refs_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Checksum); i { case 0: return &v.state @@ -902,7 +834,7 @@ func file_refs_grpc_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_refs_grpc_types_proto_rawDesc, NumEnums: 2, - NumMessages: 9, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/refs/marshal.go b/refs/marshal.go index 14b0f8c..0382190 100644 --- a/refs/marshal.go +++ b/refs/marshal.go @@ -261,43 +261,3 @@ func (v *Version) StableSize() (size int) { func (v *Version) Unmarshal(data []byte) error { return message.Unmarshal(v, data, new(refs.Version)) } - -// SubnetID message field numbers -const ( - _ = iota - subnetIDValFNum -) - -// StableMarshal marshals SubnetID to NeoFS API V2 binary format (Protocol Buffers with direct field order). -// -// Returns a slice of recorded data. Data is written to the provided buffer if there is enough space. -func (s *SubnetID) StableMarshal(buf []byte) []byte { - if s == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, s.StableSize()) - } - - proto.Fixed32Marshal(subnetIDValFNum, buf, s.value) - - return buf -} - -// StableSize returns the number of bytes required to write SubnetID in NeoFS API V2 binary format (see StableMarshal). -func (s *SubnetID) StableSize() (size int) { - if s != nil { - size += proto.Fixed32Size(subnetIDValFNum, s.value) - } - - return -} - -// Unmarshal unmarshals SubnetID from NeoFS API V2 binary format (see StableMarshal). -// Must not be called on nil. -// -// Note: empty data corresponds to zero ID value or nil pointer to it. -func (s *SubnetID) Unmarshal(data []byte) error { - return message.Unmarshal(s, data, new(refs.SubnetID)) -} diff --git a/refs/message_test.go b/refs/message_test.go index ba36434..69f2242 100644 --- a/refs/message_test.go +++ b/refs/message_test.go @@ -17,6 +17,5 @@ func TestMessageConvert(t *testing.T) { func(empty bool) message.Message { return refstest.GenerateChecksum(empty) }, func(empty bool) message.Message { return refstest.GenerateSignature(empty) }, func(empty bool) message.Message { return refstest.GenerateVersion(empty) }, - func(empty bool) message.Message { return refstest.GenerateSubnetID(empty) }, ) } diff --git a/refs/test/generate.go b/refs/test/generate.go index cce64a8..6217a96 100644 --- a/refs/test/generate.go +++ b/refs/test/generate.go @@ -106,13 +106,3 @@ func GenerateChecksum(empty bool) *refs.Checksum { return m } - -func GenerateSubnetID(empty bool) *refs.SubnetID { - m := new(refs.SubnetID) - - if !empty { - m.SetValue(666) - } - - return m -} diff --git a/refs/types.go b/refs/types.go index 2d4fec7..d8f0d9b 100644 --- a/refs/types.go +++ b/refs/types.go @@ -1,10 +1,5 @@ package refs -import ( - "fmt" - "strconv" -) - type OwnerID struct { val []byte } @@ -45,10 +40,6 @@ type Signature struct { scheme SignatureScheme } -type SubnetID struct { - value uint32 -} - type Version struct { major, minor uint32 } @@ -178,56 +169,6 @@ func (s *Signature) SetScheme(scheme SignatureScheme) { s.scheme = scheme } -func (s *SubnetID) SetValue(id uint32) { - s.value = id -} - -func (s *SubnetID) GetValue() uint32 { - if s != nil { - return s.value - } - return 0 -} - -// MarshalText encodes SubnetID into text format according to NeoFS API V2 protocol: -// value in base-10 integer string format. -// -// Implements encoding.TextMarshaler. -func (s *SubnetID) MarshalText() ([]byte, error) { - num := s.GetValue() // NPE safe, returns zero on nil (zero subnet) - - return []byte(strconv.FormatUint(uint64(num), 10)), nil -} - -// UnmarshalText decodes SubnetID from the text according to NeoFS API V2 protocol: -// should be base-10 integer string format with bitsize = 32. -// -// Returns strconv.ErrRange if integer overflows uint32. -// -// Must not be called on nil. -// -// Implements encoding.TextUnmarshaler. -func (s *SubnetID) UnmarshalText(txt []byte) error { - num, err := strconv.ParseUint(string(txt), 10, 32) - if err != nil { - return fmt.Errorf("invalid numeric value: %w", err) - } - - s.value = uint32(num) - - return nil -} - -// IsZeroSubnet returns true iff the SubnetID refers to zero subnet. -func IsZeroSubnet(id *SubnetID) bool { - return id.GetValue() == 0 -} - -// MakeZeroSubnet makes the SubnetID to refer to zero subnet. -func MakeZeroSubnet(id *SubnetID) { - id.SetValue(0) -} - func (v *Version) GetMajor() uint32 { if v != nil { return v.major diff --git a/refs/types_test.go b/refs/types_test.go deleted file mode 100644 index 68d8fd7..0000000 --- a/refs/types_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package refs_test - -import ( - "math" - "strconv" - "testing" - - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "github.com/stretchr/testify/require" -) - -func TestZeroSubnet(t *testing.T) { - id := new(refs.SubnetID) - - require.True(t, refs.IsZeroSubnet(id)) - - id.SetValue(1) - require.False(t, refs.IsZeroSubnet(id)) - - refs.MakeZeroSubnet(id) - require.True(t, refs.IsZeroSubnet(id)) -} - -func TestSubnetID_MarshalText(t *testing.T) { - var id refs.SubnetID - - const val = 15 - - id.SetValue(val) - - txt, err := id.MarshalText() - require.NoError(t, err) - - res, err := strconv.ParseUint(string(txt), 10, 32) - require.NoError(t, err) - - require.EqualValues(t, val, res) - - t.Run("nil", func(t *testing.T) { - var id *refs.SubnetID - - txt, err := id.MarshalText() - require.NoError(t, err) - - res, err := strconv.ParseUint(string(txt), 10, 32) - require.NoError(t, err) - - require.Zero(t, res) - }) -} - -func TestSubnetID_UnmarshalText(t *testing.T) { - const val = 15 - - str := strconv.FormatUint(val, 10) - - var id refs.SubnetID - - err := id.UnmarshalText([]byte(str)) - require.NoError(t, err) - - require.EqualValues(t, val, id.GetValue()) - - t.Run("uint32 overflow", func(t *testing.T) { - txt := strconv.FormatUint(math.MaxUint32+1, 10) - - var id refs.SubnetID - - err := id.UnmarshalText([]byte(txt)) - require.ErrorIs(t, err, strconv.ErrRange) - }) -} diff --git a/subnet/encoding_test.go b/subnet/encoding_test.go deleted file mode 100644 index 0a1fea1..0000000 --- a/subnet/encoding_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package subnet_test - -import ( - "testing" - - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" - subnettest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet/test" -) - -func TestMessageConvert(t *testing.T) { - messagetest.TestRPCMessage(t, - func(empty bool) message.Message { return subnettest.GenerateSubnetInfo(empty) }, - ) -} diff --git a/subnet/grpc/types.go b/subnet/grpc/types.go deleted file mode 100644 index 3196c5a..0000000 --- a/subnet/grpc/types.go +++ /dev/null @@ -1,15 +0,0 @@ -package subnet - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" -) - -// SetID returns identifier of the subnet. Nil arg is equivalent to zero subnet ID. -func (x *SubnetInfo) SetID(id *refs.SubnetID) { - x.Id = id -} - -// SetOwner sets subnet owner's ID in NeoFS system. -func (x *SubnetInfo) SetOwner(id *refs.OwnerID) { - x.Owner = id -} diff --git a/subnet/grpc/types.pb.go b/subnet/grpc/types.pb.go deleted file mode 100644 index 032ba6c..0000000 --- a/subnet/grpc/types.pb.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 -// source: subnet/grpc/types.proto - -package subnet - -import ( - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// NeoFS subnetwork description -type SubnetInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Unique subnet identifier. Missing ID is - // equivalent to zero (default subnetwork) ID. - Id *grpc.SubnetID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Identifier of the subnetwork owner - Owner *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` -} - -func (x *SubnetInfo) Reset() { - *x = SubnetInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_subnet_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubnetInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubnetInfo) ProtoMessage() {} - -func (x *SubnetInfo) ProtoReflect() protoreflect.Message { - mi := &file_subnet_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubnetInfo.ProtoReflect.Descriptor instead. -func (*SubnetInfo) Descriptor() ([]byte, []int) { - return file_subnet_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *SubnetInfo) GetId() *grpc.SubnetID { - if x != nil { - return x.Id - } - return nil -} - -func (x *SubnetInfo) GetOwner() *grpc.OwnerID { - if x != nil { - return x.Owner - } - return nil -} - -var File_subnet_grpc_types_proto protoreflect.FileDescriptor - -var file_subnet_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 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, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x1a, 0x15, 0x72, 0x65, 0x66, - 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x65, 0x0a, 0x0a, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x75, - 0x62, 0x6e, 0x65, 0x74, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 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, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, - 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, - 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x75, 0x62, - 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x75, 0x62, 0x6e, 0x65, 0x74, 0xaa, - 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_subnet_grpc_types_proto_rawDescOnce sync.Once - file_subnet_grpc_types_proto_rawDescData = file_subnet_grpc_types_proto_rawDesc -) - -func file_subnet_grpc_types_proto_rawDescGZIP() []byte { - file_subnet_grpc_types_proto_rawDescOnce.Do(func() { - file_subnet_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_subnet_grpc_types_proto_rawDescData) - }) - return file_subnet_grpc_types_proto_rawDescData -} - -var file_subnet_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_subnet_grpc_types_proto_goTypes = []interface{}{ - (*SubnetInfo)(nil), // 0: neo.fs.v2.subnet.SubnetInfo - (*grpc.SubnetID)(nil), // 1: neo.fs.v2.refs.SubnetID - (*grpc.OwnerID)(nil), // 2: neo.fs.v2.refs.OwnerID -} -var file_subnet_grpc_types_proto_depIdxs = []int32{ - 1, // 0: neo.fs.v2.subnet.SubnetInfo.id:type_name -> neo.fs.v2.refs.SubnetID - 2, // 1: neo.fs.v2.subnet.SubnetInfo.owner:type_name -> neo.fs.v2.refs.OwnerID - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_subnet_grpc_types_proto_init() } -func file_subnet_grpc_types_proto_init() { - if File_subnet_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_subnet_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubnetInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_subnet_grpc_types_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_subnet_grpc_types_proto_goTypes, - DependencyIndexes: file_subnet_grpc_types_proto_depIdxs, - MessageInfos: file_subnet_grpc_types_proto_msgTypes, - }.Build() - File_subnet_grpc_types_proto = out.File - file_subnet_grpc_types_proto_rawDesc = nil - file_subnet_grpc_types_proto_goTypes = nil - file_subnet_grpc_types_proto_depIdxs = nil -} diff --git a/subnet/info.go b/subnet/info.go deleted file mode 100644 index 2e1e94c..0000000 --- a/subnet/info.go +++ /dev/null @@ -1,138 +0,0 @@ -package subnet - -import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - refsgrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" - subnet "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet/grpc" - protoutil "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" -) - -// Info represents information about NeoFS subnet. Structure is compatible with NeoFS API V2 protocol. -// -// Zero value represents zero subnet w/o an owner. -type Info struct { - id *refs.SubnetID - - owner *refs.OwnerID -} - -// ID returns identifier of the subnet. Nil return is equivalent to zero subnet ID. -func (x *Info) ID() *refs.SubnetID { - return x.id -} - -// SetID returns identifier of the subnet. Nil arg is equivalent to zero subnet ID. -func (x *Info) SetID(id *refs.SubnetID) { - x.id = id -} - -// Owner returns subnet owner's ID in NeoFS system. -func (x *Info) Owner() *refs.OwnerID { - return x.owner -} - -// SetOwner sets subnet owner's ID in NeoFS system. -func (x *Info) SetOwner(id *refs.OwnerID) { - x.owner = id -} - -// ToGRPCMessage forms subnet.SubnetInfo message and returns it as grpc.Message. -func (x *Info) ToGRPCMessage() grpc.Message { - var m *subnet.SubnetInfo - - if x != nil { - m = new(subnet.SubnetInfo) - - m.SetID(x.id.ToGRPCMessage().(*refsgrpc.SubnetID)) - m.SetOwner(x.owner.ToGRPCMessage().(*refsgrpc.OwnerID)) - } - - return m -} - -// FromGRPCMessage restores Info from grpc.Message. -// -// Supported types: -// - subnet.SubnetInfo. -func (x *Info) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*subnet.SubnetInfo) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - id := v.GetId() - if id == nil { - x.id = nil - } else { - if x.id == nil { - x.id = new(refs.SubnetID) - } - - err = x.id.FromGRPCMessage(id) - if err != nil { - return err - } - } - - ownerID := v.GetOwner() - if ownerID == nil { - x.owner = nil - } else { - if x.owner == nil { - x.owner = new(refs.OwnerID) - } - - err = x.owner.FromGRPCMessage(ownerID) - if err != nil { - return err - } - } - - return nil -} - -// SubnetInfo message field numbers -const ( - _ = iota - subnetInfoIDFNum - subnetInfoOwnerFNum -) - -// StableMarshal marshals Info to NeoFS API V2 binary format (Protocol Buffers with direct field order). -// -// Returns a slice of recorded data. Data is written to the provided buffer if there is enough space. -func (x *Info) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, x.StableSize()) - } - - var offset int - - offset += protoutil.NestedStructureMarshal(subnetInfoIDFNum, buf[offset:], x.id) - protoutil.NestedStructureMarshal(subnetInfoOwnerFNum, buf[offset:], x.owner) - - return buf -} - -// StableSize returns the number of bytes required to write Info in NeoFS API V2 binary format (see StableMarshal). -func (x *Info) StableSize() (size int) { - if x != nil { - size += protoutil.NestedStructureSize(subnetInfoIDFNum, x.id) - size += protoutil.NestedStructureSize(subnetInfoOwnerFNum, x.owner) - } - - return -} - -// Unmarshal decodes Info from NeoFS API V2 binary format (see StableMarshal). -func (x *Info) Unmarshal(data []byte) error { - return message.Unmarshal(x, data, new(subnet.SubnetInfo)) -} diff --git a/subnet/test/generate.go b/subnet/test/generate.go deleted file mode 100644 index 214ac7b..0000000 --- a/subnet/test/generate.go +++ /dev/null @@ -1,17 +0,0 @@ -package subnettest - -import ( - refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet" -) - -func GenerateSubnetInfo(empty bool) *subnet.Info { - m := new(subnet.Info) - - if !empty { - m.SetID(refstest.GenerateSubnetID(false)) - m.SetOwner(refstest.GenerateOwnerID(false)) - } - - return m -} From e297616a483a19e7062338186f16bb00d023e709 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 3 May 2023 13:41:27 +0300 Subject: [PATCH 034/169] [#27] *: Resolve unused linter warnings Signed-off-by: Evgenii Stratonikov --- container/marshal.go | 6 +++--- container/test/generate.go | 6 +++--- netmap/marshal.go | 4 ++-- netmap/test/generate.go | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/container/marshal.go b/container/marshal.go index 98b32b4..a7c57aa 100644 --- a/container/marshal.go +++ b/container/marshal.go @@ -223,7 +223,7 @@ func (r *DeleteRequestBody) Unmarshal(data []byte) error { return message.Unmarshal(r, data, new(container.DeleteRequest_Body)) } -func (r *DeleteResponseBody) StableMarshal(buf []byte) []byte { +func (r *DeleteResponseBody) StableMarshal(_ []byte) []byte { return nil } @@ -391,7 +391,7 @@ func (r *SetExtendedACLRequestBody) Unmarshal(data []byte) error { return message.Unmarshal(r, data, new(container.SetExtendedACLRequest_Body)) } -func (r *SetExtendedACLResponseBody) StableMarshal(buf []byte) []byte { +func (r *SetExtendedACLResponseBody) StableMarshal(_ []byte) []byte { return nil } @@ -533,7 +533,7 @@ func (r *AnnounceUsedSpaceRequestBody) Unmarshal(data []byte) error { return message.Unmarshal(r, data, new(container.AnnounceUsedSpaceRequest_Body)) } -func (r *AnnounceUsedSpaceResponseBody) StableMarshal(buf []byte) []byte { +func (r *AnnounceUsedSpaceResponseBody) StableMarshal(_ []byte) []byte { return nil } diff --git a/container/test/generate.go b/container/test/generate.go index 00a0955..2b2afdf 100644 --- a/container/test/generate.go +++ b/container/test/generate.go @@ -170,7 +170,7 @@ func GenerateDeleteRequest(empty bool) *container.DeleteRequest { return m } -func GenerateDeleteResponseBody(empty bool) *container.DeleteResponseBody { +func GenerateDeleteResponseBody(_ bool) *container.DeleteResponseBody { m := new(container.DeleteResponseBody) return m @@ -260,7 +260,7 @@ func GenerateSetExtendedACLRequest(empty bool) *container.SetExtendedACLRequest return m } -func GenerateSetExtendedACLResponseBody(empty bool) *container.SetExtendedACLResponseBody { +func GenerateSetExtendedACLResponseBody(_ bool) *container.SetExtendedACLResponseBody { m := new(container.SetExtendedACLResponseBody) return m @@ -376,7 +376,7 @@ func GenerateAnnounceUsedSpaceRequest(empty bool) *container.AnnounceUsedSpaceRe return m } -func GenerateAnnounceUsedSpaceResponseBody(empty bool) *container.AnnounceUsedSpaceResponseBody { +func GenerateAnnounceUsedSpaceResponseBody(_ bool) *container.AnnounceUsedSpaceResponseBody { m := new(container.AnnounceUsedSpaceResponseBody) return m diff --git a/netmap/marshal.go b/netmap/marshal.go index 5c8cf35..f707665 100644 --- a/netmap/marshal.go +++ b/netmap/marshal.go @@ -275,7 +275,7 @@ func (ni *NodeInfo) Unmarshal(data []byte) error { return message.Unmarshal(ni, data, new(netmap.NodeInfo)) } -func (l *LocalNodeInfoRequestBody) StableMarshal(buf []byte) []byte { +func (l *LocalNodeInfoRequestBody) StableMarshal(_ []byte) []byte { return nil } @@ -432,7 +432,7 @@ func (i *NetworkInfo) Unmarshal(data []byte) error { return message.Unmarshal(i, data, new(netmap.NetworkInfo)) } -func (l *NetworkInfoRequestBody) StableMarshal(buf []byte) []byte { +func (l *NetworkInfoRequestBody) StableMarshal(_ []byte) []byte { return nil } diff --git a/netmap/test/generate.go b/netmap/test/generate.go index 8889bab..400d24c 100644 --- a/netmap/test/generate.go +++ b/netmap/test/generate.go @@ -144,7 +144,7 @@ func GenerateNodeInfo(empty bool) *netmap.NodeInfo { return m } -func GenerateLocalNodeInfoRequestBody(empty bool) *netmap.LocalNodeInfoRequestBody { +func GenerateLocalNodeInfoRequestBody(_ bool) *netmap.LocalNodeInfoRequestBody { m := new(netmap.LocalNodeInfoRequestBody) return m @@ -225,7 +225,7 @@ func GenerateNetworkInfo(empty bool) *netmap.NetworkInfo { return m } -func GenerateNetworkInfoRequestBody(empty bool) *netmap.NetworkInfoRequestBody { +func GenerateNetworkInfoRequestBody(_ bool) *netmap.NetworkInfoRequestBody { m := new(netmap.NetworkInfoRequestBody) return m From d2b7fd3682657358dd4933329c8787a2c3f9211b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 3 May 2023 13:44:04 +0300 Subject: [PATCH 035/169] [#27] .golanci.yml: Unify with other repos Leave specific excepcions in place. Signed-off-by: Evgenii Stratonikov --- .golangci.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 5abd044..db94146 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,7 @@ # options for analysis running run: # timeout for analysis, e.g. 30s, 5m, default is 1m - timeout: 2m + timeout: 10m # include test files or not, default is true tests: false @@ -27,6 +27,11 @@ linters-settings: govet: # report about shadowed variables check-shadowing: false + funlen: + lines: 80 # default 60 + statements: 60 # default 40 + gocognit: + min-complexity: 40 # default 30 linters: enable: @@ -37,15 +42,27 @@ linters: # some default golangci-lint linters - errcheck - gosimple + - godot - ineffassign - staticcheck - typecheck + - unused # extra linters + - bidichk + - durationcheck - exhaustive + - exportloopref - gofmt - - whitespace - goimports + - misspell + - predeclared + - reassign + - whitespace + - containedctx + - funlen + - gocognit + - contextcheck disable-all: true fast: false From 63915bb7a579af58777073a1cea037469d2f37cc Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 3 May 2023 13:46:07 +0300 Subject: [PATCH 036/169] [#27] *: Resolve godot linter warnings Signed-off-by: Evgenii Stratonikov --- container/attributes.go | 8 ++++---- object/attributes.go | 10 +++++----- session/xheaders.go | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/container/attributes.go b/container/attributes.go index 12277ed..288d048 100644 --- a/container/attributes.go +++ b/container/attributes.go @@ -15,20 +15,20 @@ const ( ) // SysAttributePrefixNeoFS is a prefix of key to system attribute. -// Deprecated: use SysAttributePrefix +// Deprecated: use SysAttributePrefix. const SysAttributePrefixNeoFS = "__NEOFS__" const ( // SysAttributeNameNeoFS is a string of human-friendly container name registered as the domain in NNS contract. - // Deprecated: use SysAttributeName + // Deprecated: use SysAttributeName. SysAttributeNameNeoFS = SysAttributePrefixNeoFS + "NAME" // SysAttributeZoneNeoFS is a string of zone for container name. - // Deprecated: use SysAttributeZone + // Deprecated: use SysAttributeZone. SysAttributeZoneNeoFS = SysAttributePrefixNeoFS + "ZONE" // SysAttributeHomomorphicHashingNeoFS is a container's homomorphic hashing state. - // Deprecated: use SysAttributeHomomorphicHashing + // Deprecated: use SysAttributeHomomorphicHashing. SysAttributeHomomorphicHashingNeoFS = SysAttributePrefixNeoFS + "DISABLE_HOMOMORPHIC_HASHING" ) diff --git a/object/attributes.go b/object/attributes.go index 9aa592f..7f4fca0 100644 --- a/object/attributes.go +++ b/object/attributes.go @@ -26,26 +26,26 @@ const ( ) // SysAttributePrefixNeoFS is a prefix of key to system attribute. -// Deprecated: use SysAttributePrefix +// Deprecated: use SysAttributePrefix. const SysAttributePrefixNeoFS = "__NEOFS__" const ( // SysAttributeUploadIDNeoFS marks smaller parts of a split bigger object. - // Deprecated: use SysAttributeUploadID + // Deprecated: use SysAttributeUploadID. SysAttributeUploadIDNeoFS = SysAttributePrefixNeoFS + "UPLOAD_ID" // SysAttributeExpEpochNeoFS tells GC to delete object after that epoch. - // Deprecated: use SysAttributeExpEpoch + // Deprecated: use SysAttributeExpEpoch. SysAttributeExpEpochNeoFS = SysAttributePrefixNeoFS + "EXPIRATION_EPOCH" // SysAttributeTickEpochNeoFS defines what epoch must produce object // notification. - // Deprecated: use SysAttributeTickEpoch + // Deprecated: use SysAttributeTickEpoch. SysAttributeTickEpochNeoFS = SysAttributePrefixNeoFS + "TICK_EPOCH" // SysAttributeTickTopicNeoFS defines what topic object notification // must be sent to. - // Deprecated: use SysAttributeTickTopic + // Deprecated: use SysAttributeTickTopic. SysAttributeTickTopicNeoFS = SysAttributePrefixNeoFS + "TICK_TOPIC" ) diff --git a/session/xheaders.go b/session/xheaders.go index 0e02093..c575d5f 100644 --- a/session/xheaders.go +++ b/session/xheaders.go @@ -16,19 +16,19 @@ const ( ) // ReservedXHeaderPrefixNeoFS is a prefix of keys to "well-known" X-headers. -// Deprecated: use ReservedXHeaderPrefix +// Deprecated: use ReservedXHeaderPrefix. const ReservedXHeaderPrefixNeoFS = "__NEOFS__" const ( // XHeaderNetmapEpochNeoFS is a key to the reserved X-header that specifies netmap epoch // to use for object placement calculation. If set to '0' or not set, the current // epoch only will be used. - // Deprecated: use XHeaderNetmapEpoch + // Deprecated: use XHeaderNetmapEpoch. XHeaderNetmapEpochNeoFS = ReservedXHeaderPrefixNeoFS + "NETMAP_EPOCH" // XHeaderNetmapLookupDepthNeoFS is a key to the reserved X-header that limits // how many past epochs back the node will can lookup. If set to '0' or not // set, the current epoch only will be used. - // Deprecated: use XHeaderNetmapLookupDepth + // Deprecated: use XHeaderNetmapLookupDepth. XHeaderNetmapLookupDepthNeoFS = ReservedXHeaderPrefixNeoFS + "NETMAP_LOOKUP_DEPTH" ) From 1cab39337e40117378141f582aefaa7634338609 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 3 May 2023 13:58:42 +0300 Subject: [PATCH 037/169] [#27] object: Resolve funlen linter warnings Signed-off-by: Evgenii Stratonikov --- object/convert.go | 195 +++++++++++++++++++++++++--------------------- 1 file changed, 105 insertions(+), 90 deletions(-) diff --git a/object/convert.go b/object/convert.go index 95fde3c..7099b4c 100644 --- a/object/convert.go +++ b/object/convert.go @@ -292,102 +292,26 @@ func (h *Header) FromGRPCMessage(m grpc.Message) error { var err error - version := v.GetVersion() - if version == nil { - h.version = nil - } else { - if h.version == nil { - h.version = new(refs.Version) - } - - err = h.version.FromGRPCMessage(version) - if err != nil { - return err - } + if err := h.fillVersion(v); err != nil { + return err } - - payloadHash := v.GetPayloadHash() - if payloadHash == nil { - h.payloadHash = nil - } else { - if h.payloadHash == nil { - h.payloadHash = new(refs.Checksum) - } - - err = h.payloadHash.FromGRPCMessage(payloadHash) - if err != nil { - return err - } + if err := h.fillPayloadHash(v); err != nil { + return err } - - ownerID := v.GetOwnerId() - if ownerID == nil { - h.ownerID = nil - } else { - if h.ownerID == nil { - h.ownerID = new(refs.OwnerID) - } - - err = h.ownerID.FromGRPCMessage(ownerID) - if err != nil { - return err - } + if err := h.fillOwnerID(v); err != nil { + return err } - - homoHash := v.GetHomomorphicHash() - if homoHash == nil { - h.homoHash = nil - } else { - if h.homoHash == nil { - h.homoHash = new(refs.Checksum) - } - - err = h.homoHash.FromGRPCMessage(homoHash) - if err != nil { - return err - } + if err := h.fillHomomorphicHash(v); err != nil { + return err } - - cid := v.GetContainerId() - if cid == nil { - h.cid = nil - } else { - if h.cid == nil { - h.cid = new(refs.ContainerID) - } - - err = h.cid.FromGRPCMessage(cid) - if err != nil { - return err - } + if err := h.fillContainerID(v); err != nil { + return err } - - sessionToken := v.GetSessionToken() - if sessionToken == nil { - h.sessionToken = nil - } else { - if h.sessionToken == nil { - h.sessionToken = new(session.Token) - } - - err = h.sessionToken.FromGRPCMessage(sessionToken) - if err != nil { - return err - } + if err := h.fillSessionToken(v); err != nil { + return err } - - split := v.GetSplit() - if split == nil { - h.split = nil - } else { - if h.split == nil { - h.split = new(SplitHeader) - } - - err = h.split.FromGRPCMessage(split) - if err != nil { - return err - } + if err := h.fillSplitHeader(v); err != nil { + return err } h.attr, err = AttributesFromGRPC(v.GetAttributes()) @@ -402,6 +326,97 @@ func (h *Header) FromGRPCMessage(m grpc.Message) error { return nil } +func (h *Header) fillVersion(v *object.Header) error { + version := v.GetVersion() + if version == nil { + h.version = nil + return nil + } + + if h.version == nil { + h.version = new(refs.Version) + } + return h.version.FromGRPCMessage(version) +} + +func (h *Header) fillPayloadHash(v *object.Header) error { + payloadHash := v.GetPayloadHash() + if payloadHash == nil { + h.payloadHash = nil + return nil + } + + if h.payloadHash == nil { + h.payloadHash = new(refs.Checksum) + } + return h.payloadHash.FromGRPCMessage(payloadHash) +} + +func (h *Header) fillOwnerID(v *object.Header) error { + ownerID := v.GetOwnerId() + if ownerID == nil { + h.ownerID = nil + return nil + } + + if h.ownerID == nil { + h.ownerID = new(refs.OwnerID) + } + return h.ownerID.FromGRPCMessage(ownerID) +} + +func (h *Header) fillHomomorphicHash(v *object.Header) error { + homoHash := v.GetHomomorphicHash() + if homoHash == nil { + h.homoHash = nil + return nil + } + + if h.homoHash == nil { + h.homoHash = new(refs.Checksum) + } + return h.homoHash.FromGRPCMessage(homoHash) +} + +func (h *Header) fillContainerID(v *object.Header) error { + cid := v.GetContainerId() + if cid == nil { + h.cid = nil + return nil + } + + if h.cid == nil { + h.cid = new(refs.ContainerID) + } + return h.cid.FromGRPCMessage(cid) +} + +func (h *Header) fillSessionToken(v *object.Header) error { + sessionToken := v.GetSessionToken() + if sessionToken == nil { + h.sessionToken = nil + return nil + } + + if h.sessionToken == nil { + h.sessionToken = new(session.Token) + } + return h.sessionToken.FromGRPCMessage(sessionToken) +} + +func (h *Header) fillSplitHeader(v *object.Header) error { + split := v.GetSplit() + if split == nil { + h.split = nil + return nil + } + + if h.split == nil { + h.split = new(SplitHeader) + } + return h.split.FromGRPCMessage(split) +} + func (h *HeaderWithSignature) ToGRPCMessage() grpc.Message { var m *object.HeaderWithSignature From a6e2ab384582fb1182a9dd50d40efebb244023cd Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 3 May 2023 14:04:03 +0300 Subject: [PATCH 038/169] [#27] *: Add linter exceptions Each of these is not easy to do, so add an exeption for now. Signed-off-by: Evgenii Stratonikov --- pkg/tracing/grpc_internal.go | 2 +- rpc/client/call_options.go | 2 +- signature/body.go | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/tracing/grpc_internal.go b/pkg/tracing/grpc_internal.go index 25cf026..847c7ca 100644 --- a/pkg/tracing/grpc_internal.go +++ b/pkg/tracing/grpc_internal.go @@ -124,7 +124,7 @@ func (cs *clientStream) RecvMsg(m interface{}) error { type serverStream struct { originalStream grpc.ServerStream - ctx context.Context + ctx context.Context // nolint:containedctx } func newgRPCServerStream(ctx context.Context, originalStream grpc.ServerStream) grpc.ServerStream { diff --git a/rpc/client/call_options.go b/rpc/client/call_options.go index bf99c92..8134e46 100644 --- a/rpc/client/call_options.go +++ b/rpc/client/call_options.go @@ -8,7 +8,7 @@ import ( type CallOption func(*callParameters) type callParameters struct { - ctx context.Context + ctx context.Context // nolint:containedctx } func defaultCallParameters() *callParameters { diff --git a/signature/body.go b/signature/body.go index a160ed3..f537359 100644 --- a/signature/body.go +++ b/signature/body.go @@ -10,6 +10,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" ) +// nolint:funlen func serviceMessageBody(req interface{}) stableMarshaler { switch v := req.(type) { default: From 2aa3ee46e7ccc55868b9fb06de968cf753719471 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 3 May 2023 14:09:17 +0300 Subject: [PATCH 039/169] [#27] util/signature: Fix staticcheck warning Signed-off-by: Evgenii Stratonikov --- util/signature/buffer.go | 22 +++++++++++++--------- util/signature/data.go | 4 ++-- util/signature/options.go | 8 ++++---- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/util/signature/buffer.go b/util/signature/buffer.go index 2a7f1e0..c2fa855 100644 --- a/util/signature/buffer.go +++ b/util/signature/buffer.go @@ -4,26 +4,30 @@ import "sync" const poolSliceMaxSize = 64 * 1024 +type buffer struct { + data []byte +} + var buffersPool = sync.Pool{ New: func() any { - return make([]byte, 0) + return new(buffer) }, } -func newBufferFromPool(size int) []byte { - result := buffersPool.Get().([]byte) - if cap(result) < size { - result = make([]byte, size) +func newBufferFromPool(size int) *buffer { + result := buffersPool.Get().(*buffer) + if cap(result.data) < size { + result.data = make([]byte, size) } else { - result = result[:size] + result.data = result.data[:size] } return result } -func returnBufferToPool(buf []byte) { - if cap(buf) > poolSliceMaxSize { +func returnBufferToPool(buf *buffer) { + if cap(buf.data) > poolSliceMaxSize { return } - buf = buf[:0] + buf.data = buf.data[:0] buffersPool.Put(buf) } diff --git a/util/signature/data.go b/util/signature/data.go index d2bf1dc..1db46dc 100644 --- a/util/signature/data.go +++ b/util/signature/data.go @@ -38,7 +38,7 @@ func SignDataWithHandler(key *ecdsa.PrivateKey, src DataSource, handler KeySigna buffer := newBufferFromPool(src.SignedDataSize()) defer returnBufferToPool(buffer) - data, err := src.ReadSignedData(buffer) + data, err := src.ReadSignedData(buffer.data) if err != nil { return err } @@ -67,7 +67,7 @@ func VerifyDataWithSource(dataSrc DataSource, sigSrc KeySignatureSource, opts .. buffer := newBufferFromPool(dataSrc.SignedDataSize()) defer returnBufferToPool(buffer) - data, err := dataSrc.ReadSignedData(buffer) + data, err := dataSrc.ReadSignedData(buffer.data) if err != nil { return err } diff --git a/util/signature/options.go b/util/signature/options.go index a8a3522..b9bf68d 100644 --- a/util/signature/options.go +++ b/util/signature/options.go @@ -37,8 +37,8 @@ func verify(cfg *cfg, data []byte, sig *refs.Signature) error { case refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT: buffer := newBufferFromPool(base64.StdEncoding.EncodedLen(len(data))) defer returnBufferToPool(buffer) - base64.StdEncoding.Encode(buffer, data) - if !walletconnect.Verify(pub, buffer, sig.GetSign()) { + base64.StdEncoding.Encode(buffer.data, data) + if !walletconnect.Verify(pub, buffer.data, sig.GetSign()) { return crypto.ErrInvalidSignature } return nil @@ -56,8 +56,8 @@ func sign(cfg *cfg, key *ecdsa.PrivateKey, data []byte) ([]byte, error) { case refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT: buffer := newBufferFromPool(base64.StdEncoding.EncodedLen(len(data))) defer returnBufferToPool(buffer) - base64.StdEncoding.Encode(buffer, data) - return walletconnect.Sign(key, buffer) + base64.StdEncoding.Encode(buffer.data, data) + return walletconnect.Sign(key, buffer.data) default: panic(fmt.Sprintf("unsupported scheme %s", cfg.scheme)) } From e9e7901f67f99998c6082bc46c95f1e652fe19b9 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 3 May 2023 14:09:59 +0300 Subject: [PATCH 040/169] [#27] util/proto: Fix staticcheck warning Signed-off-by: Evgenii Stratonikov --- util/proto/marshal_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index de2b72f..11a4d8f 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -37,8 +37,8 @@ type stableRepPrimitives struct { const ( ENUM_UNKNOWN SomeEnum = 0 - ENUM_POSITIVE = 1 - ENUM_NEGATIVE = -1 + ENUM_POSITIVE SomeEnum = 1 + ENUM_NEGATIVE SomeEnum = -1 ) func (s *stablePrimitives) stableMarshal(buf []byte, wrongField bool) ([]byte, error) { From a3a5046ecc8925150a1cbc7943d58630ff61d9b6 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 15 May 2023 17:25:04 +0300 Subject: [PATCH 041/169] [#28] Replace interface{} with any Signed-off-by: Anton Nikiforov --- pkg/tracing/grpc.go | 6 +++--- pkg/tracing/grpc_internal.go | 8 ++++---- rpc/grpc/init.go | 2 +- rpc/message/message.go | 4 ++-- signature/body.go | 2 +- signature/sign.go | 2 +- signature/verify.go | 2 +- status/test/codes.go | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/tracing/grpc.go b/pkg/tracing/grpc.go index 884ecb2..f0a3473 100644 --- a/pkg/tracing/grpc.go +++ b/pkg/tracing/grpc.go @@ -15,7 +15,7 @@ import ( // NewGRPCUnaryClientInteceptor creates new gRPC unary interceptor to save gRPC client traces. func NewGRPCUnaryClientInteceptor() grpc.UnaryClientInterceptor { - return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { + return func(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { ctx, span := startClientSpan(ctx, cc, method) defer span.End() @@ -74,7 +74,7 @@ func NewGRPCStreamClientInterceptor() grpc.StreamClientInterceptor { // NewGRPCUnaryServerInterceptor creates new gRPC unary interceptor to save gRPC server traces. func NewGRPCUnaryServerInterceptor() grpc.UnaryServerInterceptor { - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { + return func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { ctx = extractGRPCTraceInfo(ctx) var span trace.Span ctx, span = StartSpanFromContext(ctx, info.FullMethod, @@ -94,7 +94,7 @@ func NewGRPCUnaryServerInterceptor() grpc.UnaryServerInterceptor { // NewGRPCStreamServerInterceptor creates new gRPC stream interceptor to save gRPC server traces. func NewGRPCStreamServerInterceptor() grpc.StreamServerInterceptor { - return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + return func(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { ctx := extractGRPCTraceInfo(ss.Context()) var span trace.Span ctx, span = StartSpanFromContext(ctx, info.FullMethod, diff --git a/pkg/tracing/grpc_internal.go b/pkg/tracing/grpc_internal.go index 847c7ca..7c1bfab 100644 --- a/pkg/tracing/grpc_internal.go +++ b/pkg/tracing/grpc_internal.go @@ -100,7 +100,7 @@ func (cs *clientStream) Context() context.Context { return cs.originalStream.Context() } -func (cs *clientStream) SendMsg(m interface{}) error { +func (cs *clientStream) SendMsg(m any) error { err := cs.originalStream.SendMsg(m) if err != nil { select { @@ -111,7 +111,7 @@ func (cs *clientStream) SendMsg(m interface{}) error { return err } -func (cs *clientStream) RecvMsg(m interface{}) error { +func (cs *clientStream) RecvMsg(m any) error { err := cs.originalStream.RecvMsg(m) if err != nil || !cs.desc.ServerStreams { select { @@ -150,10 +150,10 @@ func (ss *serverStream) Context() context.Context { return ss.ctx } -func (ss *serverStream) SendMsg(m interface{}) error { +func (ss *serverStream) SendMsg(m any) error { return ss.originalStream.SendMsg(m) } -func (ss *serverStream) RecvMsg(m interface{}) error { +func (ss *serverStream) RecvMsg(m any) error { return ss.originalStream.RecvMsg(m) } diff --git a/rpc/grpc/init.go b/rpc/grpc/init.go index 79f08c9..0092d39 100644 --- a/rpc/grpc/init.go +++ b/rpc/grpc/init.go @@ -1,4 +1,4 @@ package grpc // Message represents raw gRPC message. -type Message interface{} +type Message any diff --git a/rpc/message/message.go b/rpc/message/message.go index c9b87f0..705270e 100644 --- a/rpc/message/message.go +++ b/rpc/message/message.go @@ -26,12 +26,12 @@ type Message interface { // ErrUnexpectedMessageType is an error that // is used to indicate message mismatch. type ErrUnexpectedMessageType struct { - exp, act interface{} + exp, act any } // NewUnexpectedMessageType initializes an error about message mismatch // between act and exp. -func NewUnexpectedMessageType(act, exp interface{}) ErrUnexpectedMessageType { +func NewUnexpectedMessageType(act, exp any) ErrUnexpectedMessageType { return ErrUnexpectedMessageType{ exp: exp, act: act, diff --git a/signature/body.go b/signature/body.go index f537359..6d43249 100644 --- a/signature/body.go +++ b/signature/body.go @@ -11,7 +11,7 @@ import ( ) // nolint:funlen -func serviceMessageBody(req interface{}) stableMarshaler { +func serviceMessageBody(req any) stableMarshaler { switch v := req.(type) { default: panic(fmt.Sprintf("unsupported session message %T", req)) diff --git a/signature/sign.go b/signature/sign.go index 49343bd..f50d83f 100644 --- a/signature/sign.go +++ b/signature/sign.go @@ -29,7 +29,7 @@ type signatureReceiver interface { } // SignServiceMessage signes service message with key. -func SignServiceMessage(key *ecdsa.PrivateKey, msg interface{}) error { +func SignServiceMessage(key *ecdsa.PrivateKey, msg any) error { switch v := msg.(type) { case nil: return nil diff --git a/signature/verify.go b/signature/verify.go index 67e4a82..7a8ed82 100644 --- a/signature/verify.go +++ b/signature/verify.go @@ -17,7 +17,7 @@ type signatureProvider interface { } // VerifyServiceMessage verifies service message. -func VerifyServiceMessage(msg interface{}) error { +func VerifyServiceMessage(msg any) error { switch v := msg.(type) { case nil: return nil diff --git a/status/test/codes.go b/status/test/codes.go index 3a2e001..b832c87 100644 --- a/status/test/codes.go +++ b/status/test/codes.go @@ -12,7 +12,7 @@ import ( func TestCodes(t *testing.T, localizer func(*status.Code) bool, globalizer func(code *status.Code), - vals ...interface{}, + vals ...any, ) { for i := 0; i < len(vals); i += 2 { c := vals[i].(status.Code) From a3e8e0c00c204e2e33aa1a7717cef1384843b0cf Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 16 May 2023 15:48:40 +0300 Subject: [PATCH 042/169] [#32] client: drop keepalive options Node doesn't use any specific settings, these setting should be provided by the caller. Signed-off-by: Evgenii Stratonikov --- rpc/client/options.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/rpc/client/options.go b/rpc/client/options.go index 005594c..0575dfc 100644 --- a/rpc/client/options.go +++ b/rpc/client/options.go @@ -6,7 +6,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/keepalive" ) const ( @@ -30,9 +29,8 @@ type cfg struct { } const ( - defaultDialTimeout = 5 * time.Second - defaultKeepAliveTimeout = 5 * time.Second - defaultRWTimeout = 1 * time.Minute + defaultDialTimeout = 5 * time.Second + defaultRWTimeout = 1 * time.Minute ) func (c *cfg) initDefault() { @@ -41,9 +39,6 @@ func (c *cfg) initDefault() { c.grpcDialOpts = []grpc.DialOption{ grpc.WithBlock(), grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Timeout: defaultKeepAliveTimeout, - }), } } From eba07dee0ce3509204393fadef2098f4b5c072d5 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 19 May 2023 11:10:54 +0300 Subject: [PATCH 043/169] [#33] go.mod: Update dependencies Signed-off-by: Evgenii Stratonikov --- CHANGELOG.md | 10 +++++++ go.mod | 38 ++++++++++++------------- go.sum | 80 +++++++++++++++++++++++++--------------------------- 3 files changed, 68 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27506b4..887bce5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,16 @@ - Reputation system (#21) ### Updated +- `github.com/stretchr/testify` to `v1.8.3` +- `go.opentelemetry.io/otel` to `v1.15.1` +- `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` to `v1.15.1` +- `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` to `v1.15.1` +- `go.opentelemetry.io/otel/sdk` to `v1.15.1` +- `go.opentelemetry.io/otel/trace` to `v1.15.1` +- `golang.org/x/sync` to `v0.2.0` +- `google.golang.org/grpc` to `v1.55.0` +- `google.golang.org/protobuf` to `v1.30.0` + ## 2.15.0 - 2023-04-11 diff --git a/go.mod b/go.mod index 7a6dc32..45fbfe4 100644 --- a/go.mod +++ b/go.mod @@ -4,33 +4,33 @@ go 1.18 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 - github.com/stretchr/testify v1.8.2 - go.opentelemetry.io/otel v1.14.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 - go.opentelemetry.io/otel/sdk v1.14.0 - go.opentelemetry.io/otel/trace v1.14.0 - golang.org/x/sync v0.1.0 - google.golang.org/grpc v1.53.0 - google.golang.org/protobuf v1.28.1 + github.com/stretchr/testify v1.8.3 + go.opentelemetry.io/otel v1.15.1 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1 + go.opentelemetry.io/otel/sdk v1.15.1 + go.opentelemetry.io/otel/trace v1.15.1 + golang.org/x/sync v0.2.0 + google.golang.org/grpc v1.55.0 + google.golang.org/protobuf v1.30.0 ) require ( git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect - github.com/cenkalti/backoff/v4 v4.2.0 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1 // indirect go.opentelemetry.io/proto/otlp v0.19.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect - google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 0664c0e..5fa3cbc 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= -github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -70,13 +70,13 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -102,8 +102,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -130,8 +131,9 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 h1:gDLXvp5S9izjldquuoAhDzccbskOL6tDC5jMSyx3zxE= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2/go.mod h1:7pdNwVWBBHGiCxa9lAszqCJMbfTISJ7oMftp8+UGV08= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -152,15 +154,11 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -169,20 +167,20 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= -go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 h1:/fXHZHGvro6MVqV34fJzDhi7sHGpX3Ej/Qjmfn003ho= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0/go.mod h1:UFG7EBMRdXyFstOwH028U0sVf+AvukSGhF0g8+dmNG8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 h1:TKf2uAs2ueguzLaxOCBXNpHxfO/aC7PAdDsSH0IbeRQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0/go.mod h1:HrbCVv40OOLTABmOn1ZWty6CHXkU8DK/Urc43tHug70= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 h1:ap+y8RXX3Mu9apKVtOkM6WSFESLM8K3wNQyOU8sWHcc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0/go.mod h1:5w41DY6S9gZrbjuq6Y+753e96WfPha5IcsOSZTtullM= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 h1:sEL90JjOO/4yhquXl5zTAkLLsZ5+MycAgX99SDsxGc8= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0/go.mod h1:oCslUcizYdpKYyS9e8srZEqM6BB8fq41VJBjLAE6z1w= -go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= -go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= -go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= -go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +go.opentelemetry.io/otel v1.15.1 h1:3Iwq3lfRByPaws0f6bU3naAqOR1n5IeDWd9390kWHa8= +go.opentelemetry.io/otel v1.15.1/go.mod h1:mHHGEHVDLal6YrKMmk9LqC4a3sF5g+fHfrttQIB1NTc= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1 h1:XYDQtNzdb2T4uM1pku2m76eSMDJgqhJ+6KzkqgQBALc= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1/go.mod h1:uOTV75+LOzV+ODmL8ahRLWkFA3eQcSC2aAsbxIu4duk= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1 h1:tyoeaUh8REKay72DVYsSEBYV18+fGONe+YYPaOxgLoE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1/go.mod h1:HUSnrjQQ19KX9ECjpQxufsF+3ioD3zISPMlauTPZu2g= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 h1:pIfoG5IAZFzp9EUlJzdSkpUwpaUAAnD+Ru1nBLTACIQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1/go.mod h1:poNKBqF5+nR/6ke2oGTDjHfksrsHDOHXAl2g4+9ONsY= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1 h1:2PunuO5SbkN5MhCbuHCd3tC6qrcaj+uDAkX/qBU5BAs= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1/go.mod h1:q8+Tha+5LThjeSU8BW93uUC5w5/+DnYHMKBMpRCsui0= +go.opentelemetry.io/otel/sdk v1.15.1 h1:5FKR+skgpzvhPQHIEfcwMYjCBr14LWzs3uSqKiQzETI= +go.opentelemetry.io/otel/sdk v1.15.1/go.mod h1:8rVtxQfrbmbHKfqzpQkT5EzZMcbMBwTzNAggbEAM0KA= +go.opentelemetry.io/otel/trace v1.15.1 h1:uXLo6iHJEzDfrNC0L0mNjItIp06SyaBQxu5t3xMlngY= +go.opentelemetry.io/otel/trace v1.15.1/go.mod h1:IWdQG/5N1x7f6YUlmdLeJvH9yxtuJAfc4VW5Agv9r/8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= @@ -249,8 +247,8 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -265,8 +263,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -295,8 +293,8 @@ golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -304,8 +302,8 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -406,8 +404,8 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -424,8 +422,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -439,8 +437,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 33445c6810347c785a82a4e48ed6621193e3b926 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 19 May 2023 14:26:02 +0300 Subject: [PATCH 044/169] [#33] go.mod: move to go1.19 Signed-off-by: Evgenii Stratonikov --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 45fbfe4..8111530 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 -go 1.18 +go 1.19 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 From 0c67b8fefa41581f5948f19ad27319b2429afa32 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 19 May 2023 14:40:17 +0300 Subject: [PATCH 045/169] [#34] tracing: use atomic.Pointer Signed-off-by: Evgenii Stratonikov --- pkg/tracing/setup.go | 4 ++-- pkg/tracing/span.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/tracing/setup.go b/pkg/tracing/setup.go index 3df069e..067dfda 100644 --- a/pkg/tracing/setup.go +++ b/pkg/tracing/setup.go @@ -99,8 +99,8 @@ func Shutdown(ctx context.Context) error { return flushAndShutdown(ctx) } -func getDefaultTracer() *atomic.Value { - v := &atomic.Value{} +func getDefaultTracer() *atomic.Pointer[tracerHolder] { + v := new(atomic.Pointer[tracerHolder]) v.Store(&tracerHolder{Tracer: trace.NewNoopTracerProvider().Tracer("")}) return v } diff --git a/pkg/tracing/span.go b/pkg/tracing/span.go index 5e28c75..1071f47 100644 --- a/pkg/tracing/span.go +++ b/pkg/tracing/span.go @@ -8,5 +8,5 @@ import ( // StartSpanFromContext creates a span and a context.Context containing the newly-created span. func StartSpanFromContext(ctx context.Context, operationName string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { - return tracer.Load().(*tracerHolder).Tracer.Start(ctx, operationName, opts...) + return tracer.Load().Tracer.Start(ctx, operationName, opts...) } From 8266b310929fdb3a2aa5ac114092fe4e3269f340 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 23 May 2023 18:52:57 +0300 Subject: [PATCH 046/169] [#26] netmap: Add NOT and UNIQUE keywords * Regenerate types.pb.go for netmap grpc * Add unique flag to PlacementPolicy struct Signed-off-by: Airat Arifullin a.arifullin@yadro.com --- netmap/grpc/types.pb.go | 151 ++++++++++++++++++++++------------------ netmap/types.go | 13 ++++ 2 files changed, 96 insertions(+), 68 deletions(-) diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index f1d5ef0..9c6c489 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v3.12.4 // source: netmap/grpc/types.proto package netmap @@ -42,6 +42,8 @@ const ( Operation_OR Operation = 7 // Logical AND Operation_AND Operation = 8 + // Logical negation + Operation_NOT Operation = 9 ) // Enum value maps for Operation. @@ -56,6 +58,7 @@ var ( 6: "LE", 7: "OR", 8: "AND", + 9: "NOT", } Operation_value = map[string]int32{ "OPERATION_UNSPECIFIED": 0, @@ -67,6 +70,7 @@ var ( "LE": 6, "OR": 7, "AND": 8, + "NOT": 9, } ) @@ -463,6 +467,8 @@ type PlacementPolicy struct { Selectors []*Selector `protobuf:"bytes,3,rep,name=selectors,proto3" json:"selectors,omitempty"` // List of named filters to reference in selectors Filters []*Filter `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters,omitempty"` + // Unique flag defines non-overlapping application for replicas + Unique bool `protobuf:"varint,5,opt,name=unique,proto3" json:"unique,omitempty"` } func (x *PlacementPolicy) Reset() { @@ -525,6 +531,13 @@ func (x *PlacementPolicy) GetFilters() []*Filter { return nil } +func (x *PlacementPolicy) GetUnique() bool { + if x != nil { + return x.Unique + } + return false +} + // NeoFS node description type NodeInfo struct { state protoimpl.MessageState @@ -1042,7 +1055,7 @@ var file_netmap_grpc_types_proto_rawDesc = []byte{ 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, - 0xee, 0x01, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, + 0x86, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, @@ -1057,71 +1070,73 @@ var file_netmap_grpc_types_proto_rawDesc = []byte{ 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, - 0x22, 0xd8, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, - 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x12, 0x36, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, - 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x4d, 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, 0x12, 0x18, 0x0a, - 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x42, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, - 0x07, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, - 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x22, 0x50, 0x0a, 0x06, 0x4e, - 0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x30, 0x0a, 0x05, 0x6e, - 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x8f, 0x01, - 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x49, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x33, 0x0a, 0x09, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0xbf, 0x01, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x67, 0x69, - 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0c, 0x6d, 0x73, 0x5f, 0x70, 0x65, - 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, - 0x73, 0x50, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x46, 0x0a, 0x0e, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, - 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2a, 0x67, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, - 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10, - 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x54, 0x10, - 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10, - 0x05, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10, - 0x07, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x08, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c, - 0x61, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, - 0x53, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, - 0x43, 0x54, 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, - 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, - 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, - 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x22, 0xd8, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x1a, 0x4d, 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, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, + 0x42, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, + 0x49, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, + 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, + 0x45, 0x10, 0x03, 0x22, 0x50, 0x0a, 0x06, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x14, 0x0a, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x12, 0x30, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, + 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x49, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x1a, 0x33, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, + 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x20, 0x0a, 0x0c, 0x6d, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x73, 0x50, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x46, 0x0a, 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x70, 0x0a, 0x09, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, + 0x02, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x54, 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, + 0x04, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10, 0x05, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, + 0x06, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10, 0x07, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, + 0x10, 0x08, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x4f, 0x54, 0x10, 0x09, 0x2a, 0x38, 0x0a, 0x06, 0x43, + 0x6c, 0x61, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, + 0x04, 0x53, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, + 0x4e, 0x43, 0x54, 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, + 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, + 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, + 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, + 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, + 0x49, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/netmap/types.go b/netmap/types.go index 27fc2ff..aece7cf 100644 --- a/netmap/types.go +++ b/netmap/types.go @@ -55,6 +55,7 @@ type Replica struct { type Operation uint32 type PlacementPolicy struct { + unique bool replicas []Replica backupFactor uint32 selectors []Selector @@ -106,6 +107,7 @@ const ( LE OR AND + NOT ) const ( @@ -257,6 +259,17 @@ func (r *Replica) SetCount(count uint32) { r.count = count } +func (p *PlacementPolicy) GetUnique() bool { + if p != nil { + return p.unique + } + return false +} + +func (p *PlacementPolicy) SetUnique(unique bool) { + p.unique = unique +} + func (p *PlacementPolicy) GetFilters() []Filter { if p != nil { return p.filters From 62edd68f47ac909bbc198a6efbd6c1b885c7ad3d Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 30 May 2023 15:46:58 +0300 Subject: [PATCH 047/169] [#36] tracing: Drop tracing pkg Tracing will be moved to frostfs-observability repo. Signed-off-by: Dmitrii Stepanov --- go.mod | 14 +- go.sum | 416 +-------------------------------- pkg/tracing/config.go | 74 ------ pkg/tracing/config_test.go | 212 ----------------- pkg/tracing/grpc.go | 135 ----------- pkg/tracing/grpc_internal.go | 159 ------------- pkg/tracing/propagator.go | 96 -------- pkg/tracing/propagator_test.go | 257 -------------------- pkg/tracing/setup.go | 156 ------------- pkg/tracing/span.go | 12 - rpc/client/client.go | 10 - 11 files changed, 4 insertions(+), 1537 deletions(-) delete mode 100644 pkg/tracing/config.go delete mode 100644 pkg/tracing/config_test.go delete mode 100644 pkg/tracing/grpc.go delete mode 100644 pkg/tracing/grpc_internal.go delete mode 100644 pkg/tracing/propagator.go delete mode 100644 pkg/tracing/propagator_test.go delete mode 100644 pkg/tracing/setup.go delete mode 100644 pkg/tracing/span.go diff --git a/go.mod b/go.mod index 8111530..f7eedf6 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,6 @@ go 1.19 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 github.com/stretchr/testify v1.8.3 - go.opentelemetry.io/otel v1.15.1 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1 - go.opentelemetry.io/otel/sdk v1.15.1 - go.opentelemetry.io/otel/trace v1.15.1 golang.org/x/sync v0.2.0 google.golang.org/grpc v1.55.0 google.golang.org/protobuf v1.30.0 @@ -17,20 +12,15 @@ require ( require ( git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect - github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-logr/logr v1.2.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect + github.com/kr/pretty v0.1.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1 // indirect - go.opentelemetry.io/proto/otlp v0.19.0 // indirect golang.org/x/net v0.10.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 5fa3cbc..bb23dce 100644 --- a/go.sum +++ b/go.sum @@ -1,145 +1,15 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0/go.mod h1:RUIKZATQLJ+TaYQa60X2fTDwfuhMfm8Ar60bQ5fr+vU= git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9mwVfJ+SjT3HA= git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 h1:gDLXvp5S9izjldquuoAhDzccbskOL6tDC5jMSyx3zxE= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2/go.mod h1:7pdNwVWBBHGiCxa9lAszqCJMbfTISJ7oMftp8+UGV08= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -149,312 +19,30 @@ github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.15.1 h1:3Iwq3lfRByPaws0f6bU3naAqOR1n5IeDWd9390kWHa8= -go.opentelemetry.io/otel v1.15.1/go.mod h1:mHHGEHVDLal6YrKMmk9LqC4a3sF5g+fHfrttQIB1NTc= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1 h1:XYDQtNzdb2T4uM1pku2m76eSMDJgqhJ+6KzkqgQBALc= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1/go.mod h1:uOTV75+LOzV+ODmL8ahRLWkFA3eQcSC2aAsbxIu4duk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1 h1:tyoeaUh8REKay72DVYsSEBYV18+fGONe+YYPaOxgLoE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1/go.mod h1:HUSnrjQQ19KX9ECjpQxufsF+3ioD3zISPMlauTPZu2g= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 h1:pIfoG5IAZFzp9EUlJzdSkpUwpaUAAnD+Ru1nBLTACIQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1/go.mod h1:poNKBqF5+nR/6ke2oGTDjHfksrsHDOHXAl2g4+9ONsY= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1 h1:2PunuO5SbkN5MhCbuHCd3tC6qrcaj+uDAkX/qBU5BAs= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1/go.mod h1:q8+Tha+5LThjeSU8BW93uUC5w5/+DnYHMKBMpRCsui0= -go.opentelemetry.io/otel/sdk v1.15.1 h1:5FKR+skgpzvhPQHIEfcwMYjCBr14LWzs3uSqKiQzETI= -go.opentelemetry.io/otel/sdk v1.15.1/go.mod h1:8rVtxQfrbmbHKfqzpQkT5EzZMcbMBwTzNAggbEAM0KA= -go.opentelemetry.io/otel/trace v1.15.1 h1:uXLo6iHJEzDfrNC0L0mNjItIp06SyaBQxu5t3xMlngY= -go.opentelemetry.io/otel/trace v1.15.1/go.mod h1:IWdQG/5N1x7f6YUlmdLeJvH9yxtuJAfc4VW5Agv9r/8= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= -go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/pkg/tracing/config.go b/pkg/tracing/config.go deleted file mode 100644 index 001953a..0000000 --- a/pkg/tracing/config.go +++ /dev/null @@ -1,74 +0,0 @@ -package tracing - -import "fmt" - -// Exporter is type of tracing target. -type Exporter string - -const ( - Stdout Exporter = "stdout" - OTLPgRPC Exporter = "otlp_grpc" -) - -type Config struct { - // Enabled is true, if tracing enabled. - Enabled bool - // Exporter is collector type. - Exporter Exporter - // Endpoint is collector endpoint for OTLP exporters. - Endpoint string - - // Service is service name that will be used in tracing. - // Mandatory. - Service string - // InstanceID is identity of service instance. - // Optional. - InstanceID string - // Version is version of service instance. - // Optional. - Version string -} - -func (c *Config) validate() error { - if !c.Enabled { - return nil - } - - if c.Exporter != Stdout && c.Exporter != OTLPgRPC { - return fmt.Errorf("tracing config error: unknown exporter '%s', valid values are %v", - c.Exporter, []string{string(Stdout), string(OTLPgRPC)}) - } - - if len(c.Service) == 0 { - return fmt.Errorf("tracing config error: service name must be specified") - } - - if c.Exporter == OTLPgRPC && len(c.Endpoint) == 0 { - return fmt.Errorf("tracing config error: exporter '%s' requires endpoint", c.Exporter) - } - - return nil -} - -func (c *Config) hasChange(other *Config) bool { - if !c.Enabled && !other.Enabled { - return false - } - if c.Enabled != other.Enabled { - return true - } - - if c.Exporter == Stdout && other.Exporter == Stdout { - return !c.serviceInfoEqual(other) - } - - return c.Exporter != other.Exporter || - c.Endpoint != other.Endpoint || - !c.serviceInfoEqual(other) -} - -func (c *Config) serviceInfoEqual(other *Config) bool { - return c.Service == other.Service && - c.InstanceID == other.InstanceID && - c.Version == other.Version -} diff --git a/pkg/tracing/config_test.go b/pkg/tracing/config_test.go deleted file mode 100644 index 031dd3b..0000000 --- a/pkg/tracing/config_test.go +++ /dev/null @@ -1,212 +0,0 @@ -package tracing - -import ( - "testing" -) - -func TestConfig_validate(t *testing.T) { - tests := []struct { - name string - config Config - wantErr bool - }{ - { - name: "disabled", - wantErr: false, - config: Config{ - Enabled: false, - }, - }, - { - name: "stdout", - wantErr: false, - config: Config{ - Enabled: true, - Exporter: Stdout, - Service: "test", - InstanceID: "s01", - Version: "v0.0.1", - }, - }, - { - name: "OTLP gRPC", - wantErr: false, - config: Config{ - Enabled: true, - Exporter: OTLPgRPC, - Service: "test", - Endpoint: "localhost:4717", - InstanceID: "s01", - Version: "v0.0.1", - }, - }, - { - name: "unknown exporter", - wantErr: true, - config: Config{ - Enabled: true, - Exporter: "unknown", - Service: "test", - Endpoint: "localhost:4717", - InstanceID: "s01", - Version: "v0.0.1", - }, - }, - { - name: "no exporter", - wantErr: true, - config: Config{ - Enabled: true, - Service: "test", - Endpoint: "localhost:4717", - InstanceID: "s01", - Version: "v0.0.1", - }, - }, - { - name: "no service", - wantErr: true, - config: Config{ - Enabled: true, - Exporter: OTLPgRPC, - Endpoint: "localhost:4717", - InstanceID: "s01", - Version: "v0.0.1", - }, - }, - { - name: "no endpoint for grpc", - wantErr: true, - config: Config{ - Enabled: true, - Exporter: OTLPgRPC, - Service: "test", - InstanceID: "s01", - Version: "v0.0.1", - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if err := tt.config.validate(); (err != nil) != tt.wantErr { - t.Errorf("Config.validate() error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} - -func TestConfig_hasChange(t *testing.T) { - tests := []struct { - name string - config Config - other Config - want bool - }{ - { - name: "disabled configs always equal", - want: false, - config: Config{ - Enabled: false, - Exporter: Stdout, - Service: "test", - InstanceID: "s01", - Version: "v1.0.0", - }, - other: Config{ - Enabled: false, - Exporter: OTLPgRPC, - Endpoint: "localhost:4717", - Service: "test", - InstanceID: "s01", - Version: "v1.0.0", - }, - }, - { - name: "enabled", - want: true, - config: Config{ - Enabled: false, - Exporter: OTLPgRPC, - Endpoint: "localhost:4717", - Service: "test", - InstanceID: "s01", - Version: "v1.0.0", - }, - other: Config{ - Enabled: true, - Exporter: OTLPgRPC, - Endpoint: "localhost:4717", - Service: "test", - InstanceID: "s01", - Version: "v1.0.0", - }, - }, - { - name: "disabled", - want: true, - config: Config{ - Enabled: true, - Exporter: OTLPgRPC, - Endpoint: "localhost:4717", - Service: "test", - InstanceID: "s01", - Version: "v1.0.0", - }, - other: Config{ - Enabled: false, - Exporter: OTLPgRPC, - Endpoint: "localhost:4717", - Service: "test", - InstanceID: "s01", - Version: "v1.0.0", - }, - }, - { - name: "do not use endpoint for stdout", - want: false, - config: Config{ - Enabled: true, - Exporter: Stdout, - Endpoint: "localhost:4717", - Service: "test", - InstanceID: "s01", - Version: "v1.0.0", - }, - other: Config{ - Enabled: true, - Exporter: Stdout, - Endpoint: "otherhost:4717", - Service: "test", - InstanceID: "s01", - Version: "v1.0.0", - }, - }, - { - name: "use endpoint for grpc", - want: true, - config: Config{ - Enabled: true, - Exporter: OTLPgRPC, - Endpoint: "localhost:4717", - Service: "test", - InstanceID: "s01", - Version: "v1.0.0", - }, - other: Config{ - Enabled: true, - Exporter: OTLPgRPC, - Endpoint: "otherhost:4717", - Service: "test", - InstanceID: "s01", - Version: "v1.0.0", - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := tt.config.hasChange(&tt.other); got != tt.want { - t.Errorf("Config.equal() = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/pkg/tracing/grpc.go b/pkg/tracing/grpc.go deleted file mode 100644 index f0a3473..0000000 --- a/pkg/tracing/grpc.go +++ /dev/null @@ -1,135 +0,0 @@ -package tracing - -import ( - "context" - "io" - - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.17.0" - "go.opentelemetry.io/otel/trace" - "google.golang.org/grpc" - grpc_codes "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// NewGRPCUnaryClientInteceptor creates new gRPC unary interceptor to save gRPC client traces. -func NewGRPCUnaryClientInteceptor() grpc.UnaryClientInterceptor { - return func(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { - ctx, span := startClientSpan(ctx, cc, method) - defer span.End() - - err := invoker(ctx, method, req, reply, cc, opts...) - if err != nil { - grpcStatus, _ := status.FromError(err) - span.SetStatus(codes.Error, grpcStatus.Message()) - span.SetAttributes(semconv.RPCGRPCStatusCodeKey.Int64(int64(grpcStatus.Code()))) - } else { - span.SetStatus(codes.Ok, "") - span.SetAttributes(semconv.RPCGRPCStatusCodeKey.Int64(int64(grpc_codes.OK))) - } - - return err - } -} - -// NewGRPCStreamClientInterceptor creates new gRPC stream interceptor to save gRPC client traces. -func NewGRPCStreamClientInterceptor() grpc.StreamClientInterceptor { - return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { - ctx, span := startClientSpan(ctx, cc, method) - str, err := streamer(ctx, desc, cc, method, opts...) - if err != nil { - grpcStatus, _ := status.FromError(err) - span.SetStatus(codes.Error, grpcStatus.Message()) - span.SetAttributes(semconv.RPCGRPCStatusCodeKey.Int64(int64(grpcStatus.Code()))) - span.End() - return str, err - } - - finished := make(chan error) - done := make(chan struct{}) - strWrp := newgRPCClientStream(str, desc, finished, done) - - go func() { - defer close(done) - defer span.End() - - select { - case err := <-finished: - if err == nil || err == io.EOF { - setGRPCSpanStatus(span, nil) - } else { - setGRPCSpanStatus(span, err) - } - return - case <-ctx.Done(): - setGRPCSpanStatus(span, ctx.Err()) - return - } - }() - - return strWrp, nil - } -} - -// NewGRPCUnaryServerInterceptor creates new gRPC unary interceptor to save gRPC server traces. -func NewGRPCUnaryServerInterceptor() grpc.UnaryServerInterceptor { - return func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { - ctx = extractGRPCTraceInfo(ctx) - var span trace.Span - ctx, span = StartSpanFromContext(ctx, info.FullMethod, - trace.WithAttributes( - semconv.RPCSystemGRPC, - semconv.RPCMethod(info.FullMethod), - ), - trace.WithSpanKind(trace.SpanKindServer)) - defer span.End() - - resp, err = handler(ctx, req) - - setGRPCSpanStatus(span, err) - return - } -} - -// NewGRPCStreamServerInterceptor creates new gRPC stream interceptor to save gRPC server traces. -func NewGRPCStreamServerInterceptor() grpc.StreamServerInterceptor { - return func(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - ctx := extractGRPCTraceInfo(ss.Context()) - var span trace.Span - ctx, span = StartSpanFromContext(ctx, info.FullMethod, - trace.WithAttributes( - semconv.RPCSystemGRPC, - semconv.RPCMethod(info.FullMethod), - ), - trace.WithSpanKind(trace.SpanKindServer)) - defer span.End() - - err := handler(srv, newgRPCServerStream(ctx, ss)) - - setGRPCSpanStatus(span, err) - return err - } -} - -func startClientSpan(ctx context.Context, cc *grpc.ClientConn, method string) (context.Context, trace.Span) { - ctx, span := StartSpanFromContext(ctx, method, trace.WithAttributes( - semconv.RPCSystemGRPC, - semconv.RPCMethod(method), - attribute.String("rpc.grpc.target", cc.Target())), - trace.WithSpanKind(trace.SpanKindClient), - ) - ctx = setGRPCTraceInfo(ctx) - return ctx, span -} - -func setGRPCSpanStatus(span trace.Span, err error) { - if err != nil { - grpcStatus, _ := status.FromError(err) - span.SetStatus(codes.Error, grpcStatus.Message()) - span.SetAttributes(semconv.RPCGRPCStatusCodeKey.Int64(int64(grpcStatus.Code()))) - } else { - span.SetStatus(codes.Ok, "") - span.SetAttributes(semconv.RPCGRPCStatusCodeKey.Int64(int64(grpc_codes.OK))) - } -} diff --git a/pkg/tracing/grpc_internal.go b/pkg/tracing/grpc_internal.go deleted file mode 100644 index 7c1bfab..0000000 --- a/pkg/tracing/grpc_internal.go +++ /dev/null @@ -1,159 +0,0 @@ -package tracing - -import ( - "context" - - "google.golang.org/grpc" - "google.golang.org/grpc/metadata" -) - -type grpcMetadataCarrier struct { - md *metadata.MD -} - -func (c *grpcMetadataCarrier) Get(key string) string { - values := c.md.Get(key) - if len(values) > 0 { - return values[0] - } - return "" -} - -func (c *grpcMetadataCarrier) Set(key string, value string) { - c.md.Set(key, value) -} - -func (c *grpcMetadataCarrier) Keys() []string { - result := make([]string, 0, c.md.Len()) - for key := range *c.md { - result = append(result, key) - } - return result -} - -func extractGRPCTraceInfo(ctx context.Context) context.Context { - md, ok := metadata.FromIncomingContext(ctx) - if !ok { - return ctx - } - carrier := &grpcMetadataCarrier{ - md: &md, - } - return Propagator.Extract(ctx, carrier) -} - -func setGRPCTraceInfo(ctx context.Context) context.Context { - md, ok := metadata.FromOutgoingContext(ctx) - if !ok { - md = metadata.MD{} - } - carrier := &grpcMetadataCarrier{ - md: &md, - } - Propagator.Inject(ctx, carrier) - return metadata.NewOutgoingContext(ctx, md) -} - -type clientStream struct { - originalStream grpc.ClientStream - desc *grpc.StreamDesc - finished chan<- error - done <-chan struct{} -} - -func newgRPCClientStream(originalStream grpc.ClientStream, desc *grpc.StreamDesc, finished chan<- error, done <-chan struct{}) grpc.ClientStream { - return &clientStream{ - originalStream: originalStream, - desc: desc, - finished: finished, - done: done, - } -} - -func (cs *clientStream) Header() (metadata.MD, error) { - md, err := cs.originalStream.Header() - if err != nil { - select { - case <-cs.done: - case cs.finished <- err: - } - } - return md, err -} - -func (cs *clientStream) Trailer() metadata.MD { - return cs.originalStream.Trailer() -} - -func (cs *clientStream) CloseSend() error { - err := cs.originalStream.CloseSend() - if err != nil { - select { - case <-cs.done: - case cs.finished <- err: - } - } - return err -} - -func (cs *clientStream) Context() context.Context { - return cs.originalStream.Context() -} - -func (cs *clientStream) SendMsg(m any) error { - err := cs.originalStream.SendMsg(m) - if err != nil { - select { - case <-cs.done: - case cs.finished <- err: - } - } - return err -} - -func (cs *clientStream) RecvMsg(m any) error { - err := cs.originalStream.RecvMsg(m) - if err != nil || !cs.desc.ServerStreams { - select { - case <-cs.done: - case cs.finished <- err: - } - } - return err -} - -type serverStream struct { - originalStream grpc.ServerStream - ctx context.Context // nolint:containedctx -} - -func newgRPCServerStream(ctx context.Context, originalStream grpc.ServerStream) grpc.ServerStream { - return &serverStream{ - originalStream: originalStream, - ctx: ctx, - } -} - -func (ss *serverStream) SetHeader(md metadata.MD) error { - return ss.originalStream.SendHeader(md) -} - -func (ss *serverStream) SendHeader(md metadata.MD) error { - return ss.originalStream.SendHeader(md) -} - -func (ss *serverStream) SetTrailer(md metadata.MD) { - ss.originalStream.SetTrailer(md) -} - -func (ss *serverStream) Context() context.Context { - return ss.ctx -} - -func (ss *serverStream) SendMsg(m any) error { - return ss.originalStream.SendMsg(m) -} - -func (ss *serverStream) RecvMsg(m any) error { - return ss.originalStream.RecvMsg(m) -} diff --git a/pkg/tracing/propagator.go b/pkg/tracing/propagator.go deleted file mode 100644 index 3dabfdc..0000000 --- a/pkg/tracing/propagator.go +++ /dev/null @@ -1,96 +0,0 @@ -package tracing - -import ( - "context" - "fmt" - "strconv" - - "go.opentelemetry.io/otel/propagation" - "go.opentelemetry.io/otel/trace" -) - -const ( - traceIDHeader = "x-frostfs-trace-id" - spanIDHeader = "x-frostfs-span-id" - flagsHeader = "x-frostfs-trace-flags" -) - -const ( - flagsSampled = 1 << iota -) - -// propagator serializes SpanContext to/from headers. -// x-frostfs-trace-id - TraceID, 16 bytes, hex-string (32 bytes). -// x-frostfs-span-id - SpanID, 8 bytes, hexstring (16 bytes). -// x-frostfs-trace-flags - trace flags (now sampled only). -type propagator struct{} - -// Propagator is propagation.TextMapPropagator instance, used to extract/inject trace info from/to remote context. -var Propagator propagation.TextMapPropagator = &propagator{} - -// Inject injects tracing info to carrier. -func (p *propagator) Inject(ctx context.Context, carrier propagation.TextMapCarrier) { - sc := trace.SpanFromContext(ctx).SpanContext() - if !sc.TraceID().IsValid() || !sc.SpanID().IsValid() { - return - } - - var flags int - if sc.IsSampled() { - flags = flags | flagsSampled - } - - carrier.Set(traceIDHeader, sc.TraceID().String()) - carrier.Set(spanIDHeader, sc.SpanID().String()) - carrier.Set(flagsHeader, fmt.Sprintf("%x", flags)) -} - -// Extract extracts tracing info from carrier and returns context with tracing info. -// In case of error returns ctx. -func (p *propagator) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context { - spanConfig := trace.SpanContextConfig{} - var err error - - traceIDStr := carrier.Get(traceIDHeader) - traceIDDefined := false - if traceIDStr != "" { - traceIDDefined = true - spanConfig.TraceID, err = trace.TraceIDFromHex(traceIDStr) - if err != nil { - return ctx - } - } - - spanIDstr := carrier.Get(spanIDHeader) - spanIDDefined := false - if spanIDstr != "" { - spanIDDefined = true - spanConfig.SpanID, err = trace.SpanIDFromHex(spanIDstr) - if err != nil { - return ctx - } - } - - if traceIDDefined != spanIDDefined { - return ctx //traceID + spanID must be defined OR no traceID and no spanID - } - - flagsStr := carrier.Get(flagsHeader) - if flagsStr != "" { - var v int64 - v, err = strconv.ParseInt(flagsStr, 16, 32) - if err != nil { - return ctx - } - if v&flagsSampled == flagsSampled { - spanConfig.TraceFlags = trace.FlagsSampled - } - } - - return trace.ContextWithRemoteSpanContext(ctx, trace.NewSpanContext(spanConfig)) -} - -// Fields returns the keys whose values are set with Inject. -func (p *propagator) Fields() []string { - return []string{traceIDHeader, spanIDHeader, flagsHeader} -} diff --git a/pkg/tracing/propagator_test.go b/pkg/tracing/propagator_test.go deleted file mode 100644 index fc81e48..0000000 --- a/pkg/tracing/propagator_test.go +++ /dev/null @@ -1,257 +0,0 @@ -package tracing - -import ( - "context" - "encoding/hex" - "math/rand" - "testing" - - "github.com/stretchr/testify/require" - "go.opentelemetry.io/otel/trace" -) - -type testCarrier struct { - Values map[string]string -} - -func (c *testCarrier) Get(key string) string { - return c.Values[key] -} - -func (c *testCarrier) Set(key string, value string) { - c.Values[key] = value -} - -func (c *testCarrier) Keys() []string { - res := make([]string, 0, len(c.Values)) - for k := range c.Values { - res = append(res, k) - } - return res -} - -var p = &propagator{} - -func TestPropagator_Inject(t *testing.T) { - t.Run("injects trace_id and span_id if valid", func(t *testing.T) { - traceIDBytes := make([]byte, 16) - rand.Read(traceIDBytes) - traceIDHex := hex.EncodeToString(traceIDBytes) - - spanIDBytes := make([]byte, 8) - rand.Read(spanIDBytes) - spanIDHex := hex.EncodeToString(spanIDBytes) - - spanConfig := trace.SpanContextConfig{} - spanConfig.TraceID, _ = trace.TraceIDFromHex(traceIDHex) - spanConfig.SpanID, _ = trace.SpanIDFromHex(spanIDHex) - spanConfig.TraceFlags = trace.FlagsSampled - - ctx := trace.ContextWithRemoteSpanContext(context.Background(), trace.NewSpanContext(spanConfig)) - c := &testCarrier{ - Values: make(map[string]string), - } - p.Inject(ctx, c) - - require.Equal(t, 3, len(c.Values), "not all headers were saved") - require.Equal(t, traceIDHex, c.Values[traceIDHeader], "unexpected trace id") - require.Equal(t, spanIDHex, c.Values[spanIDHeader], "unexpected span id") - require.Equal(t, "1", c.Values[flagsHeader], "unexpected flags") - }) - t.Run("doesn't injects if trace_id is invalid", func(t *testing.T) { - traceIDBytes := make([]byte, 16) - traceIDHex := hex.EncodeToString(traceIDBytes) - - spanIDBytes := make([]byte, 8) - rand.Read(spanIDBytes) - spanIDHex := hex.EncodeToString(spanIDBytes) - - spanConfig := trace.SpanContextConfig{} - spanConfig.TraceID, _ = trace.TraceIDFromHex(traceIDHex) - spanConfig.SpanID, _ = trace.SpanIDFromHex(spanIDHex) - spanConfig.TraceFlags = trace.FlagsSampled - - ctx := trace.ContextWithRemoteSpanContext(context.Background(), trace.NewSpanContext(spanConfig)) - c := &testCarrier{ - Values: make(map[string]string), - } - p.Inject(ctx, c) - - require.Equal(t, 0, len(c.Values), "some headers were saved") - }) - t.Run("doesn't injects if span_id is invalid", func(t *testing.T) { - traceIDBytes := make([]byte, 16) - rand.Read(traceIDBytes) - traceIDHex := hex.EncodeToString(traceIDBytes) - - spanIDBytes := make([]byte, 8) - spanIDHex := hex.EncodeToString(spanIDBytes) - - spanConfig := trace.SpanContextConfig{} - spanConfig.TraceID, _ = trace.TraceIDFromHex(traceIDHex) - spanConfig.SpanID, _ = trace.SpanIDFromHex(spanIDHex) - spanConfig.TraceFlags = trace.FlagsSampled - - ctx := trace.ContextWithRemoteSpanContext(context.Background(), trace.NewSpanContext(spanConfig)) - c := &testCarrier{ - Values: make(map[string]string), - } - p.Inject(ctx, c) - - require.Equal(t, 0, len(c.Values), "some headers were saved") - }) - t.Run("injects flags if no flags specified", func(t *testing.T) { - traceIDBytes := make([]byte, 16) - rand.Read(traceIDBytes) - traceIDHex := hex.EncodeToString(traceIDBytes) - - spanIDBytes := make([]byte, 8) - rand.Read(spanIDBytes) - spanIDHex := hex.EncodeToString(spanIDBytes) - - spanConfig := trace.SpanContextConfig{} - spanConfig.TraceID, _ = trace.TraceIDFromHex(traceIDHex) - spanConfig.SpanID, _ = trace.SpanIDFromHex(spanIDHex) - - ctx := trace.ContextWithRemoteSpanContext(context.Background(), trace.NewSpanContext(spanConfig)) - c := &testCarrier{ - Values: make(map[string]string), - } - p.Inject(ctx, c) - - require.Equal(t, 3, len(c.Values), "not all headers were saved") - require.Equal(t, traceIDHex, c.Values[traceIDHeader], "unexpected trace id") - require.Equal(t, spanIDHex, c.Values[spanIDHeader], "unexpected span id") - require.Equal(t, "0", c.Values[flagsHeader], "unexpected flags") - }) - -} - -func TestPropagator_Extract(t *testing.T) { - t.Run("extracts if set", func(t *testing.T) { - c := &testCarrier{ - Values: make(map[string]string), - } - - traceIDBytes := make([]byte, 16) - rand.Read(traceIDBytes) - traceIDHex := hex.EncodeToString(traceIDBytes) - c.Values[traceIDHeader] = traceIDHex - - spanIDBytes := make([]byte, 8) - rand.Read(spanIDBytes) - spanIDHex := hex.EncodeToString(spanIDBytes) - c.Values[spanIDHeader] = spanIDHex - - c.Values[flagsHeader] = "1" - - ctx := p.Extract(context.Background(), c) - - sc := trace.SpanFromContext(ctx).SpanContext() - require.True(t, sc.HasTraceID(), "trace_id was not set") - require.Equal(t, traceIDHex, sc.TraceID().String(), "trace_id doesn't match") - require.True(t, sc.HasSpanID(), "span_id was not set") - require.Equal(t, spanIDHex, sc.SpanID().String(), "span_id doesn't match") - require.True(t, sc.IsSampled(), "sampled was not set") - }) - t.Run("not extracts if only trace_id defined", func(t *testing.T) { - c := &testCarrier{ - Values: make(map[string]string), - } - - traceIDBytes := make([]byte, 16) - rand.Read(traceIDBytes) - traceIDHex := hex.EncodeToString(traceIDBytes) - c.Values[traceIDHeader] = traceIDHex - c.Values[flagsHeader] = "1" - - ctx := p.Extract(context.Background(), c) - - sc := trace.SpanFromContext(ctx).SpanContext() - require.False(t, sc.HasTraceID(), "trace_id was set") - require.False(t, sc.HasSpanID(), "span_id was set") - require.False(t, sc.IsSampled(), "sampled was set") - }) - t.Run("not extracts if only span_id defined", func(t *testing.T) { - c := &testCarrier{ - Values: make(map[string]string), - } - - spanIDBytes := make([]byte, 8) - rand.Read(spanIDBytes) - spanIDHex := hex.EncodeToString(spanIDBytes) - c.Values[spanIDHeader] = spanIDHex - c.Values[flagsHeader] = "1" - - ctx := p.Extract(context.Background(), c) - - sc := trace.SpanFromContext(ctx).SpanContext() - require.False(t, sc.HasTraceID(), "trace_id was set") - require.False(t, sc.HasSpanID(), "span_id was set") - require.False(t, sc.IsSampled(), "sampled was set") - }) - t.Run("not extracts if trace_id is in invalid", func(t *testing.T) { - c := &testCarrier{ - Values: make(map[string]string), - } - - c.Values[traceIDHeader] = "loren ipsum" - - spanIDBytes := make([]byte, 8) - rand.Read(spanIDBytes) - spanIDHex := hex.EncodeToString(spanIDBytes) - c.Values[spanIDHeader] = spanIDHex - c.Values[flagsHeader] = "1" - - ctx := p.Extract(context.Background(), c) - - sc := trace.SpanFromContext(ctx).SpanContext() - require.False(t, sc.HasTraceID(), "trace_id was set") - require.False(t, sc.HasSpanID(), "span_id was set") - require.False(t, sc.IsSampled(), "sampled was set") - }) - t.Run("not extracts if span_id is invalid", func(t *testing.T) { - c := &testCarrier{ - Values: make(map[string]string), - } - - c.Values[spanIDHeader] = "loren ipsum" - - traceIDBytes := make([]byte, 16) - rand.Read(traceIDBytes) - traceIDHex := hex.EncodeToString(traceIDBytes) - c.Values[traceIDHeader] = traceIDHex - c.Values[flagsHeader] = "1" - - ctx := p.Extract(context.Background(), c) - - sc := trace.SpanFromContext(ctx).SpanContext() - require.False(t, sc.HasTraceID(), "trace_id was set") - require.False(t, sc.HasSpanID(), "span_id was set") - require.False(t, sc.IsSampled(), "sampled was set") - }) - t.Run("not extracts if flags is invalid", func(t *testing.T) { - c := &testCarrier{ - Values: make(map[string]string), - } - - traceIDBytes := make([]byte, 16) - rand.Read(traceIDBytes) - traceIDHex := hex.EncodeToString(traceIDBytes) - c.Values[traceIDHeader] = traceIDHex - - spanIDBytes := make([]byte, 8) - rand.Read(spanIDBytes) - spanIDHex := hex.EncodeToString(spanIDBytes) - c.Values[spanIDHeader] = spanIDHex - - c.Values[flagsHeader] = "loren ipsum" - - ctx := p.Extract(context.Background(), c) - - sc := trace.SpanFromContext(ctx).SpanContext() - require.False(t, sc.HasTraceID(), "trace_id was set") - require.False(t, sc.HasSpanID(), "span_id was set") - require.False(t, sc.IsSampled(), "sampled was set") - }) -} diff --git a/pkg/tracing/setup.go b/pkg/tracing/setup.go deleted file mode 100644 index 067dfda..0000000 --- a/pkg/tracing/setup.go +++ /dev/null @@ -1,156 +0,0 @@ -package tracing - -import ( - "context" - "fmt" - "sync" - "sync/atomic" - - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" - "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" - "go.opentelemetry.io/otel/sdk/resource" - sdktrace "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.17.0" - "go.opentelemetry.io/otel/trace" -) - -var ( - // tracingLock protects provider, done, config and tracer from concurrent update. - // These fields change when the config is updated or the application is shutdown. - tracingLock = &sync.Mutex{} - - provider *sdktrace.TracerProvider - done bool - - config = Config{} - tracer = getDefaultTracer() -) - -// Setup initializes global tracer. -// Returns true if global tracer was updated. -// Shutdown method must be called for graceful shutdown. -func Setup(ctx context.Context, cfg Config) (bool, error) { - if err := cfg.validate(); err != nil { - return false, err - } - - tracingLock.Lock() - defer tracingLock.Unlock() - - if done { - return false, fmt.Errorf("failed to setup tracing: already shutdown") - } - - if !config.hasChange(&cfg) { - return false, nil - } - - if !cfg.Enabled { - config = cfg - tracer.Store(&tracerHolder{Tracer: trace.NewNoopTracerProvider().Tracer("")}) - return true, flushAndShutdown(ctx) - } - - exp, err := getExporter(ctx, &cfg) - if err != nil { - return false, err - } - - prevProvider := provider - - provider = sdktrace.NewTracerProvider( - sdktrace.WithBatcher(exp), - sdktrace.WithResource(newResource(&cfg)), - ) - - config = cfg - tracer.Store(&tracerHolder{Tracer: provider.Tracer(cfg.Service)}) - - var retErr error - if prevProvider != nil { - retErr = prevProvider.ForceFlush(ctx) - if err := prevProvider.Shutdown(ctx); err != nil { - if retErr == nil { - retErr = err - } else { - retErr = fmt.Errorf("%v ; %v", retErr, err) - } - } - } - - return true, retErr -} - -// Shutdown shutdowns tracing. -func Shutdown(ctx context.Context) error { - tracingLock.Lock() - defer tracingLock.Unlock() - - if done { - return nil - } - - done = true - - config = Config{} - tracer.Store(&tracerHolder{Tracer: trace.NewNoopTracerProvider().Tracer("")}) - - return flushAndShutdown(ctx) -} - -func getDefaultTracer() *atomic.Pointer[tracerHolder] { - v := new(atomic.Pointer[tracerHolder]) - v.Store(&tracerHolder{Tracer: trace.NewNoopTracerProvider().Tracer("")}) - return v -} - -func flushAndShutdown(ctx context.Context) error { - if provider == nil { - return nil - } - - tmp := provider - provider = nil - var retErr error - retErr = tmp.ForceFlush(ctx) - if err := tmp.Shutdown(ctx); err != nil { - if retErr == nil { - retErr = err - } else { - retErr = fmt.Errorf("%v ; %v", retErr, err) - } - } - return retErr -} - -func getExporter(ctx context.Context, cfg *Config) (sdktrace.SpanExporter, error) { - switch cfg.Exporter { - default: - return nil, fmt.Errorf("failed to setup tracing: unknown tracing exporter (%s)", cfg.Exporter) - case Stdout: - return stdouttrace.New() - case OTLPgRPC: - return otlptracegrpc.New(ctx, otlptracegrpc.WithEndpoint(cfg.Endpoint), otlptracegrpc.WithInsecure()) - } -} - -func newResource(cfg *Config) *resource.Resource { - attrs := []attribute.KeyValue{ - semconv.ServiceName(cfg.Service), - } - if len(cfg.Version) > 0 { - attrs = append(attrs, semconv.ServiceVersion(cfg.Version)) - } - if len(cfg.InstanceID) > 0 { - attrs = append(attrs, semconv.ServiceInstanceID(cfg.InstanceID)) - } - return resource.NewWithAttributes( - semconv.SchemaURL, - attrs..., - ) -} - -type tracerHolder struct { - Tracer trace.Tracer -} diff --git a/pkg/tracing/span.go b/pkg/tracing/span.go deleted file mode 100644 index 1071f47..0000000 --- a/pkg/tracing/span.go +++ /dev/null @@ -1,12 +0,0 @@ -package tracing - -import ( - "context" - - "go.opentelemetry.io/otel/trace" -) - -// StartSpanFromContext creates a span and a context.Context containing the newly-created span. -func StartSpanFromContext(ctx context.Context, operationName string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { - return tracer.Load().Tracer.Start(ctx, operationName, opts...) -} diff --git a/rpc/client/client.go b/rpc/client/client.go index 4d12849..7e914db 100644 --- a/rpc/client/client.go +++ b/rpc/client/client.go @@ -1,7 +1,6 @@ package client import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/pkg/tracing" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) @@ -25,14 +24,5 @@ func New(opts ...Option) *Client { c.grpcDialOpts = append(c.grpcDialOpts, grpc.WithTransportCredentials(credentials.NewTLS(c.tlsCfg))) } - c.grpcDialOpts = append(c.grpcDialOpts, - grpc.WithChainUnaryInterceptor( - tracing.NewGRPCUnaryClientInteceptor(), - ), - grpc.WithChainStreamInterceptor( - tracing.NewGRPCStreamClientInterceptor(), - ), - ) - return &c } From 68021b910acb53d6dad9779153a18aff352078ac Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 2 Jun 2023 17:25:15 +0300 Subject: [PATCH 048/169] [#38] signature: Increase pool max object size According to the results of profiling, objects with a size of 72KB are mainly allocated. Signed-off-by: Dmitrii Stepanov --- util/signature/buffer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/signature/buffer.go b/util/signature/buffer.go index c2fa855..f9b003d 100644 --- a/util/signature/buffer.go +++ b/util/signature/buffer.go @@ -2,7 +2,7 @@ package signature import "sync" -const poolSliceMaxSize = 64 * 1024 +const poolSliceMaxSize = 128 * 1024 type buffer struct { data []byte From e9d67aa1b27496e7e17434e48477937b33b59c53 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 14 Jun 2023 14:21:58 +0300 Subject: [PATCH 049/169] [#31] netmap: Add unique field marshaling for PlacementPolicy Signed-off-by: Airat Arifullin a.arifullin@yadro.com --- netmap/marshal.go | 5 +++++ netmap/types.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/netmap/marshal.go b/netmap/marshal.go index f707665..51de050 100644 --- a/netmap/marshal.go +++ b/netmap/marshal.go @@ -26,6 +26,7 @@ const ( backupPolicyField = 2 selectorsPolicyField = 3 filtersPolicyField = 4 + uniquePolicyField = 5 keyAttributeField = 1 valueAttributeField = 2 @@ -166,6 +167,8 @@ func (p *PlacementPolicy) StableMarshal(buf []byte) []byte { offset += protoutil.NestedStructureMarshal(filtersPolicyField, buf[offset:], &p.filters[i]) } + offset += protoutil.BoolMarshal(uniquePolicyField, buf[offset:], p.unique) + return buf } @@ -184,6 +187,8 @@ func (p *PlacementPolicy) StableSize() (size int) { size += protoutil.NestedStructureSize(filtersPolicyField, &p.filters[i]) } + size += protoutil.BoolSize(uniquePolicyField, p.unique) + return size } diff --git a/netmap/types.go b/netmap/types.go index aece7cf..bda9ec6 100644 --- a/netmap/types.go +++ b/netmap/types.go @@ -55,11 +55,11 @@ type Replica struct { type Operation uint32 type PlacementPolicy struct { - unique bool replicas []Replica backupFactor uint32 selectors []Selector filters []Filter + unique bool } // Attribute of storage node. From 29b2078245a59984b44db29055ee145b319c2e5b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 29 Jun 2023 11:05:41 +0300 Subject: [PATCH 050/169] [#44] .forgejo: Add build/test workflows Signed-off-by: Evgenii Stratonikov --- .forgejo/workflows/tests.yml | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .forgejo/workflows/tests.yml diff --git a/.forgejo/workflows/tests.yml b/.forgejo/workflows/tests.yml new file mode 100644 index 0000000..2d44d34 --- /dev/null +++ b/.forgejo/workflows/tests.yml @@ -0,0 +1,54 @@ +name: Tests and linters +on: [pull_request] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '1.20' + cache: true + + - name: golangci-lint + uses: https://github.com/golangci/golangci-lint-action@v3 + with: + version: latest + + tests: + name: Tests + runs-on: ubuntu-latest + strategy: + matrix: + go_versions: [ '1.19', '1.20' ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '${{ matrix.go_versions }}' + cache: true + + - name: Run tests + run: make test + + tests-race: + name: Tests with -race + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '1.20' + cache: true + + - name: Run tests + run: go test ./... -count=1 -race From 3add88d4356bcebc8e77cb23b040cb3f6bf9e76f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 29 Jun 2023 11:26:49 +0300 Subject: [PATCH 051/169] [#44] netmap: Fix ineffassign linter warning Signed-off-by: Evgenii Stratonikov --- netmap/marshal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netmap/marshal.go b/netmap/marshal.go index 51de050..bf559ce 100644 --- a/netmap/marshal.go +++ b/netmap/marshal.go @@ -167,7 +167,7 @@ func (p *PlacementPolicy) StableMarshal(buf []byte) []byte { offset += protoutil.NestedStructureMarshal(filtersPolicyField, buf[offset:], &p.filters[i]) } - offset += protoutil.BoolMarshal(uniquePolicyField, buf[offset:], p.unique) + protoutil.BoolMarshal(uniquePolicyField, buf[offset:], p.unique) return buf } From b17995a238b4a8bfcf6cbc279a05d6ade53c38ca Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 30 Jun 2023 13:25:01 +0300 Subject: [PATCH 052/169] [#45] api-go: Add Object.PutSingle implementation Signed-off-by: Dmitrii Stepanov --- object/grpc/service.pb.go | 783 ++++++++++++++++++++++++--------- object/grpc/service_grpc.pb.go | 103 +++++ object/grpc/types.pb.go | 2 +- object/types.go | 45 ++ 4 files changed, 713 insertions(+), 220 deletions(-) diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index ddda473..c6ffb20 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.30.0 // protoc v3.21.9 // source: object/grpc/service.proto @@ -1125,6 +1125,146 @@ func (x *GetRangeHashResponse) GetVerifyHeader() *grpc.ResponseVerificationHeade return nil } +// Object PUT Single request +type PutSingleRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of put single object request message. + Body *PutSingleRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *PutSingleRequest) Reset() { + *x = PutSingleRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutSingleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutSingleRequest) ProtoMessage() {} + +func (x *PutSingleRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutSingleRequest.ProtoReflect.Descriptor instead. +func (*PutSingleRequest) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{16} +} + +func (x *PutSingleRequest) GetBody() *PutSingleRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *PutSingleRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *PutSingleRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Object PUT Single response +type PutSingleResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body of put single object response message. + Body *PutSingleResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *PutSingleResponse) Reset() { + *x = PutSingleResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutSingleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutSingleResponse) ProtoMessage() {} + +func (x *PutSingleResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutSingleResponse.ProtoReflect.Descriptor instead. +func (*PutSingleResponse) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{17} +} + +func (x *PutSingleResponse) GetBody() *PutSingleResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *PutSingleResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *PutSingleResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + // GET Object request body type GetRequest_Body struct { state protoimpl.MessageState @@ -1141,7 +1281,7 @@ type GetRequest_Body struct { func (x *GetRequest_Body) Reset() { *x = GetRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[16] + mi := &file_object_grpc_service_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1154,7 +1294,7 @@ func (x *GetRequest_Body) String() string { func (*GetRequest_Body) ProtoMessage() {} func (x *GetRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[16] + mi := &file_object_grpc_service_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1203,7 +1343,7 @@ type GetResponse_Body struct { func (x *GetResponse_Body) Reset() { *x = GetResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[17] + mi := &file_object_grpc_service_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1216,7 +1356,7 @@ func (x *GetResponse_Body) String() string { func (*GetResponse_Body) ProtoMessage() {} func (x *GetResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[17] + mi := &file_object_grpc_service_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1303,7 +1443,7 @@ type GetResponse_Body_Init struct { func (x *GetResponse_Body_Init) Reset() { *x = GetResponse_Body_Init{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[18] + mi := &file_object_grpc_service_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1316,7 +1456,7 @@ func (x *GetResponse_Body_Init) String() string { func (*GetResponse_Body_Init) ProtoMessage() {} func (x *GetResponse_Body_Init) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[18] + mi := &file_object_grpc_service_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1371,7 +1511,7 @@ type PutRequest_Body struct { func (x *PutRequest_Body) Reset() { *x = PutRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[19] + mi := &file_object_grpc_service_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1384,7 +1524,7 @@ func (x *PutRequest_Body) String() string { func (*PutRequest_Body) ProtoMessage() {} func (x *PutRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[19] + mi := &file_object_grpc_service_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1468,7 +1608,7 @@ type PutRequest_Body_Init struct { func (x *PutRequest_Body_Init) Reset() { *x = PutRequest_Body_Init{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[20] + mi := &file_object_grpc_service_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1481,7 +1621,7 @@ func (x *PutRequest_Body_Init) String() string { func (*PutRequest_Body_Init) ProtoMessage() {} func (x *PutRequest_Body_Init) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[20] + mi := &file_object_grpc_service_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1538,7 +1678,7 @@ type PutResponse_Body struct { func (x *PutResponse_Body) Reset() { *x = PutResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[21] + mi := &file_object_grpc_service_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1551,7 +1691,7 @@ func (x *PutResponse_Body) String() string { func (*PutResponse_Body) ProtoMessage() {} func (x *PutResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[21] + mi := &file_object_grpc_service_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1587,7 +1727,7 @@ type DeleteRequest_Body struct { func (x *DeleteRequest_Body) Reset() { *x = DeleteRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[22] + mi := &file_object_grpc_service_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1600,7 +1740,7 @@ func (x *DeleteRequest_Body) String() string { func (*DeleteRequest_Body) ProtoMessage() {} func (x *DeleteRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[22] + mi := &file_object_grpc_service_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1636,7 +1776,7 @@ type DeleteResponse_Body struct { func (x *DeleteResponse_Body) Reset() { *x = DeleteResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[23] + mi := &file_object_grpc_service_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1649,7 +1789,7 @@ func (x *DeleteResponse_Body) String() string { func (*DeleteResponse_Body) ProtoMessage() {} func (x *DeleteResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[23] + mi := &file_object_grpc_service_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1690,7 +1830,7 @@ type HeadRequest_Body struct { func (x *HeadRequest_Body) Reset() { *x = HeadRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[24] + mi := &file_object_grpc_service_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1703,7 +1843,7 @@ func (x *HeadRequest_Body) String() string { func (*HeadRequest_Body) ProtoMessage() {} func (x *HeadRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[24] + mi := &file_object_grpc_service_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1760,7 +1900,7 @@ type HeadResponse_Body struct { func (x *HeadResponse_Body) Reset() { *x = HeadResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[25] + mi := &file_object_grpc_service_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1773,7 +1913,7 @@ func (x *HeadResponse_Body) String() string { func (*HeadResponse_Body) ProtoMessage() {} func (x *HeadResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[25] + mi := &file_object_grpc_service_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1859,7 +1999,7 @@ type SearchRequest_Body struct { func (x *SearchRequest_Body) Reset() { *x = SearchRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[26] + mi := &file_object_grpc_service_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1872,7 +2012,7 @@ func (x *SearchRequest_Body) String() string { func (*SearchRequest_Body) ProtoMessage() {} func (x *SearchRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[26] + mi := &file_object_grpc_service_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1979,7 +2119,7 @@ type SearchRequest_Body_Filter struct { func (x *SearchRequest_Body_Filter) Reset() { *x = SearchRequest_Body_Filter{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[27] + mi := &file_object_grpc_service_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1992,7 +2132,7 @@ func (x *SearchRequest_Body_Filter) String() string { func (*SearchRequest_Body_Filter) ProtoMessage() {} func (x *SearchRequest_Body_Filter) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[27] + mi := &file_object_grpc_service_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2042,7 +2182,7 @@ type SearchResponse_Body struct { func (x *SearchResponse_Body) Reset() { *x = SearchResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[28] + mi := &file_object_grpc_service_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2055,7 +2195,7 @@ func (x *SearchResponse_Body) String() string { func (*SearchResponse_Body) ProtoMessage() {} func (x *SearchResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[28] + mi := &file_object_grpc_service_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2096,7 +2236,7 @@ type GetRangeRequest_Body struct { func (x *GetRangeRequest_Body) Reset() { *x = GetRangeRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[29] + mi := &file_object_grpc_service_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2109,7 +2249,7 @@ func (x *GetRangeRequest_Body) String() string { func (*GetRangeRequest_Body) ProtoMessage() {} func (x *GetRangeRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[29] + mi := &file_object_grpc_service_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2167,7 +2307,7 @@ type GetRangeResponse_Body struct { func (x *GetRangeResponse_Body) Reset() { *x = GetRangeResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[30] + mi := &file_object_grpc_service_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2180,7 +2320,7 @@ func (x *GetRangeResponse_Body) String() string { func (*GetRangeResponse_Body) ProtoMessage() {} func (x *GetRangeResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[30] + mi := &file_object_grpc_service_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2254,7 +2394,7 @@ type GetRangeHashRequest_Body struct { func (x *GetRangeHashRequest_Body) Reset() { *x = GetRangeHashRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[31] + mi := &file_object_grpc_service_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2267,7 +2407,7 @@ func (x *GetRangeHashRequest_Body) String() string { func (*GetRangeHashRequest_Body) ProtoMessage() {} func (x *GetRangeHashRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[31] + mi := &file_object_grpc_service_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2326,7 +2466,7 @@ type GetRangeHashResponse_Body struct { func (x *GetRangeHashResponse_Body) Reset() { *x = GetRangeHashResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[32] + mi := &file_object_grpc_service_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2339,7 +2479,7 @@ func (x *GetRangeHashResponse_Body) String() string { func (*GetRangeHashResponse_Body) ProtoMessage() {} func (x *GetRangeHashResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[32] + mi := &file_object_grpc_service_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2369,6 +2509,108 @@ func (x *GetRangeHashResponse_Body) GetHashList() [][]byte { return nil } +// PUT Single request body +type PutSingleRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Prepared object with payload. + Object *Object `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` + // Number of copies of the object to store within the RPC call. By default, + // object is processed according to the container's placement policy. + // Every number is treated as a minimal number of + // nodes in a corresponding placement vector that must store an object + // to complete the request successfully. The length MUST equal the placement + // vectors number, otherwise request is considered malformed. + CopiesNumber []uint32 `protobuf:"varint,2,rep,packed,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` +} + +func (x *PutSingleRequest_Body) Reset() { + *x = PutSingleRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutSingleRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutSingleRequest_Body) ProtoMessage() {} + +func (x *PutSingleRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutSingleRequest_Body.ProtoReflect.Descriptor instead. +func (*PutSingleRequest_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{16, 0} +} + +func (x *PutSingleRequest_Body) GetObject() *Object { + if x != nil { + return x.Object + } + return nil +} + +func (x *PutSingleRequest_Body) GetCopiesNumber() []uint32 { + if x != nil { + return x.CopiesNumber + } + return nil +} + +// PUT Single Object response body +type PutSingleResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PutSingleResponse_Body) Reset() { + *x = PutSingleResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutSingleResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutSingleResponse_Body) ProtoMessage() {} + +func (x *PutSingleResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutSingleResponse_Body.ProtoReflect.Descriptor instead. +func (*PutSingleResponse_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{17, 0} +} + var File_object_grpc_service_proto protoreflect.FileDescriptor var file_object_grpc_service_proto_rawDesc = []byte{ @@ -2724,49 +2966,90 @@ var file_object_grpc_service_proto_rawDesc = []byte{ 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x68, 0x61, 0x73, 0x68, 0x4c, 0x69, - 0x73, 0x74, 0x32, 0xb2, 0x04, 0x0a, 0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x03, 0x50, 0x75, - 0x74, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, - 0x12, 0x4b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, - 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1f, + 0x73, 0x74, 0x22, 0xc8, 0x02, 0x0a, 0x10, 0x50, 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, + 0x6c, 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, 0x5d, + 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x69, + 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, + 0x0c, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xf5, 0x01, + 0x0a, 0x11, 0x50, 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 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, 0x06, 0x0a, + 0x04, 0x42, 0x6f, 0x64, 0x79, 0x32, 0x88, 0x05, 0x0a, 0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x30, 0x01, 0x12, 0x53, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, - 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x44, 0x0a, + 0x03, 0x50, 0x75, 0x74, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x28, 0x01, 0x12, 0x4b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1f, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x45, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x53, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, + 0x67, 0x65, 0x12, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, - 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, - 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, - 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5d, 0x0a, 0x0c, 0x47, + 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, + 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, + 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x09, 0x50, 0x75, + 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x53, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, + 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, + 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, + 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, + 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, + 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2781,7 +3064,7 @@ func file_object_grpc_service_proto_rawDescGZIP() []byte { return file_object_grpc_service_proto_rawDescData } -var file_object_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 33) +var file_object_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 37) var file_object_grpc_service_proto_goTypes = []interface{}{ (*GetRequest)(nil), // 0: neo.fs.v2.object.GetRequest (*GetResponse)(nil), // 1: neo.fs.v2.object.GetResponse @@ -2799,129 +3082,143 @@ var file_object_grpc_service_proto_goTypes = []interface{}{ (*GetRangeResponse)(nil), // 13: neo.fs.v2.object.GetRangeResponse (*GetRangeHashRequest)(nil), // 14: neo.fs.v2.object.GetRangeHashRequest (*GetRangeHashResponse)(nil), // 15: neo.fs.v2.object.GetRangeHashResponse - (*GetRequest_Body)(nil), // 16: neo.fs.v2.object.GetRequest.Body - (*GetResponse_Body)(nil), // 17: neo.fs.v2.object.GetResponse.Body - (*GetResponse_Body_Init)(nil), // 18: neo.fs.v2.object.GetResponse.Body.Init - (*PutRequest_Body)(nil), // 19: neo.fs.v2.object.PutRequest.Body - (*PutRequest_Body_Init)(nil), // 20: neo.fs.v2.object.PutRequest.Body.Init - (*PutResponse_Body)(nil), // 21: neo.fs.v2.object.PutResponse.Body - (*DeleteRequest_Body)(nil), // 22: neo.fs.v2.object.DeleteRequest.Body - (*DeleteResponse_Body)(nil), // 23: neo.fs.v2.object.DeleteResponse.Body - (*HeadRequest_Body)(nil), // 24: neo.fs.v2.object.HeadRequest.Body - (*HeadResponse_Body)(nil), // 25: neo.fs.v2.object.HeadResponse.Body - (*SearchRequest_Body)(nil), // 26: neo.fs.v2.object.SearchRequest.Body - (*SearchRequest_Body_Filter)(nil), // 27: neo.fs.v2.object.SearchRequest.Body.Filter - (*SearchResponse_Body)(nil), // 28: neo.fs.v2.object.SearchResponse.Body - (*GetRangeRequest_Body)(nil), // 29: neo.fs.v2.object.GetRangeRequest.Body - (*GetRangeResponse_Body)(nil), // 30: neo.fs.v2.object.GetRangeResponse.Body - (*GetRangeHashRequest_Body)(nil), // 31: neo.fs.v2.object.GetRangeHashRequest.Body - (*GetRangeHashResponse_Body)(nil), // 32: neo.fs.v2.object.GetRangeHashResponse.Body - (*grpc.RequestMetaHeader)(nil), // 33: neo.fs.v2.session.RequestMetaHeader - (*grpc.RequestVerificationHeader)(nil), // 34: neo.fs.v2.session.RequestVerificationHeader - (*grpc.ResponseMetaHeader)(nil), // 35: neo.fs.v2.session.ResponseMetaHeader - (*grpc.ResponseVerificationHeader)(nil), // 36: neo.fs.v2.session.ResponseVerificationHeader - (*Header)(nil), // 37: neo.fs.v2.object.Header - (*grpc1.Signature)(nil), // 38: neo.fs.v2.refs.Signature - (*grpc1.Address)(nil), // 39: neo.fs.v2.refs.Address - (*SplitInfo)(nil), // 40: neo.fs.v2.object.SplitInfo - (*grpc1.ObjectID)(nil), // 41: neo.fs.v2.refs.ObjectID - (*ShortHeader)(nil), // 42: neo.fs.v2.object.ShortHeader - (*grpc1.ContainerID)(nil), // 43: neo.fs.v2.refs.ContainerID - (MatchType)(0), // 44: neo.fs.v2.object.MatchType - (grpc1.ChecksumType)(0), // 45: neo.fs.v2.refs.ChecksumType + (*PutSingleRequest)(nil), // 16: neo.fs.v2.object.PutSingleRequest + (*PutSingleResponse)(nil), // 17: neo.fs.v2.object.PutSingleResponse + (*GetRequest_Body)(nil), // 18: neo.fs.v2.object.GetRequest.Body + (*GetResponse_Body)(nil), // 19: neo.fs.v2.object.GetResponse.Body + (*GetResponse_Body_Init)(nil), // 20: neo.fs.v2.object.GetResponse.Body.Init + (*PutRequest_Body)(nil), // 21: neo.fs.v2.object.PutRequest.Body + (*PutRequest_Body_Init)(nil), // 22: neo.fs.v2.object.PutRequest.Body.Init + (*PutResponse_Body)(nil), // 23: neo.fs.v2.object.PutResponse.Body + (*DeleteRequest_Body)(nil), // 24: neo.fs.v2.object.DeleteRequest.Body + (*DeleteResponse_Body)(nil), // 25: neo.fs.v2.object.DeleteResponse.Body + (*HeadRequest_Body)(nil), // 26: neo.fs.v2.object.HeadRequest.Body + (*HeadResponse_Body)(nil), // 27: neo.fs.v2.object.HeadResponse.Body + (*SearchRequest_Body)(nil), // 28: neo.fs.v2.object.SearchRequest.Body + (*SearchRequest_Body_Filter)(nil), // 29: neo.fs.v2.object.SearchRequest.Body.Filter + (*SearchResponse_Body)(nil), // 30: neo.fs.v2.object.SearchResponse.Body + (*GetRangeRequest_Body)(nil), // 31: neo.fs.v2.object.GetRangeRequest.Body + (*GetRangeResponse_Body)(nil), // 32: neo.fs.v2.object.GetRangeResponse.Body + (*GetRangeHashRequest_Body)(nil), // 33: neo.fs.v2.object.GetRangeHashRequest.Body + (*GetRangeHashResponse_Body)(nil), // 34: neo.fs.v2.object.GetRangeHashResponse.Body + (*PutSingleRequest_Body)(nil), // 35: neo.fs.v2.object.PutSingleRequest.Body + (*PutSingleResponse_Body)(nil), // 36: neo.fs.v2.object.PutSingleResponse.Body + (*grpc.RequestMetaHeader)(nil), // 37: neo.fs.v2.session.RequestMetaHeader + (*grpc.RequestVerificationHeader)(nil), // 38: neo.fs.v2.session.RequestVerificationHeader + (*grpc.ResponseMetaHeader)(nil), // 39: neo.fs.v2.session.ResponseMetaHeader + (*grpc.ResponseVerificationHeader)(nil), // 40: neo.fs.v2.session.ResponseVerificationHeader + (*Header)(nil), // 41: neo.fs.v2.object.Header + (*grpc1.Signature)(nil), // 42: neo.fs.v2.refs.Signature + (*grpc1.Address)(nil), // 43: neo.fs.v2.refs.Address + (*SplitInfo)(nil), // 44: neo.fs.v2.object.SplitInfo + (*grpc1.ObjectID)(nil), // 45: neo.fs.v2.refs.ObjectID + (*ShortHeader)(nil), // 46: neo.fs.v2.object.ShortHeader + (*grpc1.ContainerID)(nil), // 47: neo.fs.v2.refs.ContainerID + (MatchType)(0), // 48: neo.fs.v2.object.MatchType + (grpc1.ChecksumType)(0), // 49: neo.fs.v2.refs.ChecksumType + (*Object)(nil), // 50: neo.fs.v2.object.Object } var file_object_grpc_service_proto_depIdxs = []int32{ - 16, // 0: neo.fs.v2.object.GetRequest.body:type_name -> neo.fs.v2.object.GetRequest.Body - 33, // 1: neo.fs.v2.object.GetRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 34, // 2: neo.fs.v2.object.GetRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 17, // 3: neo.fs.v2.object.GetResponse.body:type_name -> neo.fs.v2.object.GetResponse.Body - 35, // 4: neo.fs.v2.object.GetResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 36, // 5: neo.fs.v2.object.GetResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 19, // 6: neo.fs.v2.object.PutRequest.body:type_name -> neo.fs.v2.object.PutRequest.Body - 33, // 7: neo.fs.v2.object.PutRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 34, // 8: neo.fs.v2.object.PutRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 21, // 9: neo.fs.v2.object.PutResponse.body:type_name -> neo.fs.v2.object.PutResponse.Body - 35, // 10: neo.fs.v2.object.PutResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 36, // 11: neo.fs.v2.object.PutResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 22, // 12: neo.fs.v2.object.DeleteRequest.body:type_name -> neo.fs.v2.object.DeleteRequest.Body - 33, // 13: neo.fs.v2.object.DeleteRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 34, // 14: neo.fs.v2.object.DeleteRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 23, // 15: neo.fs.v2.object.DeleteResponse.body:type_name -> neo.fs.v2.object.DeleteResponse.Body - 35, // 16: neo.fs.v2.object.DeleteResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 36, // 17: neo.fs.v2.object.DeleteResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 24, // 18: neo.fs.v2.object.HeadRequest.body:type_name -> neo.fs.v2.object.HeadRequest.Body - 33, // 19: neo.fs.v2.object.HeadRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 34, // 20: neo.fs.v2.object.HeadRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 37, // 21: neo.fs.v2.object.HeaderWithSignature.header:type_name -> neo.fs.v2.object.Header - 38, // 22: neo.fs.v2.object.HeaderWithSignature.signature:type_name -> neo.fs.v2.refs.Signature - 25, // 23: neo.fs.v2.object.HeadResponse.body:type_name -> neo.fs.v2.object.HeadResponse.Body - 35, // 24: neo.fs.v2.object.HeadResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 36, // 25: neo.fs.v2.object.HeadResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 26, // 26: neo.fs.v2.object.SearchRequest.body:type_name -> neo.fs.v2.object.SearchRequest.Body - 33, // 27: neo.fs.v2.object.SearchRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 34, // 28: neo.fs.v2.object.SearchRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 28, // 29: neo.fs.v2.object.SearchResponse.body:type_name -> neo.fs.v2.object.SearchResponse.Body - 35, // 30: neo.fs.v2.object.SearchResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 36, // 31: neo.fs.v2.object.SearchResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 29, // 32: neo.fs.v2.object.GetRangeRequest.body:type_name -> neo.fs.v2.object.GetRangeRequest.Body - 33, // 33: neo.fs.v2.object.GetRangeRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 34, // 34: neo.fs.v2.object.GetRangeRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 30, // 35: neo.fs.v2.object.GetRangeResponse.body:type_name -> neo.fs.v2.object.GetRangeResponse.Body - 35, // 36: neo.fs.v2.object.GetRangeResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 36, // 37: neo.fs.v2.object.GetRangeResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 31, // 38: neo.fs.v2.object.GetRangeHashRequest.body:type_name -> neo.fs.v2.object.GetRangeHashRequest.Body - 33, // 39: neo.fs.v2.object.GetRangeHashRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 34, // 40: neo.fs.v2.object.GetRangeHashRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 32, // 41: neo.fs.v2.object.GetRangeHashResponse.body:type_name -> neo.fs.v2.object.GetRangeHashResponse.Body - 35, // 42: neo.fs.v2.object.GetRangeHashResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 36, // 43: neo.fs.v2.object.GetRangeHashResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 39, // 44: neo.fs.v2.object.GetRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 18, // 45: neo.fs.v2.object.GetResponse.Body.init:type_name -> neo.fs.v2.object.GetResponse.Body.Init - 40, // 46: neo.fs.v2.object.GetResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 41, // 47: neo.fs.v2.object.GetResponse.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID - 38, // 48: neo.fs.v2.object.GetResponse.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature - 37, // 49: neo.fs.v2.object.GetResponse.Body.Init.header:type_name -> neo.fs.v2.object.Header - 20, // 50: neo.fs.v2.object.PutRequest.Body.init:type_name -> neo.fs.v2.object.PutRequest.Body.Init - 41, // 51: neo.fs.v2.object.PutRequest.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID - 38, // 52: neo.fs.v2.object.PutRequest.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature - 37, // 53: neo.fs.v2.object.PutRequest.Body.Init.header:type_name -> neo.fs.v2.object.Header - 41, // 54: neo.fs.v2.object.PutResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID - 39, // 55: neo.fs.v2.object.DeleteRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 39, // 56: neo.fs.v2.object.DeleteResponse.Body.tombstone:type_name -> neo.fs.v2.refs.Address - 39, // 57: neo.fs.v2.object.HeadRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 7, // 58: neo.fs.v2.object.HeadResponse.Body.header:type_name -> neo.fs.v2.object.HeaderWithSignature - 42, // 59: neo.fs.v2.object.HeadResponse.Body.short_header:type_name -> neo.fs.v2.object.ShortHeader - 40, // 60: neo.fs.v2.object.HeadResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 43, // 61: neo.fs.v2.object.SearchRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 27, // 62: neo.fs.v2.object.SearchRequest.Body.filters:type_name -> neo.fs.v2.object.SearchRequest.Body.Filter - 44, // 63: neo.fs.v2.object.SearchRequest.Body.Filter.match_type:type_name -> neo.fs.v2.object.MatchType - 41, // 64: neo.fs.v2.object.SearchResponse.Body.id_list:type_name -> neo.fs.v2.refs.ObjectID - 39, // 65: neo.fs.v2.object.GetRangeRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 11, // 66: neo.fs.v2.object.GetRangeRequest.Body.range:type_name -> neo.fs.v2.object.Range - 40, // 67: neo.fs.v2.object.GetRangeResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 39, // 68: neo.fs.v2.object.GetRangeHashRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 11, // 69: neo.fs.v2.object.GetRangeHashRequest.Body.ranges:type_name -> neo.fs.v2.object.Range - 45, // 70: neo.fs.v2.object.GetRangeHashRequest.Body.type:type_name -> neo.fs.v2.refs.ChecksumType - 45, // 71: neo.fs.v2.object.GetRangeHashResponse.Body.type:type_name -> neo.fs.v2.refs.ChecksumType - 0, // 72: neo.fs.v2.object.ObjectService.Get:input_type -> neo.fs.v2.object.GetRequest - 2, // 73: neo.fs.v2.object.ObjectService.Put:input_type -> neo.fs.v2.object.PutRequest - 4, // 74: neo.fs.v2.object.ObjectService.Delete:input_type -> neo.fs.v2.object.DeleteRequest - 6, // 75: neo.fs.v2.object.ObjectService.Head:input_type -> neo.fs.v2.object.HeadRequest - 9, // 76: neo.fs.v2.object.ObjectService.Search:input_type -> neo.fs.v2.object.SearchRequest - 12, // 77: neo.fs.v2.object.ObjectService.GetRange:input_type -> neo.fs.v2.object.GetRangeRequest - 14, // 78: neo.fs.v2.object.ObjectService.GetRangeHash:input_type -> neo.fs.v2.object.GetRangeHashRequest - 1, // 79: neo.fs.v2.object.ObjectService.Get:output_type -> neo.fs.v2.object.GetResponse - 3, // 80: neo.fs.v2.object.ObjectService.Put:output_type -> neo.fs.v2.object.PutResponse - 5, // 81: neo.fs.v2.object.ObjectService.Delete:output_type -> neo.fs.v2.object.DeleteResponse - 8, // 82: neo.fs.v2.object.ObjectService.Head:output_type -> neo.fs.v2.object.HeadResponse - 10, // 83: neo.fs.v2.object.ObjectService.Search:output_type -> neo.fs.v2.object.SearchResponse - 13, // 84: neo.fs.v2.object.ObjectService.GetRange:output_type -> neo.fs.v2.object.GetRangeResponse - 15, // 85: neo.fs.v2.object.ObjectService.GetRangeHash:output_type -> neo.fs.v2.object.GetRangeHashResponse - 79, // [79:86] is the sub-list for method output_type - 72, // [72:79] is the sub-list for method input_type - 72, // [72:72] is the sub-list for extension type_name - 72, // [72:72] is the sub-list for extension extendee - 0, // [0:72] is the sub-list for field type_name + 18, // 0: neo.fs.v2.object.GetRequest.body:type_name -> neo.fs.v2.object.GetRequest.Body + 37, // 1: neo.fs.v2.object.GetRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 38, // 2: neo.fs.v2.object.GetRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 19, // 3: neo.fs.v2.object.GetResponse.body:type_name -> neo.fs.v2.object.GetResponse.Body + 39, // 4: neo.fs.v2.object.GetResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 40, // 5: neo.fs.v2.object.GetResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 21, // 6: neo.fs.v2.object.PutRequest.body:type_name -> neo.fs.v2.object.PutRequest.Body + 37, // 7: neo.fs.v2.object.PutRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 38, // 8: neo.fs.v2.object.PutRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 23, // 9: neo.fs.v2.object.PutResponse.body:type_name -> neo.fs.v2.object.PutResponse.Body + 39, // 10: neo.fs.v2.object.PutResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 40, // 11: neo.fs.v2.object.PutResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 24, // 12: neo.fs.v2.object.DeleteRequest.body:type_name -> neo.fs.v2.object.DeleteRequest.Body + 37, // 13: neo.fs.v2.object.DeleteRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 38, // 14: neo.fs.v2.object.DeleteRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 25, // 15: neo.fs.v2.object.DeleteResponse.body:type_name -> neo.fs.v2.object.DeleteResponse.Body + 39, // 16: neo.fs.v2.object.DeleteResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 40, // 17: neo.fs.v2.object.DeleteResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 26, // 18: neo.fs.v2.object.HeadRequest.body:type_name -> neo.fs.v2.object.HeadRequest.Body + 37, // 19: neo.fs.v2.object.HeadRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 38, // 20: neo.fs.v2.object.HeadRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 41, // 21: neo.fs.v2.object.HeaderWithSignature.header:type_name -> neo.fs.v2.object.Header + 42, // 22: neo.fs.v2.object.HeaderWithSignature.signature:type_name -> neo.fs.v2.refs.Signature + 27, // 23: neo.fs.v2.object.HeadResponse.body:type_name -> neo.fs.v2.object.HeadResponse.Body + 39, // 24: neo.fs.v2.object.HeadResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 40, // 25: neo.fs.v2.object.HeadResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 28, // 26: neo.fs.v2.object.SearchRequest.body:type_name -> neo.fs.v2.object.SearchRequest.Body + 37, // 27: neo.fs.v2.object.SearchRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 38, // 28: neo.fs.v2.object.SearchRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 30, // 29: neo.fs.v2.object.SearchResponse.body:type_name -> neo.fs.v2.object.SearchResponse.Body + 39, // 30: neo.fs.v2.object.SearchResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 40, // 31: neo.fs.v2.object.SearchResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 31, // 32: neo.fs.v2.object.GetRangeRequest.body:type_name -> neo.fs.v2.object.GetRangeRequest.Body + 37, // 33: neo.fs.v2.object.GetRangeRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 38, // 34: neo.fs.v2.object.GetRangeRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 32, // 35: neo.fs.v2.object.GetRangeResponse.body:type_name -> neo.fs.v2.object.GetRangeResponse.Body + 39, // 36: neo.fs.v2.object.GetRangeResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 40, // 37: neo.fs.v2.object.GetRangeResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 33, // 38: neo.fs.v2.object.GetRangeHashRequest.body:type_name -> neo.fs.v2.object.GetRangeHashRequest.Body + 37, // 39: neo.fs.v2.object.GetRangeHashRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 38, // 40: neo.fs.v2.object.GetRangeHashRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 34, // 41: neo.fs.v2.object.GetRangeHashResponse.body:type_name -> neo.fs.v2.object.GetRangeHashResponse.Body + 39, // 42: neo.fs.v2.object.GetRangeHashResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 40, // 43: neo.fs.v2.object.GetRangeHashResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 35, // 44: neo.fs.v2.object.PutSingleRequest.body:type_name -> neo.fs.v2.object.PutSingleRequest.Body + 37, // 45: neo.fs.v2.object.PutSingleRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 38, // 46: neo.fs.v2.object.PutSingleRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 36, // 47: neo.fs.v2.object.PutSingleResponse.body:type_name -> neo.fs.v2.object.PutSingleResponse.Body + 39, // 48: neo.fs.v2.object.PutSingleResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 40, // 49: neo.fs.v2.object.PutSingleResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 43, // 50: neo.fs.v2.object.GetRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 20, // 51: neo.fs.v2.object.GetResponse.Body.init:type_name -> neo.fs.v2.object.GetResponse.Body.Init + 44, // 52: neo.fs.v2.object.GetResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 45, // 53: neo.fs.v2.object.GetResponse.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID + 42, // 54: neo.fs.v2.object.GetResponse.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature + 41, // 55: neo.fs.v2.object.GetResponse.Body.Init.header:type_name -> neo.fs.v2.object.Header + 22, // 56: neo.fs.v2.object.PutRequest.Body.init:type_name -> neo.fs.v2.object.PutRequest.Body.Init + 45, // 57: neo.fs.v2.object.PutRequest.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID + 42, // 58: neo.fs.v2.object.PutRequest.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature + 41, // 59: neo.fs.v2.object.PutRequest.Body.Init.header:type_name -> neo.fs.v2.object.Header + 45, // 60: neo.fs.v2.object.PutResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID + 43, // 61: neo.fs.v2.object.DeleteRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 43, // 62: neo.fs.v2.object.DeleteResponse.Body.tombstone:type_name -> neo.fs.v2.refs.Address + 43, // 63: neo.fs.v2.object.HeadRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 7, // 64: neo.fs.v2.object.HeadResponse.Body.header:type_name -> neo.fs.v2.object.HeaderWithSignature + 46, // 65: neo.fs.v2.object.HeadResponse.Body.short_header:type_name -> neo.fs.v2.object.ShortHeader + 44, // 66: neo.fs.v2.object.HeadResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 47, // 67: neo.fs.v2.object.SearchRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 29, // 68: neo.fs.v2.object.SearchRequest.Body.filters:type_name -> neo.fs.v2.object.SearchRequest.Body.Filter + 48, // 69: neo.fs.v2.object.SearchRequest.Body.Filter.match_type:type_name -> neo.fs.v2.object.MatchType + 45, // 70: neo.fs.v2.object.SearchResponse.Body.id_list:type_name -> neo.fs.v2.refs.ObjectID + 43, // 71: neo.fs.v2.object.GetRangeRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 11, // 72: neo.fs.v2.object.GetRangeRequest.Body.range:type_name -> neo.fs.v2.object.Range + 44, // 73: neo.fs.v2.object.GetRangeResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 43, // 74: neo.fs.v2.object.GetRangeHashRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 11, // 75: neo.fs.v2.object.GetRangeHashRequest.Body.ranges:type_name -> neo.fs.v2.object.Range + 49, // 76: neo.fs.v2.object.GetRangeHashRequest.Body.type:type_name -> neo.fs.v2.refs.ChecksumType + 49, // 77: neo.fs.v2.object.GetRangeHashResponse.Body.type:type_name -> neo.fs.v2.refs.ChecksumType + 50, // 78: neo.fs.v2.object.PutSingleRequest.Body.object:type_name -> neo.fs.v2.object.Object + 0, // 79: neo.fs.v2.object.ObjectService.Get:input_type -> neo.fs.v2.object.GetRequest + 2, // 80: neo.fs.v2.object.ObjectService.Put:input_type -> neo.fs.v2.object.PutRequest + 4, // 81: neo.fs.v2.object.ObjectService.Delete:input_type -> neo.fs.v2.object.DeleteRequest + 6, // 82: neo.fs.v2.object.ObjectService.Head:input_type -> neo.fs.v2.object.HeadRequest + 9, // 83: neo.fs.v2.object.ObjectService.Search:input_type -> neo.fs.v2.object.SearchRequest + 12, // 84: neo.fs.v2.object.ObjectService.GetRange:input_type -> neo.fs.v2.object.GetRangeRequest + 14, // 85: neo.fs.v2.object.ObjectService.GetRangeHash:input_type -> neo.fs.v2.object.GetRangeHashRequest + 16, // 86: neo.fs.v2.object.ObjectService.PutSingle:input_type -> neo.fs.v2.object.PutSingleRequest + 1, // 87: neo.fs.v2.object.ObjectService.Get:output_type -> neo.fs.v2.object.GetResponse + 3, // 88: neo.fs.v2.object.ObjectService.Put:output_type -> neo.fs.v2.object.PutResponse + 5, // 89: neo.fs.v2.object.ObjectService.Delete:output_type -> neo.fs.v2.object.DeleteResponse + 8, // 90: neo.fs.v2.object.ObjectService.Head:output_type -> neo.fs.v2.object.HeadResponse + 10, // 91: neo.fs.v2.object.ObjectService.Search:output_type -> neo.fs.v2.object.SearchResponse + 13, // 92: neo.fs.v2.object.ObjectService.GetRange:output_type -> neo.fs.v2.object.GetRangeResponse + 15, // 93: neo.fs.v2.object.ObjectService.GetRangeHash:output_type -> neo.fs.v2.object.GetRangeHashResponse + 17, // 94: neo.fs.v2.object.ObjectService.PutSingle:output_type -> neo.fs.v2.object.PutSingleResponse + 87, // [87:95] is the sub-list for method output_type + 79, // [79:87] is the sub-list for method input_type + 79, // [79:79] is the sub-list for extension type_name + 79, // [79:79] is the sub-list for extension extendee + 0, // [0:79] is the sub-list for field type_name } func init() { file_object_grpc_service_proto_init() } @@ -3124,7 +3421,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest_Body); i { + switch v := v.(*PutSingleRequest); i { case 0: return &v.state case 1: @@ -3136,7 +3433,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse_Body); i { + switch v := v.(*PutSingleResponse); i { case 0: return &v.state case 1: @@ -3148,7 +3445,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse_Body_Init); i { + switch v := v.(*GetRequest_Body); i { case 0: return &v.state case 1: @@ -3160,7 +3457,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutRequest_Body); i { + switch v := v.(*GetResponse_Body); i { case 0: return &v.state case 1: @@ -3172,7 +3469,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutRequest_Body_Init); i { + switch v := v.(*GetResponse_Body_Init); i { case 0: return &v.state case 1: @@ -3184,7 +3481,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutResponse_Body); i { + switch v := v.(*PutRequest_Body); i { case 0: return &v.state case 1: @@ -3196,7 +3493,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRequest_Body); i { + switch v := v.(*PutRequest_Body_Init); i { case 0: return &v.state case 1: @@ -3208,7 +3505,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResponse_Body); i { + switch v := v.(*PutResponse_Body); i { case 0: return &v.state case 1: @@ -3220,7 +3517,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadRequest_Body); i { + switch v := v.(*DeleteRequest_Body); i { case 0: return &v.state case 1: @@ -3232,7 +3529,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadResponse_Body); i { + switch v := v.(*DeleteResponse_Body); i { case 0: return &v.state case 1: @@ -3244,7 +3541,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchRequest_Body); i { + switch v := v.(*HeadRequest_Body); i { case 0: return &v.state case 1: @@ -3256,7 +3553,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchRequest_Body_Filter); i { + switch v := v.(*HeadResponse_Body); i { case 0: return &v.state case 1: @@ -3268,7 +3565,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchResponse_Body); i { + switch v := v.(*SearchRequest_Body); i { case 0: return &v.state case 1: @@ -3280,7 +3577,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeRequest_Body); i { + switch v := v.(*SearchRequest_Body_Filter); i { case 0: return &v.state case 1: @@ -3292,7 +3589,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeResponse_Body); i { + switch v := v.(*SearchResponse_Body); i { case 0: return &v.state case 1: @@ -3304,7 +3601,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeHashRequest_Body); i { + switch v := v.(*GetRangeRequest_Body); i { case 0: return &v.state case 1: @@ -3316,6 +3613,30 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeHashRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRangeHashResponse_Body); i { case 0: return &v.state @@ -3327,22 +3648,46 @@ func file_object_grpc_service_proto_init() { return nil } } + file_object_grpc_service_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutSingleRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutSingleResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } - file_object_grpc_service_proto_msgTypes[17].OneofWrappers = []interface{}{ + file_object_grpc_service_proto_msgTypes[19].OneofWrappers = []interface{}{ (*GetResponse_Body_Init_)(nil), (*GetResponse_Body_Chunk)(nil), (*GetResponse_Body_SplitInfo)(nil), } - file_object_grpc_service_proto_msgTypes[19].OneofWrappers = []interface{}{ + file_object_grpc_service_proto_msgTypes[21].OneofWrappers = []interface{}{ (*PutRequest_Body_Init_)(nil), (*PutRequest_Body_Chunk)(nil), } - file_object_grpc_service_proto_msgTypes[25].OneofWrappers = []interface{}{ + file_object_grpc_service_proto_msgTypes[27].OneofWrappers = []interface{}{ (*HeadResponse_Body_Header)(nil), (*HeadResponse_Body_ShortHeader)(nil), (*HeadResponse_Body_SplitInfo)(nil), } - file_object_grpc_service_proto_msgTypes[30].OneofWrappers = []interface{}{ + file_object_grpc_service_proto_msgTypes[32].OneofWrappers = []interface{}{ (*GetRangeResponse_Body_Chunk)(nil), (*GetRangeResponse_Body_SplitInfo)(nil), } @@ -3352,7 +3697,7 @@ func file_object_grpc_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_object_grpc_service_proto_rawDesc, NumEnums: 0, - NumMessages: 33, + NumMessages: 37, NumExtensions: 0, NumServices: 1, }, diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 10f33b8..3c71ec8 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -26,6 +26,7 @@ const ( ObjectService_Search_FullMethodName = "/neo.fs.v2.object.ObjectService/Search" ObjectService_GetRange_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRange" ObjectService_GetRangeHash_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRangeHash" + ObjectService_PutSingle_FullMethodName = "/neo.fs.v2.object.ObjectService/PutSingle" ) // ObjectServiceClient is the client API for ObjectService service. @@ -243,6 +244,40 @@ type ObjectServiceClient interface { // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) + // Put the prepared object into container. + // `ContainerID`, `ObjectID` and `OwnerID` of an object + // MUST be set. Session token MUST be obtained before `PUT SINGLE` operation (see + // session package). + // + // Extended headers can change `Put` behaviour: + // - [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // + // been deleted; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + PutSingle(ctx context.Context, in *PutSingleRequest, opts ...grpc.CallOption) (*PutSingleResponse, error) } type objectServiceClient struct { @@ -410,6 +445,15 @@ func (c *objectServiceClient) GetRangeHash(ctx context.Context, in *GetRangeHash return out, nil } +func (c *objectServiceClient) PutSingle(ctx context.Context, in *PutSingleRequest, opts ...grpc.CallOption) (*PutSingleResponse, error) { + out := new(PutSingleResponse) + err := c.cc.Invoke(ctx, ObjectService_PutSingle_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ObjectServiceServer is the server API for ObjectService service. // All implementations should embed UnimplementedObjectServiceServer // for forward compatibility @@ -625,6 +669,40 @@ type ObjectServiceServer interface { // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) + // Put the prepared object into container. + // `ContainerID`, `ObjectID` and `OwnerID` of an object + // MUST be set. Session token MUST be obtained before `PUT SINGLE` operation (see + // session package). + // + // Extended headers can change `Put` behaviour: + // - [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // + // been deleted; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error) } // UnimplementedObjectServiceServer should be embedded to have forward compatible implementations. @@ -652,6 +730,9 @@ func (UnimplementedObjectServiceServer) GetRange(*GetRangeRequest, ObjectService func (UnimplementedObjectServiceServer) GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetRangeHash not implemented") } +func (UnimplementedObjectServiceServer) PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PutSingle not implemented") +} // 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 @@ -807,6 +888,24 @@ func _ObjectService_GetRangeHash_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _ObjectService_PutSingle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PutSingleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ObjectServiceServer).PutSingle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ObjectService_PutSingle_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ObjectServiceServer).PutSingle(ctx, req.(*PutSingleRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ObjectService_ServiceDesc is the grpc.ServiceDesc for ObjectService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -826,6 +925,10 @@ var ObjectService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetRangeHash", Handler: _ObjectService_GetRangeHash_Handler, }, + { + MethodName: "PutSingle", + Handler: _ObjectService_PutSingle_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 11cb63e..5c79080 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.30.0 // protoc v3.21.9 // source: object/grpc/types.proto diff --git a/object/types.go b/object/types.go index a40de57..625c1ce 100644 --- a/object/types.go +++ b/object/types.go @@ -301,6 +301,17 @@ type GetRangeHashResponse struct { session.ResponseHeaders } +type PutSingleRequestBody struct { + object *Object + copyNum []uint32 +} + +type PutSingleRequest struct { + body *PutSingleRequestBody + + session.RequestHeaders +} + const ( TypeRegular Type = iota TypeTombstone @@ -1405,3 +1416,37 @@ func (r *GetRangeHashResponse) GetBody() *GetRangeHashResponseBody { func (r *GetRangeHashResponse) SetBody(v *GetRangeHashResponseBody) { r.body = v } + +func (r *PutSingleRequest) GetBody() *PutSingleRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *PutSingleRequest) SetBody(v *PutSingleRequestBody) { + r.body = v +} + +func (b *PutSingleRequestBody) GetObject() *Object { + if b == nil { + return nil + } + return b.object +} + +func (b *PutSingleRequestBody) SetObject(o *Object) { + b.object = o +} + +func (b *PutSingleRequestBody) GetCopiesNumber() []uint32 { + if b == nil { + return nil + } + return b.copyNum +} + +func (b *PutSingleRequestBody) SetCopiesNumber(v []uint32) { + b.copyNum = v +} From 2cb57a8835671cf3e87f6e6026352c48ac9f2765 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 30 Jun 2023 15:00:51 +0300 Subject: [PATCH 053/169] [#45] api-go: Add PutSingle request wrappers Signed-off-by: Dmitrii Stepanov --- object/convert.go | 72 +++++++++++++++++++++++++++++++++++++++++ object/grpc/service.go | 25 ++++++++++++++ object/marshal.go | 35 ++++++++++++++++++++ object/message_test.go | 1 + object/test/generate.go | 22 +++++++++++++ signature/body.go | 2 ++ 6 files changed, 157 insertions(+) diff --git a/object/convert.go b/object/convert.go index 7099b4c..63f8def 100644 --- a/object/convert.go +++ b/object/convert.go @@ -2042,3 +2042,75 @@ func (r *GetRangeHashResponse) FromGRPCMessage(m grpc.Message) error { return r.ResponseHeaders.FromMessage(v) } + +func (r *PutSingleRequestBody) ToGRPCMessage() grpc.Message { + var m *object.PutSingleRequest_Body + + if r != nil { + m = new(object.PutSingleRequest_Body) + m.SetObject(r.GetObject().ToGRPCMessage().(*object.Object)) + m.SetCopiesNumber(r.GetCopiesNumber()) + } + + return m +} + +func (r *PutSingleRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PutSingleRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + if v.GetObject() == nil { + r.object = nil + } else { + if r.object == nil { + r.object = new(Object) + } + + err := r.object.FromGRPCMessage(v.GetObject()) + if err != nil { + return err + } + } + + r.copyNum = v.GetCopiesNumber() + + return nil +} + +func (r *PutSingleRequest) ToGRPCMessage() grpc.Message { + var m *object.PutSingleRequest + + if r != nil { + m = new(object.PutSingleRequest) + + m.SetBody(r.body.ToGRPCMessage().(*object.PutSingleRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *PutSingleRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PutSingleRequest) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + body := v.GetBody() + if body == nil { + r.body = nil + } else { + if r.body == nil { + r.body = new(PutSingleRequestBody) + } + + err := r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} diff --git a/object/grpc/service.go b/object/grpc/service.go index 74dc168..7e870a1 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -495,3 +495,28 @@ func (m *GetRangeHashResponse) SetMetaHeader(v *session.ResponseMetaHeader) { func (m *GetRangeHashResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { m.VerifyHeader = v } + +// SetObject set object of the body. +func (m *PutSingleRequest_Body) SetObject(o *Object) { + m.Object = o +} + +// SetCopiesNumber sets copies number of the body. +func (m *PutSingleRequest_Body) SetCopiesNumber(v []uint32) { + m.CopiesNumber = v +} + +// SetBody sets body of the request. +func (m *PutSingleRequest) SetBody(b *PutSingleRequest_Body) { + m.Body = b +} + +// SetMetaHeader sets meta header of the request. +func (m *PutSingleRequest) SetMetaHeader(v *session.RequestMetaHeader) { + m.MetaHeader = v +} + +// SetVerifyHeader sets verification header of the request. +func (m *PutSingleRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { + m.VerifyHeader = v +} diff --git a/object/marshal.go b/object/marshal.go index 7a89b97..f210f44 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -110,6 +110,9 @@ const ( getRangeHashRespBodyTypeField = 1 getRangeHashRespBodyHashListField = 2 + + putSingleReqObjectField = 1 + putSingleReqCopiesNumberField = 2 ) func (h *ShortHeader) StableMarshal(buf []byte) []byte { @@ -1063,3 +1066,35 @@ func (r *GetRangeHashResponseBody) StableSize() (size int) { func (r *GetRangeHashResponseBody) Unmarshal(data []byte) error { return message.Unmarshal(r, data, new(object.GetRangeHashResponse_Body)) } + +func (r *PutSingleRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + offset += proto.NestedStructureMarshal(putSingleReqObjectField, buf[offset:], r.object) + proto.RepeatedUInt32Marshal(putSingleReqCopiesNumberField, buf[offset:], r.copyNum) + + return buf +} + +func (r *PutSingleRequestBody) StableSize() int { + if r == nil { + return 0 + } + + var size int + size += proto.NestedStructureSize(putSingleReqObjectField, r.object) + arrSize, _ := proto.RepeatedUInt32Size(putSingleReqCopiesNumberField, r.copyNum) + size += arrSize + + return size +} + +func (r *PutSingleRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.PutSingleRequest_Body)) +} diff --git a/object/message_test.go b/object/message_test.go index c690e66..ecf0425 100644 --- a/object/message_test.go +++ b/object/message_test.go @@ -51,5 +51,6 @@ func TestMessageConvert(t *testing.T) { func(empty bool) message.Message { return objecttest.GenerateGetRangeHashResponseBody(empty) }, func(empty bool) message.Message { return objecttest.GenerateGetRangeHashResponse(empty) }, func(empty bool) message.Message { return objecttest.GenerateLock(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePutSingleRequest(empty) }, ) } diff --git a/object/test/generate.go b/object/test/generate.go index 32d7a3c..4f163d2 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -610,3 +610,25 @@ func GenerateLock(empty bool) *object.Lock { return m } + +func GeneratePutSingleRequest(empty bool) *object.PutSingleRequest { + m := new(object.PutSingleRequest) + + if !empty { + m.SetBody(GeneratePutSingleRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GeneratePutSingleRequestBody(empty bool) *object.PutSingleRequestBody { + b := new(object.PutSingleRequestBody) + if !empty { + b.SetObject(GenerateObject(empty)) + b.SetCopiesNumber([]uint32{12345}) + } + return b +} diff --git a/signature/body.go b/signature/body.go index 6d43249..68c361d 100644 --- a/signature/body.go +++ b/signature/body.go @@ -87,6 +87,8 @@ func serviceMessageBody(req any) stableMarshaler { return v.GetBody() case *object.GetRangeHashResponse: return v.GetBody() + case *object.PutSingleRequest: + return v.GetBody() /* Netmap */ case *netmap.LocalNodeInfoRequest: From d5b55d092692e71f5065f75d75456af2d2222167 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 30 Jun 2023 16:05:37 +0300 Subject: [PATCH 054/169] [#45] api-go: Add PutSingle response wrappers Signed-off-by: Dmitrii Stepanov --- object/convert.go | 55 +++++++++++++++++++++++++++++++++++++++++ object/grpc/service.go | 15 +++++++++++ object/marshal.go | 20 +++++++++++++++ object/message_test.go | 1 + object/test/generate.go | 10 ++++++++ object/types.go | 21 ++++++++++++++++ signature/body.go | 2 ++ 7 files changed, 124 insertions(+) diff --git a/object/convert.go b/object/convert.go index 63f8def..07bf89c 100644 --- a/object/convert.go +++ b/object/convert.go @@ -2114,3 +2114,58 @@ func (r *PutSingleRequest) FromGRPCMessage(m grpc.Message) error { return r.RequestHeaders.FromMessage(v) } + +func (r *PutSingleResponseBody) ToGRPCMessage() grpc.Message { + var b *object.PutSingleResponse_Body + if r != nil { + b = new(object.PutSingleResponse_Body) + } + return b +} + +func (r *PutSingleResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PutSingleResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + return nil +} + +func (r *PutSingleResponse) ToGRPCMessage() grpc.Message { + var m *object.PutSingleResponse + + if r != nil { + m = new(object.PutSingleResponse) + + m.SetBody(r.body.ToGRPCMessage().(*object.PutSingleResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *PutSingleResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PutSingleResponse) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + r.body = nil + } else { + if r.body == nil { + r.body = new(PutSingleResponseBody) + } + + err = r.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} diff --git a/object/grpc/service.go b/object/grpc/service.go index 7e870a1..27645dd 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -520,3 +520,18 @@ func (m *PutSingleRequest) SetMetaHeader(v *session.RequestMetaHeader) { func (m *PutSingleRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { m.VerifyHeader = v } + +// SetBody sets body of the response. +func (m *PutSingleResponse) SetBody(b *PutSingleResponse_Body) { + m.Body = b +} + +// SetMetaHeader sets meta header of the response. +func (m *PutSingleResponse) SetMetaHeader(v *session.ResponseMetaHeader) { + m.MetaHeader = v +} + +// SetVerifyHeader sets verification header of the response. +func (m *PutSingleResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { + m.VerifyHeader = v +} diff --git a/object/marshal.go b/object/marshal.go index f210f44..fe0e232 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -1098,3 +1098,23 @@ func (r *PutSingleRequestBody) StableSize() int { func (r *PutSingleRequestBody) Unmarshal(data []byte) error { return message.Unmarshal(r, data, new(object.PutSingleRequest_Body)) } + +func (r *PutSingleResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + return buf +} + +func (r *PutSingleResponseBody) StableSize() int { + return 0 +} + +func (r *PutSingleResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.PutSingleResponse_Body)) +} diff --git a/object/message_test.go b/object/message_test.go index ecf0425..a111c60 100644 --- a/object/message_test.go +++ b/object/message_test.go @@ -52,5 +52,6 @@ func TestMessageConvert(t *testing.T) { func(empty bool) message.Message { return objecttest.GenerateGetRangeHashResponse(empty) }, func(empty bool) message.Message { return objecttest.GenerateLock(empty) }, func(empty bool) message.Message { return objecttest.GeneratePutSingleRequest(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePutSingleResponse(empty) }, ) } diff --git a/object/test/generate.go b/object/test/generate.go index 4f163d2..fca772c 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -632,3 +632,13 @@ func GeneratePutSingleRequestBody(empty bool) *object.PutSingleRequestBody { } return b } + +func GeneratePutSingleResponse(empty bool) *object.PutSingleResponse { + m := new(object.PutSingleResponse) + if !empty { + m.SetBody(new(object.PutSingleResponseBody)) + } + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + return m +} diff --git a/object/types.go b/object/types.go index 625c1ce..d22b428 100644 --- a/object/types.go +++ b/object/types.go @@ -312,6 +312,15 @@ type PutSingleRequest struct { session.RequestHeaders } +type PutSingleResponseBody struct { +} + +type PutSingleResponse struct { + body *PutSingleResponseBody + + session.ResponseHeaders +} + const ( TypeRegular Type = iota TypeTombstone @@ -1450,3 +1459,15 @@ func (b *PutSingleRequestBody) GetCopiesNumber() []uint32 { func (b *PutSingleRequestBody) SetCopiesNumber(v []uint32) { b.copyNum = v } + +func (r *PutSingleResponse) GetBody() *PutSingleResponseBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *PutSingleResponse) SetBody(v *PutSingleResponseBody) { + r.body = v +} diff --git a/signature/body.go b/signature/body.go index 68c361d..b7bb6b4 100644 --- a/signature/body.go +++ b/signature/body.go @@ -89,6 +89,8 @@ func serviceMessageBody(req any) stableMarshaler { return v.GetBody() case *object.PutSingleRequest: return v.GetBody() + case *object.PutSingleResponse: + return v.GetBody() /* Netmap */ case *netmap.LocalNodeInfoRequest: From 285516a94ebe4c4f1116c01ecd2c73e106e832fd Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 30 Jun 2023 16:07:57 +0300 Subject: [PATCH 055/169] [#45] api-go: Add PutSingle RPC call Signed-off-by: Dmitrii Stepanov --- rpc/object.go | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/rpc/object.go b/rpc/object.go index 1cac1c7..1eca922 100644 --- a/rpc/object.go +++ b/rpc/object.go @@ -10,13 +10,14 @@ import ( const serviceObject = serviceNamePrefix + "object.ObjectService" const ( - rpcObjectPut = "Put" - rpcObjectGet = "Get" - rpcObjectSearch = "Search" - rpcObjectRange = "GetRange" - rpcObjectHash = "GetRangeHash" - rpcObjectHead = "Head" - rpcObjectDelete = "Delete" + rpcObjectPut = "Put" + rpcObjectGet = "Get" + rpcObjectSearch = "Search" + rpcObjectRange = "GetRange" + rpcObjectHash = "GetRangeHash" + rpcObjectHead = "Head" + rpcObjectDelete = "Delete" + rpcObjectPutSingle = "PutSingle" ) // PutRequestWriter is an object.PutRequest @@ -188,3 +189,19 @@ func HashObjectRange( return resp, nil } + +// PutSingleObject executes ObjectService.PutSingle RPC. +func PutSingleObject( + cli *client.Client, + req *object.PutSingleRequest, + opts ...client.CallOption, +) (*object.PutSingleResponse, error) { + resp := new(object.PutSingleResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceObject, rpcObjectPutSingle), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} From 582d94c81c74cff8b0338603a50a296bee34871e Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 19 Jul 2023 13:00:26 +0300 Subject: [PATCH 056/169] [#47] types: Fix unique flag conversion Signed-off-by: Airat Arifullin a.arifullin@yadro.com --- netmap/convert.go | 3 +++ netmap/grpc/types.go | 5 +++++ netmap/test/generate.go | 1 + 3 files changed, 9 insertions(+) diff --git a/netmap/convert.go b/netmap/convert.go index 6bb1525..0e25949 100644 --- a/netmap/convert.go +++ b/netmap/convert.go @@ -198,6 +198,7 @@ func (p *PlacementPolicy) ToGRPCMessage() grpc.Message { m.SetSelectors(SelectorsToGRPC(p.selectors)) m.SetReplicas(ReplicasToGRPC(p.replicas)) m.SetContainerBackupFactor(p.backupFactor) + m.SetUnique(p.unique) } return m @@ -228,6 +229,8 @@ func (p *PlacementPolicy) FromGRPCMessage(m grpc.Message) error { p.backupFactor = v.GetContainerBackupFactor() + p.unique = v.GetUnique() + return nil } diff --git a/netmap/grpc/types.go b/netmap/grpc/types.go index f312bbb..f4e90f8 100644 --- a/netmap/grpc/types.go +++ b/netmap/grpc/types.go @@ -20,6 +20,11 @@ func (m *PlacementPolicy) SetFilters(v []*Filter) { m.Filters = v } +// SetUnique of placement policy. +func (m *PlacementPolicy) SetUnique(unique bool) { + m.Unique = unique +} + // SetName of placement filter. func (m *Filter) SetName(v string) { m.Name = v diff --git a/netmap/test/generate.go b/netmap/test/generate.go index 400d24c..260a024 100644 --- a/netmap/test/generate.go +++ b/netmap/test/generate.go @@ -102,6 +102,7 @@ func GeneratePlacementPolicy(empty bool) *netmap.PlacementPolicy { m.SetFilters(GenerateFilters(false)) m.SetSelectors(GenerateSelectors(false)) m.SetReplicas(GenerateReplicas(false)) + m.SetUnique(true) } return m From 59c8421597854a99840027e73b962d48e601292b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 26 Jul 2023 16:53:20 +0300 Subject: [PATCH 057/169] [#49] util/proto: Use StableSize() to determine if the struct is empty `reflect` is not necessary here, and checking `StableSize` is what we _want_ anyway. Signed-off-by: Evgenii Stratonikov --- status/marshal.go | 4 ++++ util/proto/marshal.go | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/status/marshal.go b/status/marshal.go index 78064c1..1868a43 100644 --- a/status/marshal.go +++ b/status/marshal.go @@ -69,6 +69,10 @@ func (x *Status) StableMarshal(buf []byte) []byte { } func (x *Status) StableSize() (size int) { + if x == nil { + return 0 + } + size += protoutil.UInt32Size(statusCodeFNum, CodeToGRPC(x.code)) size += protoutil.StringSize(statusMsgFNum, x.msg) diff --git a/util/proto/marshal.go b/util/proto/marshal.go index a82478b..ff0d30b 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -10,7 +10,6 @@ import ( "encoding/binary" "math" "math/bits" - "reflect" ) type ( @@ -303,14 +302,13 @@ func NestedStructurePrefix(field int64) (prefix uint64, ln int) { } func NestedStructureMarshal(field int64, buf []byte, v stableMarshaller) int { - if v == nil || reflect.ValueOf(v).IsNil() { + n := v.StableSize() + if n == 0 { return 0 } prefix, _ := NestedStructurePrefix(field) offset := binary.PutUvarint(buf, prefix) - - n := v.StableSize() offset += binary.PutUvarint(buf[offset:], uint64(n)) v.StableMarshal(buf[offset:]) @@ -318,12 +316,12 @@ func NestedStructureMarshal(field int64, buf []byte, v stableMarshaller) int { } func NestedStructureSize(field int64, v stableMarshaller) (size int) { - if v == nil || reflect.ValueOf(v).IsNil() { + n := v.StableSize() + if n == 0 { return 0 } _, ln := NestedStructurePrefix(field) - n := v.StableSize() size = ln + VarUIntSize(uint64(n)) + n return size From 849de02bc3968ec69fda328d6a7c673bbbbd0928 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 26 Jul 2023 17:52:54 +0300 Subject: [PATCH 058/169] [#49] util/proto: Calculate repeated field size without allocations Signed-off-by: Evgenii Stratonikov --- util/proto/marshal.go | 100 ++++++++++++------------------------------ 1 file changed, 27 insertions(+), 73 deletions(-) diff --git a/util/proto/marshal.go b/util/proto/marshal.go index ff0d30b..7bc8162 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -178,30 +178,13 @@ func RepeatedStringSize(field int, v []string) (size int) { return size } -func RepeatedUInt64Marshal(field int, buf []byte, v []uint64) int { - if len(v) == 0 { - return 0 - } - - prefix := field<<3 | 0x02 - offset := binary.PutUvarint(buf, uint64(prefix)) - - _, arrSize := RepeatedUInt64Size(field, v) - offset += binary.PutUvarint(buf[offset:], uint64(arrSize)) - for i := range v { - offset += binary.PutUvarint(buf[offset:], v[i]) - } - - return offset -} - -func RepeatedUInt64Size(field int, v []uint64) (size, arraySize int) { +func repeatedUIntSize[T ~uint64 | ~int64 | ~uint32 | ~int32](field int, v []T) (size, arraySize int) { if len(v) == 0 { return 0, 0 } for i := range v { - size += VarUIntSize(v[i]) + size += VarUIntSize(uint64(v[i])) } arraySize = size @@ -213,82 +196,53 @@ func RepeatedUInt64Size(field int, v []uint64) (size, arraySize int) { return size, arraySize } -func RepeatedInt64Marshal(field int, buf []byte, v []int64) int { +func repeatedUIntMarshal[T ~uint64 | ~int64 | ~uint32 | ~int32](field int, buf []byte, v []T) int { if len(v) == 0 { return 0 } - convert := make([]uint64, len(v)) + prefix := field<<3 | 0x02 + offset := binary.PutUvarint(buf, uint64(prefix)) + + _, arrSize := repeatedUIntSize(field, v) + offset += binary.PutUvarint(buf[offset:], uint64(arrSize)) for i := range v { - convert[i] = uint64(v[i]) + offset += binary.PutUvarint(buf[offset:], uint64(v[i])) } - return RepeatedUInt64Marshal(field, buf, convert) + return offset +} + +func RepeatedUInt64Marshal(field int, buf []byte, v []uint64) int { + return repeatedUIntMarshal(field, buf, v) +} + +func RepeatedUInt64Size(field int, v []uint64) (size, arraySize int) { + return repeatedUIntSize(field, v) +} + +func RepeatedInt64Marshal(field int, buf []byte, v []int64) int { + return repeatedUIntMarshal(field, buf, v) } func RepeatedInt64Size(field int, v []int64) (size, arraySize int) { - if len(v) == 0 { - return 0, 0 - } - - convert := make([]uint64, len(v)) - for i := range v { - convert[i] = uint64(v[i]) - } - - return RepeatedUInt64Size(field, convert) + return repeatedUIntSize(field, v) } func RepeatedUInt32Marshal(field int, buf []byte, v []uint32) int { - if len(v) == 0 { - return 0 - } - - convert := make([]uint64, len(v)) - for i := range v { - convert[i] = uint64(v[i]) - } - - return RepeatedUInt64Marshal(field, buf, convert) + return repeatedUIntMarshal(field, buf, v) } func RepeatedUInt32Size(field int, v []uint32) (size, arraySize int) { - if len(v) == 0 { - return 0, 0 - } - - convert := make([]uint64, len(v)) - for i := range v { - convert[i] = uint64(v[i]) - } - - return RepeatedUInt64Size(field, convert) + return repeatedUIntSize(field, v) } func RepeatedInt32Marshal(field int, buf []byte, v []int32) int { - if len(v) == 0 { - return 0 - } - - convert := make([]uint64, len(v)) - for i := range v { - convert[i] = uint64(v[i]) - } - - return RepeatedUInt64Marshal(field, buf, convert) + return repeatedUIntMarshal(field, buf, v) } func RepeatedInt32Size(field int, v []int32) (size, arraySize int) { - if len(v) == 0 { - return 0, 0 - } - - convert := make([]uint64, len(v)) - for i := range v { - convert[i] = uint64(v[i]) - } - - return RepeatedUInt64Size(field, convert) + return repeatedUIntSize(field, v) } // VarUIntSize returns length of varint byte sequence for uint64 value 'x'. From 6e92d7d5de6ba6b346b0c8d27c1801b5a0c73580 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 26 Jul 2023 18:12:27 +0300 Subject: [PATCH 059/169] [#49] util/proto: Make `NestedStructure*` generic Signed-off-by: Evgenii Stratonikov --- util/proto/marshal.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/proto/marshal.go b/util/proto/marshal.go index 7bc8162..e345492 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -255,7 +255,7 @@ func NestedStructurePrefix(field int64) (prefix uint64, ln int) { return prefix, VarUIntSize(prefix) } -func NestedStructureMarshal(field int64, buf []byte, v stableMarshaller) int { +func NestedStructureMarshal[T stableMarshaller](field int64, buf []byte, v T) int { n := v.StableSize() if n == 0 { return 0 @@ -269,7 +269,7 @@ func NestedStructureMarshal(field int64, buf []byte, v stableMarshaller) int { return offset + n } -func NestedStructureSize(field int64, v stableMarshaller) (size int) { +func NestedStructureSize[T stableMarshaller](field int64, v T) (size int) { n := v.StableSize() if n == 0 { return 0 From 43ad0f114cf5ce5bd516b933ed08f721d27741a8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 26 Jul 2023 18:12:48 +0300 Subject: [PATCH 060/169] [#49] session: Make StableSize() zero-alloc For this to work, it is necessary that `NestedStructureSize` is a generic function. Otherwise, we would allocate to put it in the interface. Signed-off-by: Evgenii Stratonikov --- session/marshal.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/session/marshal.go b/session/marshal.go index 3c56cd4..cda9579 100644 --- a/session/marshal.go +++ b/session/marshal.go @@ -211,7 +211,7 @@ func (c *ObjectSessionContext) StableMarshal(buf []byte) []byte { } offset := proto.EnumMarshal(objectCtxVerbField, buf, int32(c.verb)) - proto.NestedStructureMarshal(objectCtxTargetField, buf[offset:], &objectSessionContextTarget{ + proto.NestedStructureMarshal(objectCtxTargetField, buf[offset:], objectSessionContextTarget{ cnr: c.cnr, objs: c.objs, }) @@ -225,7 +225,7 @@ func (c *ObjectSessionContext) StableSize() (size int) { } size += proto.EnumSize(objectCtxVerbField, int32(c.verb)) - size += proto.NestedStructureSize(objectCtxTargetField, &objectSessionContextTarget{ + size += proto.NestedStructureSize(objectCtxTargetField, objectSessionContextTarget{ cnr: c.cnr, objs: c.objs, }) From 7133a01ccf50844b39414e804d18a10b6c890a90 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 26 Jul 2023 18:13:05 +0300 Subject: [PATCH 061/169] [#49] message/test: Add test for zero-alloc StableSize() Signed-off-by: Evgenii Stratonikov --- rpc/message/test/message.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpc/message/test/message.go b/rpc/message/test/message.go index df769d2..435f20a 100644 --- a/rpc/message/test/message.go +++ b/rpc/message/test/message.go @@ -17,6 +17,7 @@ type jsonMessage interface { type binaryMessage interface { StableMarshal([]byte) []byte + StableSize() int Unmarshal([]byte) error } @@ -53,6 +54,11 @@ func TestRPCMessage(t *testing.T, msgGens ...func(empty bool) message.Message) { } if bm, ok := msg.(binaryMessage); ok { + t.Run(fmt.Sprintf("%T.StableSize() does no allocations", bm), func(t *testing.T) { + require.Zero(t, testing.AllocsPerRun(1000, func() { + _ = bm.StableSize() + })) + }) t.Run(fmt.Sprintf("Binary_%T", msg), func(t *testing.T) { data := bm.StableMarshal(nil) From 7a5ee927c8a272ff97f26cd8b7aa65a4c9d6d161 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 26 Jul 2023 18:51:37 +0300 Subject: [PATCH 062/169] [#49] util/proto: Do not allocate in StringSize() It was not catched by the test because most of the time the function is inlined. However, I've seen it allocating with pprof in one of the earlier builds. Signed-off-by: Evgenii Stratonikov --- util/proto/marshal.go | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/util/proto/marshal.go b/util/proto/marshal.go index e345492..b1f55a3 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -20,13 +20,21 @@ type ( ) func BytesMarshal(field int, buf, v []byte) int { - if len(v) == 0 { - return 0 - } return bytesMarshal(field, buf, v) } -func bytesMarshal(field int, buf, v []byte) int { +func BytesSize(field int, v []byte) int { + return bytesSize(field, v) +} + +func bytesMarshal[T ~[]byte | ~string](field int, buf []byte, v T) int { + if len(v) == 0 { + return 0 + } + return bytesMarshalNoCheck(field, buf, v) +} + +func bytesMarshalNoCheck[T ~[]byte | ~string](field int, buf []byte, v T) int { prefix := field<<3 | 0x2 // buf length check can prevent panic at PutUvarint, but it will make @@ -38,26 +46,25 @@ func bytesMarshal(field int, buf, v []byte) int { return i } -func BytesSize(field int, v []byte) int { - ln := len(v) - if ln == 0 { +func bytesSize[T ~[]byte | ~string](field int, v T) int { + if len(v) == 0 { return 0 } - return bytesSize(field, v) + return bytesSizeNoCheck(field, v) } -func bytesSize(field int, v []byte) int { +func bytesSizeNoCheck[T ~[]byte | ~string](field int, v T) int { prefix := field<<3 | 0x2 return VarUIntSize(uint64(prefix)) + VarUIntSize(uint64(len(v))) + len(v) } func StringMarshal(field int, buf []byte, v string) int { - return BytesMarshal(field, buf, []byte(v)) + return bytesMarshal(field, buf, v) } func StringSize(field int, v string) int { - return BytesSize(field, []byte(v)) + return bytesSize(field, v) } func BoolMarshal(field int, buf []byte, v bool) int { @@ -146,7 +153,7 @@ func RepeatedBytesMarshal(field int, buf []byte, v [][]byte) int { var offset int for i := range v { - offset += bytesMarshal(field, buf[offset:], v[i]) + offset += bytesMarshalNoCheck(field, buf[offset:], v[i]) } return offset @@ -154,7 +161,7 @@ func RepeatedBytesMarshal(field int, buf []byte, v [][]byte) int { func RepeatedBytesSize(field int, v [][]byte) (size int) { for i := range v { - size += bytesSize(field, v[i]) + size += bytesSizeNoCheck(field, v[i]) } return size @@ -164,7 +171,7 @@ func RepeatedStringMarshal(field int, buf []byte, v []string) int { var offset int for i := range v { - offset += bytesMarshal(field, buf[offset:], []byte(v[i])) + offset += bytesMarshalNoCheck(field, buf[offset:], v[i]) } return offset @@ -172,7 +179,7 @@ func RepeatedStringMarshal(field int, buf []byte, v []string) int { func RepeatedStringSize(field int, v []string) (size int) { for i := range v { - size += bytesSize(field, []byte(v[i])) + size += bytesSizeNoCheck(field, v[i]) } return size From 3072090c7729dd3c2727593ff099b05989f9b265 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 2 Aug 2023 10:46:01 +0300 Subject: [PATCH 063/169] [#51] protogen: Do not panic in StableSize() Refs https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/554 . Signed-off-by: Evgenii Stratonikov --- util/protogen/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/util/protogen/main.go b/util/protogen/main.go index 99f5b7b..fe89fbf 100644 --- a/util/protogen/main.go +++ b/util/protogen/main.go @@ -59,6 +59,7 @@ func emitMessage(g *protogen.GeneratedFile, msg *protogen.Message) { g.P("//") g.P("// Structures with the same field values have the same binary size.") g.P("func (x *", msg.GoIdent.GoName, ") StableSize() (size int) {") + g.P("if x == nil { return 0 }") if len(fs) != 0 { for _, f := range fs { if f.Desc.IsList() && marshalers[f.Desc.Kind()].RepeatedDouble { From 964c3edb3f44306378cdb40adffbc0b68318d1d8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 2 Aug 2023 10:55:05 +0300 Subject: [PATCH 064/169] [#51] *: Do not panic in StableSize() After #49 it can be called on nil structures. Signed-off-by: Evgenii Stratonikov --- netmap/marshal.go | 16 ++++++++++++++++ status/marshal.go | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/netmap/marshal.go b/netmap/marshal.go index bf559ce..4f2c1ce 100644 --- a/netmap/marshal.go +++ b/netmap/marshal.go @@ -65,6 +65,10 @@ func (f *Filter) StableMarshal(buf []byte) []byte { } func (f *Filter) StableSize() (size int) { + if f == nil { + return 0 + } + size += protoutil.StringSize(nameFilterField, f.name) size += protoutil.StringSize(keyFilterField, f.key) size += protoutil.EnumSize(opFilterField, int32(f.op)) @@ -101,6 +105,10 @@ func (s *Selector) StableMarshal(buf []byte) []byte { } func (s *Selector) StableSize() (size int) { + if s == nil { + return 0 + } + size += protoutil.StringSize(nameSelectorField, s.name) size += protoutil.UInt32Size(countSelectorField, s.count) size += protoutil.EnumSize(countSelectorField, int32(s.clause)) @@ -132,6 +140,10 @@ func (r *Replica) StableMarshal(buf []byte) []byte { } func (r *Replica) StableSize() (size int) { + if r == nil { + return 0 + } + size += protoutil.UInt32Size(countReplicaField, r.count) size += protoutil.StringSize(selectorReplicaField, r.selector) @@ -173,6 +185,10 @@ func (p *PlacementPolicy) StableMarshal(buf []byte) []byte { } func (p *PlacementPolicy) StableSize() (size int) { + if p == nil { + return 0 + } + for i := range p.replicas { size += protoutil.NestedStructureSize(replicasPolicyField, &p.replicas[i]) } diff --git a/status/marshal.go b/status/marshal.go index 1868a43..2908e0d 100644 --- a/status/marshal.go +++ b/status/marshal.go @@ -30,6 +30,10 @@ func (x *Detail) StableMarshal(buf []byte) []byte { } func (x *Detail) StableSize() (size int) { + if x == nil { + return 0 + } + size += protoutil.UInt32Size(detailIDFNum, x.id) size += protoutil.BytesSize(detailValueFNum, x.val) From 67b18d3550471d63e8e6ab416dea6a2a8a77287d Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 9 Aug 2023 09:54:56 +0300 Subject: [PATCH 065/169] [#53] Bump min go version to go1.20 Signed-off-by: Evgenii Stratonikov --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index f7eedf6..78c1bdb 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 -go 1.19 +go 1.20 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 From 9a7b47d769c5087a46d6785aa0ac6696027e9d95 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 2 Aug 2023 16:53:47 +0300 Subject: [PATCH 066/169] [#50] util: Use protowire for util/proto helpers * Use methods to calculate size Signed-off-by: Airat Arifullin a.arifullin@yadro.com --- refs/marshal.go | 3 +- util/proto/marshal.go | 73 ++++++++++++++----------------------------- 2 files changed, 26 insertions(+), 50 deletions(-) diff --git a/refs/marshal.go b/refs/marshal.go index 0382190..ef197b3 100644 --- a/refs/marshal.go +++ b/refs/marshal.go @@ -6,6 +6,7 @@ import ( refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + "google.golang.org/protobuf/encoding/protowire" ) const ( @@ -116,7 +117,7 @@ func (o *ObjectID) StableSize() int { // ObjectIDNestedListMarshal writes protobuf repeated ObjectID field // with fNum number to buf. func ObjectIDNestedListMarshal(fNum int64, buf []byte, ids []ObjectID) (off int) { - prefix, _ := proto.NestedStructurePrefix(fNum) + prefix := protowire.EncodeTag(protowire.Number(fNum), protowire.BytesType) for i := range ids { off += binary.PutUvarint(buf[off:], prefix) diff --git a/util/proto/marshal.go b/util/proto/marshal.go index b1f55a3..606086a 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -10,6 +10,8 @@ import ( "encoding/binary" "math" "math/bits" + + "google.golang.org/protobuf/encoding/protowire" ) type ( @@ -35,7 +37,7 @@ func bytesMarshal[T ~[]byte | ~string](field int, buf []byte, v T) int { } func bytesMarshalNoCheck[T ~[]byte | ~string](field int, buf []byte, v T) int { - prefix := field<<3 | 0x2 + prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) // buf length check can prevent panic at PutUvarint, but it will make // marshaller a bit slower. @@ -54,9 +56,7 @@ func bytesSize[T ~[]byte | ~string](field int, v T) int { } func bytesSizeNoCheck[T ~[]byte | ~string](field int, v T) int { - prefix := field<<3 | 0x2 - - return VarUIntSize(uint64(prefix)) + VarUIntSize(uint64(len(v))) + len(v) + return protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(len(v))) } func StringMarshal(field int, buf []byte, v string) int { @@ -72,12 +72,13 @@ func BoolMarshal(field int, buf []byte, v bool) int { return 0 } - prefix := field << 3 + prefix := protowire.EncodeTag(protowire.Number(field), protowire.VarintType) // buf length check can prevent panic at PutUvarint, but it will make // marshaller a bit slower. i := binary.PutUvarint(buf, uint64(prefix)) - buf[i] = 0x1 + const boolTrueValue = 0x1 + buf[i] = boolTrueValue return i + 1 } @@ -86,10 +87,8 @@ func BoolSize(field int, v bool) int { if !v { return 0 } - - prefix := field << 3 - - return VarUIntSize(uint64(prefix)) + 1 // bool is always 1 byte long + const boolLength = 1 + return protowire.SizeGroup(protowire.Number(field), boolLength) } func UInt64Marshal(field int, buf []byte, v uint64) int { @@ -97,7 +96,7 @@ func UInt64Marshal(field int, buf []byte, v uint64) int { return 0 } - prefix := field << 3 + prefix := protowire.EncodeTag(protowire.Number(field), protowire.VarintType) // buf length check can prevent panic at PutUvarint, but it will make // marshaller a bit slower. @@ -111,10 +110,7 @@ func UInt64Size(field int, v uint64) int { if v == 0 { return 0 } - - prefix := field << 3 - - return VarUIntSize(uint64(prefix)) + VarUIntSize(v) + return protowire.SizeGroup(protowire.Number(field), protowire.SizeVarint(v)) } func Int64Marshal(field int, buf []byte, v int64) int { @@ -191,16 +187,12 @@ func repeatedUIntSize[T ~uint64 | ~int64 | ~uint32 | ~int32](field int, v []T) ( } for i := range v { - size += VarUIntSize(uint64(v[i])) + arraySize += protowire.SizeVarint(uint64(v[i])) } - arraySize = size - size += VarUIntSize(uint64(size)) + size = protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(arraySize)) - prefix := field<<3 | 0x2 - size += VarUIntSize(uint64(prefix)) - - return size, arraySize + return } func repeatedUIntMarshal[T ~uint64 | ~int64 | ~uint32 | ~int32](field int, buf []byte, v []T) int { @@ -208,7 +200,7 @@ func repeatedUIntMarshal[T ~uint64 | ~int64 | ~uint32 | ~int32](field int, buf [ return 0 } - prefix := field<<3 | 0x02 + prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) offset := binary.PutUvarint(buf, uint64(prefix)) _, arrSize := repeatedUIntSize(field, v) @@ -257,18 +249,13 @@ func VarUIntSize(x uint64) int { return (bits.Len64(x|1) + 6) / 7 } -func NestedStructurePrefix(field int64) (prefix uint64, ln int) { - prefix = uint64(field<<3 | 0x02) - return prefix, VarUIntSize(prefix) -} - func NestedStructureMarshal[T stableMarshaller](field int64, buf []byte, v T) int { n := v.StableSize() if n == 0 { return 0 } - prefix, _ := NestedStructurePrefix(field) + prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) offset := binary.PutUvarint(buf, prefix) offset += binary.PutUvarint(buf[offset:], uint64(n)) v.StableMarshal(buf[offset:]) @@ -281,11 +268,8 @@ func NestedStructureSize[T stableMarshaller](field int64, v T) (size int) { if n == 0 { return 0 } - - _, ln := NestedStructurePrefix(field) - size = ln + VarUIntSize(uint64(n)) + n - - return size + size = protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(n)) + return } func Fixed64Marshal(field int, buf []byte, v uint64) int { @@ -293,7 +277,7 @@ func Fixed64Marshal(field int, buf []byte, v uint64) int { return 0 } - prefix := field<<3 | 1 + prefix := protowire.EncodeTag(protowire.Number(field), protowire.Fixed64Type) // buf length check can prevent panic at PutUvarint, but it will make // marshaller a bit slower. @@ -307,10 +291,7 @@ func Fixed64Size(fNum int, v uint64) int { if v == 0 { return 0 } - - prefix := fNum<<3 | 1 - - return VarUIntSize(uint64(prefix)) + 8 + return protowire.SizeGroup(protowire.Number(fNum), protowire.SizeFixed64()) } func Float64Marshal(field int, buf []byte, v float64) int { @@ -318,7 +299,7 @@ func Float64Marshal(field int, buf []byte, v float64) int { return 0 } - prefix := field<<3 | 1 + prefix := protowire.EncodeTag(protowire.Number(field), protowire.Fixed64Type) i := binary.PutUvarint(buf, uint64(prefix)) binary.LittleEndian.PutUint64(buf[i:], math.Float64bits(v)) @@ -330,10 +311,7 @@ func Float64Size(fNum int, v float64) int { if v == 0 { return 0 } - - prefix := fNum<<3 | 1 - - return VarUIntSize(uint64(prefix)) + 8 + return protowire.SizeGroup(protowire.Number(fNum), protowire.SizeFixed64()) } // Fixed32Marshal encodes uint32 value to Protocol Buffers fixed32 field with specified number, @@ -345,7 +323,7 @@ func Fixed32Marshal(field int, buf []byte, v uint32) int { return 0 } - prefix := field<<3 | 5 + prefix := protowire.EncodeTag(protowire.Number(field), protowire.Fixed32Type) // buf length check can prevent panic at PutUvarint, but it will make // marshaller a bit slower. @@ -361,8 +339,5 @@ func Fixed32Size(fNum int, v uint32) int { if v == 0 { return 0 } - - prefix := fNum<<3 | 5 - - return VarUIntSize(uint64(prefix)) + 4 + return protowire.SizeGroup(protowire.Number(fNum), protowire.SizeFixed32()) } From 0671f42ee185d0a80d276c9d30aabf720cf43ecc Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 11 Aug 2023 12:26:59 +0300 Subject: [PATCH 067/169] [#54] .forgejo: Add DCO action Signed-off-by: Evgenii Stratonikov --- .forgejo/workflows/dco.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .forgejo/workflows/dco.yml diff --git a/.forgejo/workflows/dco.yml b/.forgejo/workflows/dco.yml new file mode 100644 index 0000000..6746408 --- /dev/null +++ b/.forgejo/workflows/dco.yml @@ -0,0 +1,21 @@ +name: DCO action +on: [pull_request] + +jobs: + dco: + name: DCO + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.21' + + - name: Run commit format checker + uses: https://git.frostfs.info/TrueCloudLab/dco-go@v2 + with: + from: 'origin/${{ github.event.pull_request.base.ref }}' From d989c8d2a34983264bf38954bec19e7d7e3ab076 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 11 Aug 2023 15:21:17 +0300 Subject: [PATCH 068/169] [#54] *: Fix linter warnings Signed-off-by: Evgenii Stratonikov --- internal/random/rand.go | 15 --------------- object/test/generate.go | 16 +++++++++++----- session/test/generate.go | 10 ++++++++-- 3 files changed, 19 insertions(+), 22 deletions(-) delete mode 100644 internal/random/rand.go diff --git a/internal/random/rand.go b/internal/random/rand.go deleted file mode 100644 index db2c087..0000000 --- a/internal/random/rand.go +++ /dev/null @@ -1,15 +0,0 @@ -package random - -import ( - "math/rand" - "time" -) - -func init() { - rand.Seed(time.Now().UnixNano()) -} - -// Uint32 returns random uint32 value [0, max). -func Uint32(max uint32) uint32 { - return rand.Uint32() % max -} diff --git a/object/test/generate.go b/object/test/generate.go index fca772c..085880c 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -1,7 +1,9 @@ package objecttest import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/internal/random" + "math/rand" + "time" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" @@ -186,7 +188,7 @@ func GenerateGetResponseBody(empty bool) *object.GetResponseBody { m := new(object.GetResponseBody) if !empty { - switch random.Uint32(3) { + switch randomInt(3) { case 0: m.SetObjectPart(GenerateGetObjectPartInit(false)) case 1: @@ -240,7 +242,7 @@ func GeneratePutRequestBody(empty bool) *object.PutRequestBody { m := new(object.PutRequestBody) if !empty { - switch random.Uint32(2) { + switch randomInt(2) { case 0: m.SetObjectPart(GeneratePutObjectPartInit(false)) case 1: @@ -362,7 +364,7 @@ func GenerateHeadResponseBody(empty bool) *object.HeadResponseBody { m := new(object.HeadResponseBody) if !empty { - switch random.Uint32(3) { + switch randomInt(3) { case 0: m.SetHeaderPart(GenerateHeaderWithSignature(false)) case 1: @@ -524,7 +526,7 @@ func GenerateGetRangeResponseBody(empty bool) *object.GetRangeResponseBody { m := new(object.GetRangeResponseBody) if !empty { - switch random.Uint32(2) { + switch randomInt(2) { case 0: m.SetRangePart(GenerateGetRangePartChunk(false)) case 1: @@ -642,3 +644,7 @@ func GeneratePutSingleResponse(empty bool) *object.PutSingleResponse { m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) return m } + +func randomInt(n int) int { + return rand.New(rand.NewSource(time.Now().UnixNano())).Intn(n) +} diff --git a/session/test/generate.go b/session/test/generate.go index cfce6cd..561ec01 100644 --- a/session/test/generate.go +++ b/session/test/generate.go @@ -1,8 +1,10 @@ package sessiontest import ( + "math/rand" + "time" + acltest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/test" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/internal/random" refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" statustest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/test" @@ -167,7 +169,7 @@ func GenerateSessionTokenBody(empty bool) *session.TokenBody { m.SetOwnerID(refstest.GenerateOwnerID(false)) m.SetLifetime(GenerateTokenLifetime(false)) - switch random.Uint32(2) { + switch randomInt(2) { case 0: m.SetContext(GenerateObjectSessionContext(false)) case 1: @@ -236,3 +238,7 @@ func GenerateXHeaders(empty bool) []session.XHeader { return xs } + +func randomInt(n int) int { + return rand.New(rand.NewSource(time.Now().UnixNano())).Intn(n) +} From 022f818735a7b3e44a9e74b21a8c8f7bffc57c6e Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 17 Aug 2023 11:06:43 +0300 Subject: [PATCH 069/169] [#20] Remove storage groups Signed-off-by: Evgenii Stratonikov --- storagegroup/convert.go | 59 ---------- storagegroup/grpc/types.go | 27 ----- storagegroup/grpc/types.pb.go | 211 ---------------------------------- storagegroup/json.go | 14 --- storagegroup/marshal.go | 54 --------- storagegroup/message_test.go | 15 --- storagegroup/test/generate.go | 21 ---- storagegroup/types.go | 79 ------------- 8 files changed, 480 deletions(-) delete mode 100644 storagegroup/convert.go delete mode 100644 storagegroup/grpc/types.go delete mode 100644 storagegroup/grpc/types.pb.go delete mode 100644 storagegroup/json.go delete mode 100644 storagegroup/marshal.go delete mode 100644 storagegroup/message_test.go delete mode 100644 storagegroup/test/generate.go delete mode 100644 storagegroup/types.go diff --git a/storagegroup/convert.go b/storagegroup/convert.go deleted file mode 100644 index 898d493..0000000 --- a/storagegroup/convert.go +++ /dev/null @@ -1,59 +0,0 @@ -package storagegroup - -import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" - sg "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc" -) - -func (s *StorageGroup) ToGRPCMessage() grpc.Message { - m := new(sg.StorageGroup) - - if s != nil { - m = new(sg.StorageGroup) - - m.SetMembers(refs.ObjectIDListToGRPCMessage(s.members)) - //nolint:staticcheck - m.SetExpirationEpoch(s.exp) - m.SetValidationDataSize(s.size) - m.SetValidationHash(s.hash.ToGRPCMessage().(*refsGRPC.Checksum)) - } - - return m -} - -func (s *StorageGroup) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*sg.StorageGroup) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - hash := v.GetValidationHash() - if hash == nil { - s.hash = nil - } else { - if s.hash == nil { - s.hash = new(refs.Checksum) - } - - err = s.hash.FromGRPCMessage(hash) - if err != nil { - return err - } - } - - s.members, err = refs.ObjectIDListFromGRPCMessage(v.GetMembers()) - if err != nil { - return err - } - - //nolint:staticcheck - s.exp = v.GetExpirationEpoch() - s.size = v.GetValidationDataSize() - - return nil -} diff --git a/storagegroup/grpc/types.go b/storagegroup/grpc/types.go deleted file mode 100644 index 9be5c24..0000000 --- a/storagegroup/grpc/types.go +++ /dev/null @@ -1,27 +0,0 @@ -package storagegroup - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" -) - -// SetValidationDataSize sets the total size of the payloads of the storage group. -func (m *StorageGroup) SetValidationDataSize(v uint64) { - m.ValidationDataSize = v -} - -// SetValidationHash sets total homomorphic hash of the storage group payloads. -func (m *StorageGroup) SetValidationHash(v *refs.Checksum) { - m.ValidationHash = v -} - -// SetExpirationEpoch sets number of the last epoch of the storage group lifetime. -// -// Deprecated: do not use, `expiration_epoch` field is deprecated in protocol. -func (m *StorageGroup) SetExpirationEpoch(v uint64) { - m.ExpirationEpoch = v -} - -// SetMembers sets list of the identifiers of the storage group members. -func (m *StorageGroup) SetMembers(v []*refs.ObjectID) { - m.Members = v -} diff --git a/storagegroup/grpc/types.pb.go b/storagegroup/grpc/types.pb.go deleted file mode 100644 index 75f5b46..0000000 --- a/storagegroup/grpc/types.pb.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 -// source: storagegroup/grpc/types.proto - -package storagegroup - -import ( - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// StorageGroup keeps verification information for Data Audit sessions. Objects -// that require paid storage guarantees are gathered in `StorageGroups` with -// additional information used for the proof of storage. `StorageGroup` only -// contains objects from the same container. -// -// Being an object payload, StorageGroup may have expiration Epoch set with -// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) well-known attribute. When expired, StorageGroup -// will be ignored by InnerRing nodes during Data Audit cycles and will be -// deleted by Storage Nodes. -type StorageGroup struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Total size of the payloads of objects in the storage group - ValidationDataSize uint64 `protobuf:"varint,1,opt,name=validation_data_size,json=validationDataSize,proto3" json:"validation_data_size,omitempty"` - // Homomorphic hash from the concatenation of the payloads of the storage - // group members. The order of concatenation is the same as the order of the - // members in the `members` field. - ValidationHash *grpc.Checksum `protobuf:"bytes,2,opt,name=validation_hash,json=validationHash,proto3" json:"validation_hash,omitempty"` - // DEPRECATED. Last NeoFS epoch number of the storage group lifetime - // - // Deprecated: Do not use. - ExpirationEpoch uint64 `protobuf:"varint,3,opt,name=expiration_epoch,json=expirationEpoch,proto3" json:"expiration_epoch,omitempty"` - // Strictly ordered list of storage group member objects. Members MUST be unique - Members []*grpc.ObjectID `protobuf:"bytes,4,rep,name=members,proto3" json:"members,omitempty"` -} - -func (x *StorageGroup) Reset() { - *x = StorageGroup{} - if protoimpl.UnsafeEnabled { - mi := &file_storagegroup_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StorageGroup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StorageGroup) ProtoMessage() {} - -func (x *StorageGroup) ProtoReflect() protoreflect.Message { - mi := &file_storagegroup_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StorageGroup.ProtoReflect.Descriptor instead. -func (*StorageGroup) Descriptor() ([]byte, []int) { - return file_storagegroup_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *StorageGroup) GetValidationDataSize() uint64 { - if x != nil { - return x.ValidationDataSize - } - return 0 -} - -func (x *StorageGroup) GetValidationHash() *grpc.Checksum { - if x != nil { - return x.ValidationHash - } - return nil -} - -// Deprecated: Do not use. -func (x *StorageGroup) GetExpirationEpoch() uint64 { - if x != nil { - return x.ExpirationEpoch - } - return 0 -} - -func (x *StorageGroup) GetMembers() []*grpc.ObjectID { - if x != nil { - return x.Members - } - return nil -} - -var File_storagegroup_grpc_types_proto protoreflect.FileDescriptor - -var file_storagegroup_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x16, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe6, - 0x01, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, - 0x30, 0x0a, 0x14, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, - 0x74, 0x61, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x69, 0x7a, - 0x65, 0x12, 0x41, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x73, 0x75, 0x6d, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x48, 0x61, 0x73, 0x68, 0x12, 0x2d, 0x0a, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x02, - 0x18, 0x01, 0x52, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x04, - 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, 0x73, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x2e, 0x66, - 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, - 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0xaa, 0x02, 0x20, 0x4e, 0x65, 0x6f, 0x2e, - 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_storagegroup_grpc_types_proto_rawDescOnce sync.Once - file_storagegroup_grpc_types_proto_rawDescData = file_storagegroup_grpc_types_proto_rawDesc -) - -func file_storagegroup_grpc_types_proto_rawDescGZIP() []byte { - file_storagegroup_grpc_types_proto_rawDescOnce.Do(func() { - file_storagegroup_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_storagegroup_grpc_types_proto_rawDescData) - }) - return file_storagegroup_grpc_types_proto_rawDescData -} - -var file_storagegroup_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_storagegroup_grpc_types_proto_goTypes = []interface{}{ - (*StorageGroup)(nil), // 0: neo.fs.v2.storagegroup.StorageGroup - (*grpc.Checksum)(nil), // 1: neo.fs.v2.refs.Checksum - (*grpc.ObjectID)(nil), // 2: neo.fs.v2.refs.ObjectID -} -var file_storagegroup_grpc_types_proto_depIdxs = []int32{ - 1, // 0: neo.fs.v2.storagegroup.StorageGroup.validation_hash:type_name -> neo.fs.v2.refs.Checksum - 2, // 1: neo.fs.v2.storagegroup.StorageGroup.members:type_name -> neo.fs.v2.refs.ObjectID - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_storagegroup_grpc_types_proto_init() } -func file_storagegroup_grpc_types_proto_init() { - if File_storagegroup_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_storagegroup_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StorageGroup); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_storagegroup_grpc_types_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_storagegroup_grpc_types_proto_goTypes, - DependencyIndexes: file_storagegroup_grpc_types_proto_depIdxs, - MessageInfos: file_storagegroup_grpc_types_proto_msgTypes, - }.Build() - File_storagegroup_grpc_types_proto = out.File - file_storagegroup_grpc_types_proto_rawDesc = nil - file_storagegroup_grpc_types_proto_goTypes = nil - file_storagegroup_grpc_types_proto_depIdxs = nil -} diff --git a/storagegroup/json.go b/storagegroup/json.go deleted file mode 100644 index b122893..0000000 --- a/storagegroup/json.go +++ /dev/null @@ -1,14 +0,0 @@ -package storagegroup - -import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" - storagegroup "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc" -) - -func (s *StorageGroup) MarshalJSON() ([]byte, error) { - return message.MarshalJSON(s) -} - -func (s *StorageGroup) UnmarshalJSON(data []byte) error { - return message.UnmarshalJSON(s, data, new(storagegroup.StorageGroup)) -} diff --git a/storagegroup/marshal.go b/storagegroup/marshal.go deleted file mode 100644 index 3f8171a..0000000 --- a/storagegroup/marshal.go +++ /dev/null @@ -1,54 +0,0 @@ -package storagegroup - -import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" - storagegroup "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" -) - -const ( - sizeField = 1 - hashField = 2 - expirationField = 3 - objectIDsField = 4 -) - -// StableMarshal marshals unified storage group structure in a protobuf -// compatible way without field order shuffle. -func (s *StorageGroup) StableMarshal(buf []byte) []byte { - if s == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, s.StableSize()) - } - - var offset int - - offset += proto.UInt64Marshal(sizeField, buf[offset:], s.size) - offset += proto.NestedStructureMarshal(hashField, buf[offset:], s.hash) - offset += proto.UInt64Marshal(expirationField, buf[offset:], s.exp) - refs.ObjectIDNestedListMarshal(objectIDsField, buf[offset:], s.members) - - return buf -} - -// StableSize of storage group structure marshalled by StableMarshal function. -func (s *StorageGroup) StableSize() (size int) { - if s == nil { - return 0 - } - - size += proto.UInt64Size(sizeField, s.size) - size += proto.NestedStructureSize(hashField, s.hash) - size += proto.UInt64Size(expirationField, s.exp) - size += refs.ObjectIDNestedListSize(objectIDsField, s.members) - - return size -} - -func (s *StorageGroup) Unmarshal(data []byte) error { - return message.Unmarshal(s, data, new(storagegroup.StorageGroup)) -} diff --git a/storagegroup/message_test.go b/storagegroup/message_test.go deleted file mode 100644 index e4ed367..0000000 --- a/storagegroup/message_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package storagegroup_test - -import ( - "testing" - - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" - storagegrouptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/test" -) - -func TestMessageConvert(t *testing.T) { - messagetest.TestRPCMessage(t, - func(empty bool) message.Message { return storagegrouptest.GenerateStorageGroup(empty) }, - ) -} diff --git a/storagegroup/test/generate.go b/storagegroup/test/generate.go deleted file mode 100644 index b53f199..0000000 --- a/storagegroup/test/generate.go +++ /dev/null @@ -1,21 +0,0 @@ -package storagegrouptest - -import ( - refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup" -) - -func GenerateStorageGroup(empty bool) *storagegroup.StorageGroup { - m := new(storagegroup.StorageGroup) - - if !empty { - m.SetValidationDataSize(44) - //nolint:staticcheck - m.SetExpirationEpoch(55) - m.SetMembers(refstest.GenerateObjectIDs(false)) - } - - m.SetValidationHash(refstest.GenerateChecksum(empty)) - - return m -} diff --git a/storagegroup/types.go b/storagegroup/types.go deleted file mode 100644 index b5a3a5b..0000000 --- a/storagegroup/types.go +++ /dev/null @@ -1,79 +0,0 @@ -package storagegroup - -import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" -) - -// StorageGroup is a unified structure of StorageGroup -// message from proto definition. -type StorageGroup struct { - size uint64 - - hash *refs.Checksum - - exp uint64 - - members []refs.ObjectID -} - -// GetValidationDataSize of unified storage group structure. -func (s *StorageGroup) GetValidationDataSize() uint64 { - if s != nil { - return s.size - } - - return 0 -} - -// SetValidationDataSize into unified storage group structure. -func (s *StorageGroup) SetValidationDataSize(v uint64) { - s.size = v -} - -// GetValidationHash of unified storage group structure. -func (s *StorageGroup) GetValidationHash() *refs.Checksum { - if s != nil { - return s.hash - } - - return nil -} - -// SetValidationHash into unified storage group structure. -func (s *StorageGroup) SetValidationHash(v *refs.Checksum) { - s.hash = v -} - -// GetExpirationEpoch of unified storage group structure. -// -// Deprecated: Do not use. -func (s *StorageGroup) GetExpirationEpoch() uint64 { - if s != nil { - return s.exp - } - - return 0 -} - -// SetExpirationEpoch into unified storage group structure. -// -// Deprecated: Do not use. -func (s *StorageGroup) SetExpirationEpoch(v uint64) { - s.exp = v -} - -// GetMembers of unified storage group structure. Members are objects of -// storage group. -func (s *StorageGroup) GetMembers() []refs.ObjectID { - if s != nil { - return s.members - } - - return nil -} - -// SetMembers into unified storage group structure. Members are objects of -// storage group. -func (s *StorageGroup) SetMembers(v []refs.ObjectID) { - s.members = v -} From 17bed735a171b8173531dd39edb4f264c8ac7a45 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 17 Aug 2023 11:08:14 +0300 Subject: [PATCH 070/169] [#20] Update api version Signed-off-by: Evgenii Stratonikov --- accounting/grpc/service.pb.go | 4 +- accounting/grpc/service_grpc.pb.go | 2 +- accounting/grpc/types.pb.go | 4 +- acl/grpc/types.pb.go | 4 +- audit/grpc/types.pb.go | 4 +- container/grpc/service.pb.go | 4 +- container/grpc/service_grpc.pb.go | 2 +- container/grpc/types.pb.go | 4 +- lock/grpc/types.pb.go | 4 +- netmap/grpc/service.pb.go | 4 +- netmap/grpc/service_grpc.pb.go | 2 +- netmap/grpc/types.pb.go | 2 +- object/grpc/service.pb.go | 28 +++++----- object/grpc/service_grpc.pb.go | 88 +++++++++++++++++------------- object/grpc/types.pb.go | 62 ++++++++++----------- object/types.go | 2 +- refs/grpc/types.pb.go | 4 +- session/grpc/service.pb.go | 4 +- session/grpc/service_grpc.pb.go | 2 +- session/grpc/types.pb.go | 4 +- status/grpc/types.pb.go | 4 +- tombstone/grpc/types.pb.go | 4 +- util/proto/test/test.pb.go | 4 +- 23 files changed, 125 insertions(+), 121 deletions(-) diff --git a/accounting/grpc/service.pb.go b/accounting/grpc/service.pb.go index 9699622..51b9fe3 100644 --- a/accounting/grpc/service.pb.go +++ b/accounting/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: accounting/grpc/service.proto package accounting diff --git a/accounting/grpc/service_grpc.pb.go b/accounting/grpc/service_grpc.pb.go index 1e1b17e..1aadfc0 100644 --- a/accounting/grpc/service_grpc.pb.go +++ b/accounting/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.9 +// - protoc v4.23.4 // source: accounting/grpc/service.proto package accounting diff --git a/accounting/grpc/types.pb.go b/accounting/grpc/types.pb.go index b8dff21..ae09338 100644 --- a/accounting/grpc/types.pb.go +++ b/accounting/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: accounting/grpc/types.proto package accounting diff --git a/acl/grpc/types.pb.go b/acl/grpc/types.pb.go index 94a8e47..e245169 100644 --- a/acl/grpc/types.pb.go +++ b/acl/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: acl/grpc/types.proto package acl diff --git a/audit/grpc/types.pb.go b/audit/grpc/types.pb.go index a2cac43..8f437da 100644 --- a/audit/grpc/types.pb.go +++ b/audit/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: audit/grpc/types.proto package audit diff --git a/container/grpc/service.pb.go b/container/grpc/service.pb.go index e3bdaf0..8363e81 100644 --- a/container/grpc/service.pb.go +++ b/container/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: container/grpc/service.proto package container diff --git a/container/grpc/service_grpc.pb.go b/container/grpc/service_grpc.pb.go index c70bce7..754665f 100644 --- a/container/grpc/service_grpc.pb.go +++ b/container/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.9 +// - protoc v4.23.4 // source: container/grpc/service.proto package container diff --git a/container/grpc/types.pb.go b/container/grpc/types.pb.go index 0cd53eb..59780d5 100644 --- a/container/grpc/types.pb.go +++ b/container/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: container/grpc/types.proto package container diff --git a/lock/grpc/types.pb.go b/lock/grpc/types.pb.go index 958476c..100d648 100644 --- a/lock/grpc/types.pb.go +++ b/lock/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: lock/grpc/types.proto package lock diff --git a/netmap/grpc/service.pb.go b/netmap/grpc/service.pb.go index acfe43c..711a3c9 100644 --- a/netmap/grpc/service.pb.go +++ b/netmap/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: netmap/grpc/service.proto package netmap diff --git a/netmap/grpc/service_grpc.pb.go b/netmap/grpc/service_grpc.pb.go index 3834c3d..dec7d7f 100644 --- a/netmap/grpc/service_grpc.pb.go +++ b/netmap/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.9 +// - protoc v4.23.4 // source: netmap/grpc/service.proto package netmap diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index 9c6c489..f4991a9 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v3.12.4 +// protoc v4.23.4 // source: netmap/grpc/types.proto package netmap diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index c6ffb20..d339aef 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v3.21.9 +// protoc v4.23.4 // source: object/grpc/service.proto package object @@ -1592,16 +1592,16 @@ type PutRequest_Body_Init struct { Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // Object's Header Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` - // Number of copies of the object to store within the RPC call. By default, - // object is processed according to the container's placement policy. - // Can be one of: + // Number of copies of the object to store within the RPC call. By + // default, object is processed according to the container's placement + // policy. Can be one of: // 1. A single number; applied to the whole request and is treated as // a minimal number of nodes that must store an object to complete the // request successfully. // 2. An ordered array; every number is treated as a minimal number of // nodes in a corresponding placement vector that must store an object - // to complete the request successfully. The length MUST equal the placement - // vectors number, otherwise request is considered malformed. + // to complete the request successfully. The length MUST equal the + // placement vectors number, otherwise request is considered malformed. CopiesNumber []uint32 `protobuf:"varint,4,rep,packed,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` } @@ -2049,11 +2049,11 @@ func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { return nil } -// Filter structure checks if the object header field or the attribute content -// matches a value. +// Filter structure checks if the object header field or the attribute +// content matches a value. // // If no filters are set, search request will return all objects of the -// container, including Regular object, Tombstones and Storage Group +// container, including Regular object and Tombstone // objects. Most human users expect to get only object they can directly // work with. In that case, `$Object:ROOT` filter should be used. // @@ -2088,11 +2088,11 @@ func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { // properties: // // - $Object:ROOT \ -// Returns only `REGULAR` type objects that are not split or that are the top -// level root objects in a split hierarchy. This includes objects not +// Returns only `REGULAR` type objects that are not split or that are the +// top level root objects in a split hierarchy. This includes objects not // present physically, like large objects split into smaller objects // without a separate top-level root object. Objects of other types like -// StorageGroups and Tombstones will not be shown. This filter may be +// Locks and Tombstones will not be shown. This filter may be // useful for listing objects like `ls` command of some virtual file // system. This filter is activated if the `key` exists, disregarding the // value and matcher type. @@ -2101,8 +2101,8 @@ func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { // activated if the `key` exists, disregarding the value and matcher type. // // Note: using filters with a key with prefix `$Object:` and match type -// `NOT_PRESENT `is not recommended since this is not a cross-version approach. -// Behavior when processing this kind of filters is undefined. +// `NOT_PRESENT `is not recommended since this is not a cross-version +// approach. Behavior when processing this kind of filters is undefined. type SearchRequest_Body_Filter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 3c71ec8..985b991 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.9 +// - protoc v4.23.4 // source: object/grpc/service.proto package object @@ -34,11 +34,11 @@ const ( // 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. type ObjectServiceClient interface { // Receive full object structure, including Headers and payload. Response uses - // gRPC stream. First response message carries the object with the requested address. - // Chunk messages are parts of the object's payload if it is needed. All - // messages, except the first one, carry payload chunks. The requested object can - // be restored by concatenation of object message payload and all chunks - // keeping the receiving order. + // gRPC stream. First response message carries the object with the requested + // address. Chunk messages are parts of the object's payload if it is needed. + // All messages, except the first one, carry payload chunks. The requested + // object can be restored by concatenation of object message payload and all + // chunks keeping the receiving order. // // Extended headers can change `Get` behaviour: // - [ __SYSTEM__NETMAP_EPOCH ] \ @@ -47,9 +47,10 @@ type ObjectServiceClient interface { // calculation. // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` + // (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or the latest one + // otherwise) of Network Map to find an object until the depth limit is + // reached. // // Please refer to detailed `XHeader` description. // @@ -90,15 +91,16 @@ type ObjectServiceClient interface { // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // write access to the container is denied; // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; + // placement of an object of type TOMBSTONE that includes at least one + // locked object is prohibited; // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ // placement of an object of type LOCK that includes at least one object of // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // (for trusted object preparation) session private key does not exist or + // has // // been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ @@ -121,6 +123,9 @@ type ObjectServiceClient interface { // - Common failures (SECTION_FAILURE_COMMON); // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // delete access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // the object could not be deleted because it has not been \ + // found within the container; // - **LOCKED** (2050, SECTION_OBJECT): \ // deleting a locked object is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ @@ -180,8 +185,8 @@ type ObjectServiceClient interface { Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (ObjectService_SearchClient, 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 receiving - // order. + // restored by concatenation of all received payload chunks keeping the + // receiving order. // // Extended headers can change `GetRange` behaviour: // - [ __SYSTEM__NETMAP_EPOCH ] \ @@ -245,9 +250,8 @@ type ObjectServiceClient interface { // provided session token has expired. GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) // Put the prepared object into container. - // `ContainerID`, `ObjectID` and `OwnerID` of an object - // MUST be set. Session token MUST be obtained before `PUT SINGLE` operation (see - // session package). + // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of + // an object MUST be set. // // Extended headers can change `Put` behaviour: // - [ __SYSTEM__NETMAP_EPOCH \ @@ -264,15 +268,16 @@ type ObjectServiceClient interface { // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // write access to the container is denied; // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; + // placement of an object of type TOMBSTONE that includes at least one + // locked object is prohibited; // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ // placement of an object of type LOCK that includes at least one object of // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // (for trusted object preparation) session private key does not exist or + // has // // been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ @@ -459,11 +464,11 @@ func (c *objectServiceClient) PutSingle(ctx context.Context, in *PutSingleReques // for forward compatibility type ObjectServiceServer interface { // Receive full object structure, including Headers and payload. Response uses - // gRPC stream. First response message carries the object with the requested address. - // Chunk messages are parts of the object's payload if it is needed. All - // messages, except the first one, carry payload chunks. The requested object can - // be restored by concatenation of object message payload and all chunks - // keeping the receiving order. + // gRPC stream. First response message carries the object with the requested + // address. Chunk messages are parts of the object's payload if it is needed. + // All messages, except the first one, carry payload chunks. The requested + // object can be restored by concatenation of object message payload and all + // chunks keeping the receiving order. // // Extended headers can change `Get` behaviour: // - [ __SYSTEM__NETMAP_EPOCH ] \ @@ -472,9 +477,10 @@ type ObjectServiceServer interface { // calculation. // - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` + // (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or the latest one + // otherwise) of Network Map to find an object until the depth limit is + // reached. // // Please refer to detailed `XHeader` description. // @@ -515,15 +521,16 @@ type ObjectServiceServer interface { // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // write access to the container is denied; // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; + // placement of an object of type TOMBSTONE that includes at least one + // locked object is prohibited; // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ // placement of an object of type LOCK that includes at least one object of // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // (for trusted object preparation) session private key does not exist or + // has // // been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ @@ -546,6 +553,9 @@ type ObjectServiceServer interface { // - Common failures (SECTION_FAILURE_COMMON); // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // delete access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // the object could not be deleted because it has not been \ + // found within the container; // - **LOCKED** (2050, SECTION_OBJECT): \ // deleting a locked object is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ @@ -605,8 +615,8 @@ type ObjectServiceServer interface { Search(*SearchRequest, ObjectService_SearchServer) 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 receiving - // order. + // restored by concatenation of all received payload chunks keeping the + // receiving order. // // Extended headers can change `GetRange` behaviour: // - [ __SYSTEM__NETMAP_EPOCH ] \ @@ -670,9 +680,8 @@ type ObjectServiceServer interface { // provided session token has expired. GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) // Put the prepared object into container. - // `ContainerID`, `ObjectID` and `OwnerID` of an object - // MUST be set. Session token MUST be obtained before `PUT SINGLE` operation (see - // session package). + // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of + // an object MUST be set. // // Extended headers can change `Put` behaviour: // - [ __SYSTEM__NETMAP_EPOCH \ @@ -689,15 +698,16 @@ type ObjectServiceServer interface { // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // write access to the container is denied; // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; + // placement of an object of type TOMBSTONE that includes at least one + // locked object is prohibited; // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ // placement of an object of type LOCK that includes at least one object of // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // (for trusted object preparation) session private key does not exist or + // has // // been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 5c79080..c6f2c7a 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v3.21.9 +// protoc v4.23.4 // source: object/grpc/types.proto package object @@ -23,13 +23,12 @@ const ( ) // Type of the object payload content. Only `REGULAR` type objects can be split, -// hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by the maximum -// object size. +// hence `TOMBSTONE` and `LOCK` payload is limited by the +// maximum object size. // // String presentation of object type is the same as definition: // * REGULAR // * TOMBSTONE -// * STORAGE_GROUP // * LOCK type ObjectType int32 @@ -38,8 +37,6 @@ const ( ObjectType_REGULAR ObjectType = 0 // Used internally to identify deleted objects ObjectType_TOMBSTONE ObjectType = 1 - // StorageGroup information - ObjectType_STORAGE_GROUP ObjectType = 2 // Object lock ObjectType_LOCK ObjectType = 3 ) @@ -49,14 +46,12 @@ var ( ObjectType_name = map[int32]string{ 0: "REGULAR", 1: "TOMBSTONE", - 2: "STORAGE_GROUP", 3: "LOCK", } ObjectType_value = map[string]int32{ - "REGULAR": 0, - "TOMBSTONE": 1, - "STORAGE_GROUP": 2, - "LOCK": 3, + "REGULAR": 0, + "TOMBSTONE": 1, + "LOCK": 3, } ) @@ -396,8 +391,8 @@ func (x *Header) GetSplit() *Header_Split { } // Object structure. Object is immutable and content-addressed. It means -// `ObjectID` will change if the header or the payload changes. It's calculated as a -// hash of header field which contains hash of the object's payload. +// `ObjectID` will change if the header or the payload changes. It's calculated +// as a hash of header field which contains hash of the object's payload. // // For non-regular object types payload format depends on object type specified // in the header. @@ -478,8 +473,8 @@ func (x *Object) GetPayload() []byte { // Meta information of split hierarchy for object assembly. With the last part // one can traverse linked list of split hierarchy back to the first part and -// assemble the original object. With a linking object one can assemble an object -// right from the object parts. +// assemble the original object. With a linking object one can assemble an +// object right from the object parts. type SplitInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -556,8 +551,8 @@ func (x *SplitInfo) GetLink() *grpc.ObjectID { // Objects with duplicated attribute names or attributes with empty values // will be considered invalid. // -// There are some "well-known" attributes starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix -// that affect system behaviour: +// There are some "well-known" attributes starting with `__SYSTEM__` +// (`__NEOFS__` is deprecated) prefix that affect system behaviour: // // - [ __SYSTEM__UPLOAD_ID ] \ // (`__NEOFS__UPLOAD_ID` is deprecated) \ @@ -869,25 +864,24 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x61, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, - 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x2a, 0x45, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, + 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x2a, 0x32, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, 0x42, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, - 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, - 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, 0x2a, 0x73, 0x0a, 0x09, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, - 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, - 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, - 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x0f, 0x0a, - 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x11, - 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x10, - 0x04, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, - 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, - 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, - 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, 0x2a, 0x73, 0x0a, 0x09, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, + 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, + 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, + 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, + 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, 0x61, + 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, + 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, + 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/object/types.go b/object/types.go index d22b428..c28bf35 100644 --- a/object/types.go +++ b/object/types.go @@ -324,7 +324,7 @@ type PutSingleResponse struct { const ( TypeRegular Type = iota TypeTombstone - TypeStorageGroup + _ TypeLock ) diff --git a/refs/grpc/types.pb.go b/refs/grpc/types.pb.go index f16583b..cfb51ea 100644 --- a/refs/grpc/types.pb.go +++ b/refs/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: refs/grpc/types.proto package refs diff --git a/session/grpc/service.pb.go b/session/grpc/service.pb.go index 5ba114d..c01bfa8 100644 --- a/session/grpc/service.pb.go +++ b/session/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: session/grpc/service.proto package session diff --git a/session/grpc/service_grpc.pb.go b/session/grpc/service_grpc.pb.go index 32793fe..a67c47a 100644 --- a/session/grpc/service_grpc.pb.go +++ b/session/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.9 +// - protoc v4.23.4 // source: session/grpc/service.proto package session diff --git a/session/grpc/types.pb.go b/session/grpc/types.pb.go index 25e0715..23e46c7 100644 --- a/session/grpc/types.pb.go +++ b/session/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: session/grpc/types.proto package session diff --git a/status/grpc/types.pb.go b/status/grpc/types.pb.go index a30533f..ddbaa6c 100644 --- a/status/grpc/types.pb.go +++ b/status/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: status/grpc/types.proto package status diff --git a/tombstone/grpc/types.pb.go b/tombstone/grpc/types.pb.go index d1065ba..109a131 100644 --- a/tombstone/grpc/types.pb.go +++ b/tombstone/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: tombstone/grpc/types.proto package tombstone diff --git a/util/proto/test/test.pb.go b/util/proto/test/test.pb.go index 0dfa4dc..2fa2d4e 100644 --- a/util/proto/test/test.pb.go +++ b/util/proto/test/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.9 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: util/proto/test/test.proto package test From 309aa4ac787a1707e1eb082463f17a1684d5a19e Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Sep 2023 13:20:05 +0300 Subject: [PATCH 071/169] Release v2.16.0 Signed-off-by: Evgenii Stratonikov --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 887bce5..77bf5a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,23 @@ ## [Unreleased] +### Added +### Fixed +### Changed +### Removed +### Updated + +## [2.16.0] - 2023-09-14 - Academy of Sciences Glacier + ### Added - Add impersonate flag to bearer token (#17) +- `NOT` and `UNIQUE` keywords to the placement policy (#26) +- `PutSingle` RPC (#45) ### Fixed ### Changed +- `StableSize()` is optimized and no does no allocations (#49) +- Marshaling code now uses `protowire` package (#50) ### Removed - Reputation system (#21) From f50872f1bcf2592c31d3de2fb1cf0b18120adab3 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 6 Oct 2023 15:05:30 +0300 Subject: [PATCH 072/169] [#58] object: Allow to set marshal data Now it is possible set marshaled data to reduce memory allocations. Signed-off-by: Dmitrii Stepanov --- object/marshal.go | 48 ++++++++++++++++++++++++++++++++++++++++ object/types.go | 6 +++++ util/proto/marshal.go | 25 +++++++++++++++++++++ util/signature/buffer.go | 7 ++++++ util/signature/data.go | 12 ++++++---- 5 files changed, 94 insertions(+), 4 deletions(-) diff --git a/object/marshal.go b/object/marshal.go index fe0e232..18172e6 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -322,6 +322,14 @@ func (o *Object) StableMarshal(buf []byte) []byte { return []byte{} } + if o.marshalData != nil { + if buf == nil { + return o.marshalData + } + copy(buf, o.marshalData) + return buf + } + if buf == nil { buf = make([]byte, o.StableSize()) } @@ -336,6 +344,20 @@ func (o *Object) StableMarshal(buf []byte) []byte { return buf } +// SetMarshalData sets marshal data to reduce memory allocations. +// +// It is unsafe to modify object data after setting marshal data. +func (o *Object) SetMarshalData(data []byte) { + if o == nil { + return + } + if data == nil { + o.marshalData = o.StableMarshal(nil) + } else { + o.marshalData = data + } +} + func (o *Object) StableSize() (size int) { if o == nil { return 0 @@ -1071,6 +1093,15 @@ func (r *PutSingleRequestBody) StableMarshal(buf []byte) []byte { if r == nil { return []byte{} } + + if r.marshalData != nil { + if buf == nil { + return r.marshalData + } + copy(buf, r.marshalData) + return buf + } + if buf == nil { buf = make([]byte, r.StableSize()) } @@ -1082,6 +1113,23 @@ func (r *PutSingleRequestBody) StableMarshal(buf []byte) []byte { return buf } +// SetMarshalData sets marshal data to reduce memory allocations. +// +// It is unsafe to modify request data after setting marshal data. +func (r *PutSingleRequestBody) SetMarshalData(data []byte) { + if r == nil { + return + } + + if data == nil { + r.marshalData = r.StableMarshal(nil) + } else { + r.marshalData = data + } + + proto.NestedStructureSetMarshalData(putSingleReqObjectField, r.marshalData, r.object) +} + func (r *PutSingleRequestBody) StableSize() int { if r == nil { return 0 diff --git a/object/types.go b/object/types.go index c28bf35..895afb0 100644 --- a/object/types.go +++ b/object/types.go @@ -75,6 +75,9 @@ type Object struct { header *Header payload []byte + + // marshalData holds marshaled data, must not be marshaled by StableMarshal + marshalData []byte } type SplitInfo struct { @@ -304,6 +307,9 @@ type GetRangeHashResponse struct { type PutSingleRequestBody struct { object *Object copyNum []uint32 + + // marshalData holds marshaled data, must not be marshaled by StableMarshal + marshalData []byte } type PutSingleRequest struct { diff --git a/util/proto/marshal.go b/util/proto/marshal.go index 606086a..b16375a 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -19,6 +19,11 @@ type ( StableMarshal([]byte) []byte StableSize() int } + + setMarshalData interface { + SetMarshalData([]byte) + StableSize() int + } ) func BytesMarshal(field int, buf, v []byte) int { @@ -263,6 +268,26 @@ func NestedStructureMarshal[T stableMarshaller](field int64, buf []byte, v T) in return offset + n } +// NestedStructureSetMarshalData calculates offset for field in parentData +// and calls SetMarshalData for nested structure. +// +// Returns marshalled data length of nested structure. +func NestedStructureSetMarshalData(field int64, parentData []byte, v setMarshalData) int { + n := v.StableSize() + if n == 0 { + return 0 + } + + buf := make([]byte, binary.MaxVarintLen64) + prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) + offset := binary.PutUvarint(buf, prefix) + offset += binary.PutUvarint(buf, uint64(n)) + + v.SetMarshalData(parentData[offset : offset+n]) + + return offset + n +} + func NestedStructureSize[T stableMarshaller](field int64, v T) (size int) { n := v.StableSize() if n == 0 { diff --git a/util/signature/buffer.go b/util/signature/buffer.go index f9b003d..8102495 100644 --- a/util/signature/buffer.go +++ b/util/signature/buffer.go @@ -14,6 +14,13 @@ var buffersPool = sync.Pool{ }, } +func tryGetNewBufferFromPool(size int) (*buffer, bool) { + if size > poolSliceMaxSize { + return &buffer{}, false + } + return newBufferFromPool(size), true +} + func newBufferFromPool(size int) *buffer { result := buffersPool.Get().(*buffer) if cap(result.data) < size { diff --git a/util/signature/data.go b/util/signature/data.go index 1db46dc..4170e6c 100644 --- a/util/signature/data.go +++ b/util/signature/data.go @@ -35,8 +35,10 @@ func SignDataWithHandler(key *ecdsa.PrivateKey, src DataSource, handler KeySigna opts[i](cfg) } - buffer := newBufferFromPool(src.SignedDataSize()) - defer returnBufferToPool(buffer) + buffer, ok := tryGetNewBufferFromPool(src.SignedDataSize()) + if ok { + defer returnBufferToPool(buffer) + } data, err := src.ReadSignedData(buffer.data) if err != nil { @@ -64,8 +66,10 @@ func VerifyDataWithSource(dataSrc DataSource, sigSrc KeySignatureSource, opts .. opts[i](cfg) } - buffer := newBufferFromPool(dataSrc.SignedDataSize()) - defer returnBufferToPool(buffer) + buffer, ok := tryGetNewBufferFromPool(dataSrc.SignedDataSize()) + if ok { + defer returnBufferToPool(buffer) + } data, err := dataSrc.ReadSignedData(buffer.data) if err != nil { From 498877e378fd7ac579da24fb6eac642e0f225eca Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 6 Oct 2023 15:06:36 +0300 Subject: [PATCH 073/169] [#58] makefile: Disable test results caching Signed-off-by: Dmitrii Stepanov --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6ceea25..e421213 100755 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ protoc: # Run Unit Test with go test test: @echo "⇒ Running go test" - @GO111MODULE=on go test ./... + @GO111MODULE=on go test ./... -count=1 # Run linters lint: From 9cc209544683772a46bb0d47f7d132ad5572ff53 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 21 Nov 2023 10:59:15 +0300 Subject: [PATCH 074/169] [#59] util: Restore backwards compatibility in NestedStructureMarshal() Signed-off-by: Evgenii Stratonikov --- session/marshal.go | 4 ++-- util/proto/marshal.go | 38 ++++++++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/session/marshal.go b/session/marshal.go index cda9579..8632398 100644 --- a/session/marshal.go +++ b/session/marshal.go @@ -211,7 +211,7 @@ func (c *ObjectSessionContext) StableMarshal(buf []byte) []byte { } offset := proto.EnumMarshal(objectCtxVerbField, buf, int32(c.verb)) - proto.NestedStructureMarshal(objectCtxTargetField, buf[offset:], objectSessionContextTarget{ + proto.NestedStructureMarshalUnchecked(objectCtxTargetField, buf[offset:], objectSessionContextTarget{ cnr: c.cnr, objs: c.objs, }) @@ -225,7 +225,7 @@ func (c *ObjectSessionContext) StableSize() (size int) { } size += proto.EnumSize(objectCtxVerbField, int32(c.verb)) - size += proto.NestedStructureSize(objectCtxTargetField, objectSessionContextTarget{ + size += proto.NestedStructureSizeUnchecked(objectCtxTargetField, objectSessionContextTarget{ cnr: c.cnr, objs: c.objs, }) diff --git a/util/proto/marshal.go b/util/proto/marshal.go index b16375a..2704960 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -20,9 +20,10 @@ type ( StableSize() int } - setMarshalData interface { + setMarshalData[T any] interface { SetMarshalData([]byte) StableSize() int + ~*T } ) @@ -254,12 +255,21 @@ func VarUIntSize(x uint64) int { return (bits.Len64(x|1) + 6) / 7 } -func NestedStructureMarshal[T stableMarshaller](field int64, buf []byte, v T) int { - n := v.StableSize() - if n == 0 { +type ptrStableMarshaler[T any] interface { + stableMarshaller + ~*T +} + +func NestedStructureMarshal[T any, M ptrStableMarshaler[T]](field int64, buf []byte, v M) int { + if v == nil { return 0 } + return NestedStructureMarshalUnchecked(field, buf, v) +} + +func NestedStructureMarshalUnchecked[T stableMarshaller](field int64, buf []byte, v T) int { + n := v.StableSize() prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) offset := binary.PutUvarint(buf, prefix) offset += binary.PutUvarint(buf[offset:], uint64(n)) @@ -272,12 +282,12 @@ func NestedStructureMarshal[T stableMarshaller](field int64, buf []byte, v T) in // and calls SetMarshalData for nested structure. // // Returns marshalled data length of nested structure. -func NestedStructureSetMarshalData(field int64, parentData []byte, v setMarshalData) int { - n := v.StableSize() - if n == 0 { +func NestedStructureSetMarshalData[T any, M setMarshalData[T]](field int64, parentData []byte, v M) int { + if v == nil { return 0 } + n := v.StableSize() buf := make([]byte, binary.MaxVarintLen64) prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) offset := binary.PutUvarint(buf, prefix) @@ -288,13 +298,17 @@ func NestedStructureSetMarshalData(field int64, parentData []byte, v setMarshalD return offset + n } -func NestedStructureSize[T stableMarshaller](field int64, v T) (size int) { - n := v.StableSize() - if n == 0 { +func NestedStructureSize[T any, M ptrStableMarshaler[T]](field int64, v M) (size int) { + if v == nil { return 0 } - size = protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(n)) - return + + return NestedStructureSizeUnchecked(field, v) +} + +func NestedStructureSizeUnchecked[T stableMarshaller](field int64, v T) int { + n := v.StableSize() + return protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(n)) } func Fixed64Marshal(field int, buf []byte, v uint64) int { From b46e8cfbda9976d6f144001e395f81ac0c65329a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 21 Nov 2023 11:21:05 +0300 Subject: [PATCH 075/169] [#59] util: Rename stableMarshaler It should be with a single `l`, see `json.Marshaler`. Signed-off-by: Evgenii Stratonikov --- util/proto/marshal.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/proto/marshal.go b/util/proto/marshal.go index 2704960..768cb2b 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -15,7 +15,7 @@ import ( ) type ( - stableMarshaller interface { + stableMarshaler interface { StableMarshal([]byte) []byte StableSize() int } @@ -256,7 +256,7 @@ func VarUIntSize(x uint64) int { } type ptrStableMarshaler[T any] interface { - stableMarshaller + stableMarshaler ~*T } @@ -268,7 +268,7 @@ func NestedStructureMarshal[T any, M ptrStableMarshaler[T]](field int64, buf []b return NestedStructureMarshalUnchecked(field, buf, v) } -func NestedStructureMarshalUnchecked[T stableMarshaller](field int64, buf []byte, v T) int { +func NestedStructureMarshalUnchecked[T stableMarshaler](field int64, buf []byte, v T) int { n := v.StableSize() prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) offset := binary.PutUvarint(buf, prefix) @@ -306,7 +306,7 @@ func NestedStructureSize[T any, M ptrStableMarshaler[T]](field int64, v M) (size return NestedStructureSizeUnchecked(field, v) } -func NestedStructureSizeUnchecked[T stableMarshaller](field int64, v T) int { +func NestedStructureSizeUnchecked[T stableMarshaler](field int64, v T) int { n := v.StableSize() return protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(n)) } From 72885aae835cf962286d3a87f88209f18177617b Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Fri, 12 Jan 2024 18:09:28 +0300 Subject: [PATCH 076/169] [#62] signature: Refactor BufferPool Signed-off-by: Alexander Chuprov --- util/pool/buffer.go | 54 +++++++++++++++++++++++++++++++++++++++ util/signature/buffer.go | 40 ----------------------------- util/signature/data.go | 21 +++++++-------- util/signature/options.go | 16 ++++++------ 4 files changed, 73 insertions(+), 58 deletions(-) create mode 100644 util/pool/buffer.go delete mode 100644 util/signature/buffer.go diff --git a/util/pool/buffer.go b/util/pool/buffer.go new file mode 100644 index 0000000..e0a7185 --- /dev/null +++ b/util/pool/buffer.go @@ -0,0 +1,54 @@ +package pool + +import ( + "sync" +) + +// Buffer contains a byte slice. +type Buffer struct { + Data []byte +} + +// BufferPool manages a pool of Buffers. +type BufferPool struct { + poolSliceSize uint32 // Size for the buffer slices in the pool. + buffersPool *sync.Pool +} + +// NewBufferPool creates a BufferPool with a specified size. +func NewBufferPool(poolSliceSize uint32) BufferPool { + pool := sync.Pool{ + New: func() any { + return new(Buffer) + }, + } + return BufferPool{poolSliceSize: poolSliceSize, buffersPool: &pool} +} + +// Get retrieves a Buffer from the pool or creates a new one if necessary. +// It ensures the buffer's capacity is at least the specified size. +func (pool BufferPool) Get(size uint32) *Buffer { + result := pool.buffersPool.Get().(*Buffer) + + if cap(result.Data) < int(size) { + result.Data = make([]byte, size) + } else { + result.Data = result.Data[:size] + } + return result +} + +// Put returns a Buffer to the pool if its capacity does not exceed poolSliceSize. +func (pool BufferPool) Put(buf *Buffer) { + if cap(buf.Data) > int(pool.poolSliceSize) { + return + } + + buf.Data = buf.Data[:0] + pool.buffersPool.Put(buf) +} + +// PoolSliceSize returns the size for buffer slices in the pool. +func (pool BufferPool) PoolSliceSize() uint32 { + return uint32(pool.poolSliceSize) +} diff --git a/util/signature/buffer.go b/util/signature/buffer.go deleted file mode 100644 index 8102495..0000000 --- a/util/signature/buffer.go +++ /dev/null @@ -1,40 +0,0 @@ -package signature - -import "sync" - -const poolSliceMaxSize = 128 * 1024 - -type buffer struct { - data []byte -} - -var buffersPool = sync.Pool{ - New: func() any { - return new(buffer) - }, -} - -func tryGetNewBufferFromPool(size int) (*buffer, bool) { - if size > poolSliceMaxSize { - return &buffer{}, false - } - return newBufferFromPool(size), true -} - -func newBufferFromPool(size int) *buffer { - result := buffersPool.Get().(*buffer) - if cap(result.data) < size { - result.data = make([]byte, size) - } else { - result.data = result.data[:size] - } - return result -} - -func returnBufferToPool(buf *buffer) { - if cap(buf.data) > poolSliceMaxSize { - return - } - buf.data = buf.data[:0] - buffersPool.Put(buf) -} diff --git a/util/signature/data.go b/util/signature/data.go index 4170e6c..5e7c310 100644 --- a/util/signature/data.go +++ b/util/signature/data.go @@ -4,9 +4,14 @@ import ( "crypto/ecdsa" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" crypto "git.frostfs.info/TrueCloudLab/frostfs-crypto" ) +const poolSliceMaxSize = 128 * 1024 + +var buffersPool = pool.NewBufferPool(poolSliceMaxSize) + type DataSource interface { ReadSignedData([]byte) ([]byte, error) SignedDataSize() int @@ -35,12 +40,10 @@ func SignDataWithHandler(key *ecdsa.PrivateKey, src DataSource, handler KeySigna opts[i](cfg) } - buffer, ok := tryGetNewBufferFromPool(src.SignedDataSize()) - if ok { - defer returnBufferToPool(buffer) - } + buffer := buffersPool.Get(uint32(src.SignedDataSize())) + defer buffersPool.Put(buffer) - data, err := src.ReadSignedData(buffer.data) + data, err := src.ReadSignedData(buffer.Data) if err != nil { return err } @@ -66,12 +69,10 @@ func VerifyDataWithSource(dataSrc DataSource, sigSrc KeySignatureSource, opts .. opts[i](cfg) } - buffer, ok := tryGetNewBufferFromPool(dataSrc.SignedDataSize()) - if ok { - defer returnBufferToPool(buffer) - } + buffer := buffersPool.Get(uint32(dataSrc.SignedDataSize())) + defer buffersPool.Put(buffer) - data, err := dataSrc.ReadSignedData(buffer.data) + data, err := dataSrc.ReadSignedData(buffer.Data) if err != nil { return err } diff --git a/util/signature/options.go b/util/signature/options.go index b9bf68d..ca2a5e9 100644 --- a/util/signature/options.go +++ b/util/signature/options.go @@ -35,10 +35,10 @@ func verify(cfg *cfg, data []byte, sig *refs.Signature) error { case refs.ECDSA_RFC6979_SHA256: return crypto.VerifyRFC6979(pub, data, sig.GetSign()) case refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT: - buffer := newBufferFromPool(base64.StdEncoding.EncodedLen(len(data))) - defer returnBufferToPool(buffer) - base64.StdEncoding.Encode(buffer.data, data) - if !walletconnect.Verify(pub, buffer.data, sig.GetSign()) { + buffer := buffersPool.Get(uint32(base64.StdEncoding.EncodedLen(len(data)))) + defer buffersPool.Put(buffer) + base64.StdEncoding.Encode(buffer.Data, data) + if !walletconnect.Verify(pub, buffer.Data, sig.GetSign()) { return crypto.ErrInvalidSignature } return nil @@ -54,10 +54,10 @@ func sign(cfg *cfg, key *ecdsa.PrivateKey, data []byte) ([]byte, error) { case refs.ECDSA_RFC6979_SHA256: return crypto.SignRFC6979(key, data) case refs.ECDSA_RFC6979_SHA256_WALLET_CONNECT: - buffer := newBufferFromPool(base64.StdEncoding.EncodedLen(len(data))) - defer returnBufferToPool(buffer) - base64.StdEncoding.Encode(buffer.data, data) - return walletconnect.Sign(key, buffer.data) + buffer := buffersPool.Get(uint32(base64.StdEncoding.EncodedLen(len(data)))) + defer buffersPool.Put(buffer) + base64.StdEncoding.Encode(buffer.Data, data) + return walletconnect.Sign(key, buffer.Data) default: panic(fmt.Sprintf("unsupported scheme %s", cfg.scheme)) } From d60ce83e4271747cb4ee89e55cdaa698f17011e9 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 26 Jan 2024 12:18:58 +0300 Subject: [PATCH 077/169] [#63] .forgejo: Update dco-go to v3 Signed-off-by: Evgenii Stratonikov --- .forgejo/workflows/dco.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/dco.yml b/.forgejo/workflows/dco.yml index 6746408..9aa0d31 100644 --- a/.forgejo/workflows/dco.yml +++ b/.forgejo/workflows/dco.yml @@ -16,6 +16,6 @@ jobs: go-version: '1.21' - name: Run commit format checker - uses: https://git.frostfs.info/TrueCloudLab/dco-go@v2 + uses: https://git.frostfs.info/TrueCloudLab/dco-go@v3 with: from: 'origin/${{ github.event.pull_request.base.ref }}' From 2a124b95bc02c8a14f0d4d0dd3988efe331a6233 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 15 Feb 2024 14:41:33 +0300 Subject: [PATCH 078/169] [#64] object: Allow to reset marshal data Signed-off-by: Dmitrii Stepanov --- object/marshal.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/object/marshal.go b/object/marshal.go index 18172e6..7f47d65 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -346,16 +346,12 @@ func (o *Object) StableMarshal(buf []byte) []byte { // SetMarshalData sets marshal data to reduce memory allocations. // -// It is unsafe to modify object data after setting marshal data. +// It is unsafe to modify/copy object data after setting marshal data. func (o *Object) SetMarshalData(data []byte) { if o == nil { return } - if data == nil { - o.marshalData = o.StableMarshal(nil) - } else { - o.marshalData = data - } + o.marshalData = data } func (o *Object) StableSize() (size int) { From 634e24aba71564e432c20a7fca787b23a19f5bf2 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 15 Feb 2024 15:38:48 +0300 Subject: [PATCH 079/169] [#65] object: Fix SetMarshalData for PutSingle request Allow to reset marshal data Signed-off-by: Dmitrii Stepanov --- object/marshal.go | 8 ++------ util/proto/marshal.go | 5 +++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/object/marshal.go b/object/marshal.go index 7f47d65..ddd5746 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -1111,17 +1111,13 @@ func (r *PutSingleRequestBody) StableMarshal(buf []byte) []byte { // SetMarshalData sets marshal data to reduce memory allocations. // -// It is unsafe to modify request data after setting marshal data. +// It is unsafe to modify/copy request data after setting marshal data. func (r *PutSingleRequestBody) SetMarshalData(data []byte) { if r == nil { return } - if data == nil { - r.marshalData = r.StableMarshal(nil) - } else { - r.marshalData = data - } + r.marshalData = data proto.NestedStructureSetMarshalData(putSingleReqObjectField, r.marshalData, r.object) } diff --git a/util/proto/marshal.go b/util/proto/marshal.go index 768cb2b..26b3eb0 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -287,6 +287,11 @@ func NestedStructureSetMarshalData[T any, M setMarshalData[T]](field int64, pare return 0 } + if parentData == nil { + v.SetMarshalData(nil) + return 0 + } + n := v.StableSize() buf := make([]byte, binary.MaxVarintLen64) prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) From c1c7b344b9c058c587a01f045e2a81f1f8e6575f Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 6 Mar 2024 13:14:49 +0300 Subject: [PATCH 080/169] [#67] go.mod: Bump protobuf version Found by vulncheck: Vulnerability #1: GO-2024-2611 Infinite loop in JSON unmarshaling in google.golang.org/protobuf More info: https://pkg.go.dev/vuln/GO-2024-2611 Module: google.golang.org/protobuf Found in: google.golang.org/protobuf@v1.32.0 Fixed in: google.golang.org/protobuf@v1.33.0 Signed-off-by: Dmitrii Stepanov --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 78c1bdb..0315850 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/stretchr/testify v1.8.3 golang.org/x/sync v0.2.0 google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 + google.golang.org/protobuf v1.33.0 ) require ( diff --git a/go.sum b/go.sum index bb23dce..56fc5d0 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From f69ad7ade00fdbeb4fc9783122daba2580ebb722 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 10:20:04 +0300 Subject: [PATCH 081/169] [#68] pre-commit: Remove gitlint Signed-off-by: Evgenii Stratonikov --- .gitlint | 10 ---------- .pre-commit-config.yaml | 6 ------ 2 files changed, 16 deletions(-) delete mode 100644 .gitlint diff --git a/.gitlint b/.gitlint deleted file mode 100644 index a1bb93d..0000000 --- a/.gitlint +++ /dev/null @@ -1,10 +0,0 @@ -[general] -fail-without-commits=true -contrib=CC1 - -[title-match-regex] -regex=^\[\#[0-9Xx]+\]\s - -[ignore-by-title] -regex=^Release(.*) -ignore=title-match-regex diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3050af4..46c9c89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,9 +22,3 @@ repos: rev: v1.51.2 hooks: - id: golangci-lint - - - repo: https://github.com/jorisroovers/gitlint - rev: v0.18.0 - hooks: - - id: gitlint - stages: [commit-msg] From 6fb9cae4793427b84b123430aca3477da6b837cc Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 10:22:56 +0300 Subject: [PATCH 082/169] [#68] pre-commit: Update golangci-lint to 1.56.2 Signed-off-by: Evgenii Stratonikov --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46c9c89..0e51210 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,6 +19,6 @@ repos: exclude: ".key$" - repo: https://github.com/golangci/golangci-lint - rev: v1.51.2 + rev: v1.56.2 hooks: - id: golangci-lint From a7bcad6aa9093b7edde5a1b2b5f7247b8e720af0 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 10:25:23 +0300 Subject: [PATCH 083/169] [#68] Makefile: Drop GO111MODULE usages It is ignored since go1.17. Signed-off-by: Evgenii Stratonikov --- Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e421213..cd5e84d 100755 --- a/Makefile +++ b/Makefile @@ -9,15 +9,12 @@ VERSION ?= $(shell git describe --tags --match "v*" --abbrev=8 --dirty --always) dep: @printf "⇒ Tidy requirements : " CGO_ENABLED=0 \ - GO111MODULE=on \ go mod tidy -v && echo OK @printf "⇒ Download requirements: " CGO_ENABLED=0 \ - GO111MODULE=on \ go mod download && echo OK @printf "⇒ Install test requirements: " CGO_ENABLED=0 \ - GO111MODULE=on \ go test ./... && echo OK # Run all code formatters @@ -27,14 +24,14 @@ fmts: fmt imports fmt: @echo "⇒ Processing gofmt check" @for f in `find . -type f -name '*.go' -not -path './vendor/*' -not -name '*.pb.go' -prune`; do \ - GO111MODULE=on gofmt -s -w $$f; \ + gofmt -s -w $$f; \ done # Reformat imports imports: @echo "⇒ Processing goimports check" @for f in `find . -type f -name '*.go' -not -path './vendor/*' -not -name '*.pb.go' -prune`; do \ - GO111MODULE=on goimports -w $$f; \ + goimports -w $$f; \ done # Regenerate code for proto files @@ -56,7 +53,7 @@ protoc: # Run Unit Test with go test test: @echo "⇒ Running go test" - @GO111MODULE=on go test ./... -count=1 + @go test ./... -count=1 # Run linters lint: From 4d35da7c775c9fccba8f98e963cd505d6dc9c47c Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 10:24:04 +0300 Subject: [PATCH 084/169] [#68] Makefile: Allow to override testflags Signed-off-by: Evgenii Stratonikov --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cd5e84d..888fd20 100755 --- a/Makefile +++ b/Makefile @@ -51,9 +51,10 @@ protoc: rm -rf vendor # Run Unit Test with go test +test: GOFLAGS ?= "-count=1" test: @echo "⇒ Running go test" - @go test ./... -count=1 + @GOFLAGS="$(GOFLAGS)" go test ./... # Run linters lint: From ea6e390c7b4d3336d66d88ef7d4fda69f8ea0cf6 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 10:27:36 +0300 Subject: [PATCH 085/169] [#68] pre-commit: Add unit test hook Signed-off-by: Evgenii Stratonikov --- .pre-commit-config.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e51210..35769c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,15 @@ repos: - id: end-of-file-fixer exclude: ".key$" + - repo: local + hooks: + - id: go-unit-tests + name: go unit tests + entry: make test GOFLAGS='' + pass_filenames: false + types: [go] + language: system + - repo: https://github.com/golangci/golangci-lint rev: v1.56.2 hooks: From a85146250b312fcdd6da9a71285527fed544234f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 10:31:18 +0300 Subject: [PATCH 086/169] [#68] Makefile: Use gofumpt for formatting Signed-off-by: Evgenii Stratonikov --- .pre-commit-config.yaml | 9 +++++++++ Makefile | 16 +++++++--------- object/attributes_test.go | 2 +- object/types.go | 3 +-- session/types.go | 3 ++- session/util.go | 12 ++++++++---- util/proto/marshal_test.go | 4 +--- util/protogen/main.go | 14 +++++++------- util/signature/walletconnect/sign_test.go | 1 - 9 files changed, 36 insertions(+), 28 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 35769c1..a64cbaa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,15 @@ repos: - id: end-of-file-fixer exclude: ".key$" + - repo: local + hooks: + - id: gofumpt + name: gofumpt + entry: make fumpt + pass_filenames: false + types: [go] + language: system + - repo: local hooks: - id: go-unit-tests diff --git a/Makefile b/Makefile index 888fd20..239565b 100755 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SHELL = bash VERSION ?= $(shell git describe --tags --match "v*" --abbrev=8 --dirty --always) -.PHONY: dep fmts fmt imports protoc test lint version help +.PHONY: dep fmts fumpt imports protoc test lint version help # Pull go dependencies dep: @@ -18,14 +18,7 @@ dep: go test ./... && echo OK # Run all code formatters -fmts: fmt imports - -# Reformat code -fmt: - @echo "⇒ Processing gofmt check" - @for f in `find . -type f -name '*.go' -not -path './vendor/*' -not -name '*.pb.go' -prune`; do \ - gofmt -s -w $$f; \ - done +fmts: fumpt imports # Reformat imports imports: @@ -34,6 +27,11 @@ imports: goimports -w $$f; \ done +# Run gofumpt +fumpt: + @echo "⇒ Processing gofumpt check" + @gofumpt -l -w . + # Regenerate code for proto files protoc: @GOPRIVATE=github.com/TrueCloudLab go mod vendor diff --git a/object/attributes_test.go b/object/attributes_test.go index 5bf411a..85635da 100644 --- a/object/attributes_test.go +++ b/object/attributes_test.go @@ -10,7 +10,7 @@ import ( func TestSetNotification(t *testing.T) { o := new(Object) - var ni = NotificationInfo{ + ni := NotificationInfo{ epoch: 10, topic: "test", } diff --git a/object/types.go b/object/types.go index 895afb0..f9e2ed6 100644 --- a/object/types.go +++ b/object/types.go @@ -318,8 +318,7 @@ type PutSingleRequest struct { session.RequestHeaders } -type PutSingleResponseBody struct { -} +type PutSingleResponseBody struct{} type PutSingleResponse struct { body *PutSingleResponseBody diff --git a/session/types.go b/session/types.go index 19cfecc..5732b29 100644 --- a/session/types.go +++ b/session/types.go @@ -632,7 +632,8 @@ func (r *ResponseMetaHeader) SetStatus(v *status.Status) { func SetStatus(msg interface { GetMetaHeader() *ResponseMetaHeader SetMetaHeader(*ResponseMetaHeader) -}, st *status.Status) { +}, st *status.Status, +) { meta := msg.GetMetaHeader() if meta == nil { meta = new(ResponseMetaHeader) diff --git a/session/util.go b/session/util.go index 7edca29..ff19deb 100644 --- a/session/util.go +++ b/session/util.go @@ -43,7 +43,8 @@ func (c *RequestHeaders) SetVerificationHeader(v *RequestVerificationHeader) { func (c *RequestHeaders) ToMessage(m interface { SetMetaHeader(*session.RequestMetaHeader) SetVerifyHeader(*session.RequestVerificationHeader) -}) { +}, +) { m.SetMetaHeader(c.metaHeader.ToGRPCMessage().(*session.RequestMetaHeader)) m.SetVerifyHeader(c.verifyHeader.ToGRPCMessage().(*session.RequestVerificationHeader)) } @@ -51,7 +52,8 @@ func (c *RequestHeaders) ToMessage(m interface { func (c *RequestHeaders) FromMessage(m interface { GetMetaHeader() *session.RequestMetaHeader GetVerifyHeader() *session.RequestVerificationHeader -}) error { +}, +) error { metaHdr := m.GetMetaHeader() if metaHdr == nil { c.metaHeader = nil @@ -122,7 +124,8 @@ func (c *ResponseHeaders) SetVerificationHeader(v *ResponseVerificationHeader) { func (c *ResponseHeaders) ToMessage(m interface { SetMetaHeader(*session.ResponseMetaHeader) SetVerifyHeader(*session.ResponseVerificationHeader) -}) { +}, +) { m.SetMetaHeader(c.metaHeader.ToGRPCMessage().(*session.ResponseMetaHeader)) m.SetVerifyHeader(c.verifyHeader.ToGRPCMessage().(*session.ResponseVerificationHeader)) } @@ -130,7 +133,8 @@ func (c *ResponseHeaders) ToMessage(m interface { func (c *ResponseHeaders) FromMessage(m interface { GetMetaHeader() *session.ResponseMetaHeader GetVerifyHeader() *session.ResponseVerificationHeader -}) error { +}, +) error { metaHdr := m.GetMetaHeader() if metaHdr == nil { c.metaHeader = nil diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index 11a4d8f..7119c8f 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -50,9 +50,7 @@ func (s *stablePrimitives) stableMarshal(buf []byte, wrongField bool) ([]byte, e buf = make([]byte, s.stableSize()) } - var ( - i, offset, fieldNum int - ) + var i, offset, fieldNum int fieldNum = 1 if wrongField { diff --git a/util/protogen/main.go b/util/protogen/main.go index fe89fbf..a295a28 100644 --- a/util/protogen/main.go +++ b/util/protogen/main.go @@ -205,22 +205,22 @@ type marshalerDesc struct { var marshalers = map[protoreflect.Kind]marshalerDesc{ protoreflect.BoolKind: {Prefix: "Bool"}, protoreflect.EnumKind: {Prefix: "Enum"}, - //protoreflect.Int32Kind: "", - //protoreflect.Sint32Kind: "", + // protoreflect.Int32Kind: "", + // protoreflect.Sint32Kind: "", protoreflect.Uint32Kind: {Prefix: "UInt32", RepeatedDouble: true}, protoreflect.Int64Kind: {Prefix: "Int64", RepeatedDouble: true}, - //protoreflect.Sint64Kind: "", + // protoreflect.Sint64Kind: "", protoreflect.Uint64Kind: {Prefix: "UInt64", RepeatedDouble: true}, - //protoreflect.Sfixed32Kind: "", + // protoreflect.Sfixed32Kind: "", protoreflect.Fixed32Kind: {Prefix: "Fixed32", RepeatedDouble: true}, - //protoreflect.FloatKind: "", - //protoreflect.Sfixed64Kind: "", + // protoreflect.FloatKind: "", + // protoreflect.Sfixed64Kind: "", protoreflect.Fixed64Kind: {Prefix: "Fixed64", RepeatedDouble: true}, protoreflect.DoubleKind: {Prefix: "Float64"}, protoreflect.StringKind: {Prefix: "String"}, protoreflect.BytesKind: {Prefix: "Bytes"}, protoreflect.MessageKind: {Prefix: "NestedStructure"}, - //protoreflect.GroupKind: "", + // protoreflect.GroupKind: "", } func sortFields(fs []*protogen.Field) []*protogen.Field { diff --git a/util/signature/walletconnect/sign_test.go b/util/signature/walletconnect/sign_test.go index b83e79f..1b4fe18 100644 --- a/util/signature/walletconnect/sign_test.go +++ b/util/signature/walletconnect/sign_test.go @@ -109,5 +109,4 @@ func TestVerifyNeonWallet(t *testing.T) { } require.True(t, VerifyMessage(nil, sm)) } - } From 1772b921826b876ca0b26cd137d52fbd73d1e613 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 19 Mar 2024 09:55:23 +0300 Subject: [PATCH 087/169] [#69] object: Initial EC implementation Signed-off-by: Evgenii Stratonikov --- accounting/grpc/service.pb.go | 7 +- accounting/grpc/service_grpc.pb.go | 2 +- accounting/grpc/types.pb.go | 4 +- acl/grpc/types.pb.go | 19 +- audit/grpc/types.pb.go | 14 +- container/grpc/service.pb.go | 15 +- container/grpc/service_grpc.pb.go | 26 +- container/grpc/types.pb.go | 31 +- lock/grpc/types.pb.go | 9 +- netmap/convert.go | 4 + netmap/grpc/service.pb.go | 4 +- netmap/grpc/service_grpc.pb.go | 20 +- netmap/grpc/types.pb.go | 222 +++++----- netmap/marshal.go | 12 +- netmap/types.go | 27 ++ object/convert.go | 106 +++++ object/grpc/service.pb.go | 670 ++++++++++++++++------------- object/grpc/service_grpc.pb.go | 2 +- object/grpc/types.pb.go | 494 ++++++++++++++++----- object/marshal.go | 46 ++ object/message_test.go | 1 + object/test/generate.go | 25 ++ object/types.go | 32 ++ refs/grpc/types.pb.go | 14 +- session/grpc/service.pb.go | 4 +- session/grpc/service_grpc.pb.go | 2 +- session/grpc/types.pb.go | 22 +- status/grpc/types.pb.go | 4 +- tombstone/grpc/types.pb.go | 11 +- util/proto/test/test.pb.go | 4 +- 30 files changed, 1240 insertions(+), 613 deletions(-) diff --git a/accounting/grpc/service.pb.go b/accounting/grpc/service.pb.go index 51b9fe3..fe193cd 100644 --- a/accounting/grpc/service.pb.go +++ b/accounting/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: accounting/grpc/service.proto package accounting @@ -216,7 +216,8 @@ func (x *BalanceRequest_Body) GetOwnerId() *grpc1.OwnerID { } // 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. +// Balance is given in the `Decimal` format to avoid precision issues with +// rounding. type BalanceResponse_Body struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/accounting/grpc/service_grpc.pb.go b/accounting/grpc/service_grpc.pb.go index 1aadfc0..cd1b2e9 100644 --- a/accounting/grpc/service_grpc.pb.go +++ b/accounting/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.23.4 +// - protoc v4.25.3 // source: accounting/grpc/service.proto package accounting diff --git a/accounting/grpc/types.pb.go b/accounting/grpc/types.pb.go index ae09338..592aa8b 100644 --- a/accounting/grpc/types.pb.go +++ b/accounting/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: accounting/grpc/types.proto package accounting diff --git a/acl/grpc/types.pb.go b/acl/grpc/types.pb.go index e245169..1b57b1a 100644 --- a/acl/grpc/types.pb.go +++ b/acl/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: acl/grpc/types.proto package acl @@ -32,7 +32,8 @@ const ( // System target rule is applied if sender is a storage node within the // container or an inner ring node Role_SYSTEM Role = 2 - // Others target rule is applied if sender is neither a user nor a system target + // Others target rule is applied if sender is neither a user nor a system + // target Role_OTHERS Role = 3 ) @@ -472,8 +473,8 @@ func (x *EACLTable) GetRecords() []*EACLRecord { // used in the similar use cases, like providing authorisation to externally // authenticated party. // -// BearerToken can be issued only by the container's owner and must be signed using -// the key associated with the container's `OwnerID`. +// BearerToken can be issued only by the container's owner and must be signed +// using the key associated with the container's `OwnerID`. type BearerToken struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -695,8 +696,8 @@ func (x *EACLRecord_Target) GetKeys() [][]byte { return nil } -// Bearer Token body structure contains Extended ACL table issued by the container -// owner with additional information preventing token abuse. +// Bearer Token body structure contains Extended ACL table issued by the +// container owner with additional information preventing token abuse. type BearerToken_Body struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -704,8 +705,8 @@ type BearerToken_Body struct { // Table of Extended ACL rules to use instead of the ones attached to the // container. If it contains `container_id` field, bearer token is only - // valid for this specific container. Otherwise, any container of the same owner - // is allowed. + // valid for this specific container. Otherwise, any container of the same + // owner is allowed. EaclTable *EACLTable `protobuf:"bytes,1,opt,name=eacl_table,json=eaclTable,proto3" json:"eacl_table,omitempty"` // `OwnerID` defines to whom the token was issued. It must match the request // originator's `OwnerID`. If empty, any token bearer will be accepted. diff --git a/audit/grpc/types.pb.go b/audit/grpc/types.pb.go index 8f437da..57243ef 100644 --- a/audit/grpc/types.pb.go +++ b/audit/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: audit/grpc/types.proto package audit @@ -47,12 +47,12 @@ type DataAuditResult struct { PassSg []*grpc.ObjectID `protobuf:"bytes,8,rep,name=pass_sg,json=passSG,proto3" json:"pass_sg,omitempty"` // List of Storage Groups that failed audit PoR stage FailSg []*grpc.ObjectID `protobuf:"bytes,9,rep,name=fail_sg,json=failSG,proto3" json:"fail_sg,omitempty"` - // Number of sampled objects under the audit placed in an optimal way according to - // the containers placement policy when checking PoP + // Number of sampled objects under the audit placed in an optimal way + // according to the containers placement policy when checking PoP Hit uint32 `protobuf:"varint,10,opt,name=hit,proto3" json:"hit,omitempty"` - // Number of sampled objects under the audit placed in suboptimal way according to - // the containers placement policy, but still at a satisfactory level when - // checking PoP + // Number of sampled objects under the audit placed in suboptimal way + // according to the containers placement policy, but still at a satisfactory + // level when checking PoP Miss uint32 `protobuf:"varint,11,opt,name=miss,proto3" json:"miss,omitempty"` // Number of sampled objects under the audit stored inconsistently with the // placement policy or not found at all when checking PoP diff --git a/container/grpc/service.pb.go b/container/grpc/service.pb.go index 8363e81..672e29f 100644 --- a/container/grpc/service.pb.go +++ b/container/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: container/grpc/service.proto package container @@ -1128,7 +1128,8 @@ type DeleteRequest_Body struct { // Identifier of the container to delete from NeoFS ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // `ContainerID` signed with the container owner's key according to RFC-6979. + // `ContainerID` signed with the container owner's key according to + // RFC-6979. Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` } @@ -1493,8 +1494,8 @@ func (x *SetExtendedACLRequest_Body) GetSignature() *grpc1.SignatureRFC6979 { } // `SetExtendedACLResponse` has an empty body because the operation is -// asynchronous and the update should be reflected in `Container` smart contract's -// storage after next block is issued in sidechain. +// asynchronous and the update should be reflected in `Container` smart +// contract's storage after next block is issued in sidechain. type SetExtendedACLResponse_Body struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1583,8 +1584,8 @@ func (x *GetExtendedACLRequest_Body) GetContainerId() *grpc1.ContainerID { } // Get Extended ACL Response body can be empty if the requested container does -// not have Extended ACL Table attached or Extended ACL has not been allowed at -// the time of container creation. +// not have Extended ACL Table attached or Extended ACL has not been allowed +// at the time of container creation. type GetExtendedACLResponse_Body struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/container/grpc/service_grpc.pb.go b/container/grpc/service_grpc.pb.go index 754665f..79b0533 100644 --- a/container/grpc/service_grpc.pb.go +++ b/container/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.23.4 +// - protoc v4.25.3 // source: container/grpc/service.proto package container @@ -34,8 +34,8 @@ const ( 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 - // verified by Inner Ring nodes. After one more block in sidechain, the container - // is added into smart contract storage. + // verified by Inner Ring nodes. After one more block in sidechain, the + // container is added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -44,8 +44,8 @@ type ContainerServiceClient interface { Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is - // verified by Inner Ring nodes. After one more block in sidechain, the container - // is added into smart contract storage. + // verified by Inner Ring nodes. After one more block in sidechain, the + // container is added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -69,8 +69,8 @@ type ContainerServiceClient interface { // - Common failures (SECTION_FAILURE_COMMON). List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response - // immediately. After one more block in sidechain, changes in an Extended ACL are - // added into smart contract storage. + // immediately. After one more block in sidechain, changes in an Extended ACL + // are added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -175,8 +175,8 @@ func (c *containerServiceClient) AnnounceUsedSpace(ctx context.Context, in *Anno 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 - // verified by Inner Ring nodes. After one more block in sidechain, the container - // is added into smart contract storage. + // verified by Inner Ring nodes. After one more block in sidechain, the + // container is added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -185,8 +185,8 @@ type ContainerServiceServer interface { Put(context.Context, *PutRequest) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is - // verified by Inner Ring nodes. After one more block in sidechain, the container - // is added into smart contract storage. + // verified by Inner Ring nodes. After one more block in sidechain, the + // container is added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -210,8 +210,8 @@ type ContainerServiceServer interface { // - Common failures (SECTION_FAILURE_COMMON). List(context.Context, *ListRequest) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response - // immediately. After one more block in sidechain, changes in an Extended ACL are - // added into smart contract storage. + // immediately. After one more block in sidechain, changes in an Extended ACL + // are added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ diff --git a/container/grpc/types.pb.go b/container/grpc/types.pb.go index 59780d5..c484a0d 100644 --- a/container/grpc/types.pb.go +++ b/container/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: container/grpc/types.proto package container @@ -24,8 +24,8 @@ const ( // 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. +// access control information. An ID of a container is a 32 byte long SHA256 +// hash of stable-marshalled container message. type Container struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -38,8 +38,8 @@ type Container struct { OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` // Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` - // `BasicACL` contains access control rules for the owner, system and others groups, - // as well as permission bits for `BearerToken` and `Extended ACL` + // `BasicACL` contains access control rules for the owner, system and others + // groups, as well as permission bits for `BearerToken` and `Extended ACL` BasicAcl uint32 `protobuf:"varint,4,opt,name=basic_acl,json=basicACL,proto3" json:"basic_acl,omitempty"` // Attributes represent immutable container's meta data Attributes []*Container_Attribute `protobuf:"bytes,5,rep,name=attributes,proto3" json:"attributes,omitempty"` @@ -122,8 +122,8 @@ func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { } // `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. +// 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 @@ -137,15 +137,16 @@ func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { // 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`. +// String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). +// Used as a TLD of a domain name in NNS contract. If no zone is specified, +// use default zone: `container`. // - [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \ // (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ -// Disables homomorphic hashing for the container if the value equals "true" string. -// Any other values are interpreted as missing attribute. Container could be -// accepted in a NeoFS network only if the global network hashing configuration -// value corresponds with that attribute's value. After container inclusion, network -// setting is ignored. +// Disables homomorphic hashing for the container if the value equals "true" +// string. Any other values are interpreted as missing attribute. Container +// could be accepted in a NeoFS network only if the global network hashing +// configuration value corresponds with that attribute's value. After +// container inclusion, network setting is ignored. // // And some well-known attributes used by applications only: // diff --git a/lock/grpc/types.pb.go b/lock/grpc/types.pb.go index 100d648..c2d66f1 100644 --- a/lock/grpc/types.pb.go +++ b/lock/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: lock/grpc/types.proto package lock @@ -23,8 +23,9 @@ const ( // 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. +// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) +// attribute. Lock object MUST have expiration epoch. It is impossible to delete +// a lock object via ObjectService.Delete RPC call. type Lock struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/netmap/convert.go b/netmap/convert.go index 0e25949..fad7380 100644 --- a/netmap/convert.go +++ b/netmap/convert.go @@ -142,6 +142,8 @@ func (r *Replica) ToGRPCMessage() grpc.Message { m.SetSelector(r.selector) m.SetCount(r.count) + m.EcDataCount = r.ecDataCount + m.EcParityCount = r.ecParityCount } return m @@ -155,6 +157,8 @@ func (r *Replica) FromGRPCMessage(m grpc.Message) error { r.selector = v.GetSelector() r.count = v.GetCount() + r.ecDataCount = v.GetEcDataCount() + r.ecParityCount = v.GetEcParityCount() return nil } diff --git a/netmap/grpc/service.pb.go b/netmap/grpc/service.pb.go index 711a3c9..7694f3f 100644 --- a/netmap/grpc/service.pb.go +++ b/netmap/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: netmap/grpc/service.proto package netmap diff --git a/netmap/grpc/service_grpc.pb.go b/netmap/grpc/service_grpc.pb.go index dec7d7f..00cb8de 100644 --- a/netmap/grpc/service_grpc.pb.go +++ b/netmap/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.23.4 +// - protoc v4.25.3 // source: netmap/grpc/service.proto package netmap @@ -29,10 +29,11 @@ const ( // 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. type NetmapServiceClient interface { // Get NodeInfo structure from the particular node directly. - // Node information can be taken from `Netmap` smart contract. In some cases, though, - // one may want to get recent information directly or to talk to the node not yet - // present in the `Network Map` to find out what API version can be used for - // further communication. This can be also used to check if a node is up and running. + // Node information can be taken from `Netmap` smart contract. In some cases, + // though, one may want to get recent information directly or to talk to the + // node not yet present in the `Network Map` to find out what API version can + // be used for further communication. This can be also used to check if a node + // is up and running. // // Statuses: // - **OK** (0, SECTION_SUCCESS): @@ -95,10 +96,11 @@ func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnap // for forward compatibility type NetmapServiceServer interface { // Get NodeInfo structure from the particular node directly. - // Node information can be taken from `Netmap` smart contract. In some cases, though, - // one may want to get recent information directly or to talk to the node not yet - // present in the `Network Map` to find out what API version can be used for - // further communication. This can be also used to check if a node is up and running. + // Node information can be taken from `Netmap` smart contract. In some cases, + // though, one may want to get recent information directly or to talk to the + // node not yet present in the `Network Map` to find out what API version can + // be used for further communication. This can be also used to check if a node + // is up and running. // // Statuses: // - **OK** (0, SECTION_SUCCESS): diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index f4991a9..385713d 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: netmap/grpc/types.proto package netmap @@ -213,8 +213,8 @@ func (NodeInfo_State) EnumDescriptor() ([]byte, []int) { return file_netmap_grpc_types_proto_rawDescGZIP(), []int{4, 0} } -// This filter will return the subset of nodes from `NetworkMap` or another filter's -// results that will satisfy filter's conditions. +// This filter will return the subset of nodes from `NetworkMap` or another +// filter's results that will satisfy filter's conditions. type Filter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -401,6 +401,10 @@ type Replica struct { Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` // Named selector bucket to put replicas Selector string `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` + // Data shards count + EcDataCount uint32 `protobuf:"varint,6,opt,name=ec_data_count,json=ecDataCount,proto3" json:"ec_data_count,omitempty"` + // Parity shards count + EcParityCount uint32 `protobuf:"varint,7,opt,name=ec_parity_count,json=ecParityCount,proto3" json:"ec_parity_count,omitempty"` } func (x *Replica) Reset() { @@ -449,6 +453,20 @@ func (x *Replica) GetSelector() string { return "" } +func (x *Replica) GetEcDataCount() uint32 { + if x != nil { + return x.EcDataCount + } + return 0 +} + +func (x *Replica) GetEcParityCount() uint32 { + if x != nil { + return x.EcParityCount + } + return 0 +} + // Set of rules to select a subset of nodes from `NetworkMap` able to store // container's objects. The format is simple enough to transpile from different // storage policy definition languages. @@ -734,7 +752,8 @@ type NetworkInfo struct { CurrentEpoch uint64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` // Magic number of the sidechain of the NeoFS network MagicNumber uint64 `protobuf:"varint,2,opt,name=magic_number,json=magicNumber,proto3" json:"magic_number,omitempty"` - // MillisecondsPerBlock network parameter of the sidechain of the NeoFS network + // MillisecondsPerBlock network parameter of the sidechain of the NeoFS + // network MsPerBlock int64 `protobuf:"varint,3,opt,name=ms_per_block,json=msPerBlock,proto3" json:"ms_per_block,omitempty"` // NeoFS network configuration NetworkConfig *NetworkConfig `protobuf:"bytes,4,opt,name=network_config,json=networkConfig,proto3" json:"network_config,omitempty"` @@ -806,15 +825,15 @@ func (x *NetworkInfo) GetNetworkConfig() *NetworkConfig { // string. Value can't be empty. // // Attributes can be constructed into a chain of attributes: any attribute can -// have a parent attribute and a child attribute (except the first and the last -// one). A string representation of the chain of attributes in NeoFS Storage -// Node configuration uses ":" and "/" symbols, e.g.: +// have a parent attribute and a child attribute (except the first and the +// last one). A string representation of the chain of attributes in NeoFS +// Storage Node configuration uses ":" and "/" symbols, e.g.: // // `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` // -// Therefore the string attribute representation in the Node configuration must -// use "\:", "\/" and "\\" escaped symbols if any of them appears in an attribute's -// key or value. +// Therefore the string attribute representation in the Node configuration +// must use "\:", "\/" and "\\" escaped symbols if any of them appears in an +// attribute's key or value. // // Node's attributes are mostly used during Storage Policy evaluation to // calculate object's placement and find a set of nodes satisfying policy @@ -968,6 +987,12 @@ func (x *NodeInfo_Attribute) GetParents() []string { // - **WithdrawFee** \ // Fee paid for withdrawal of funds paid by the account owner. // Value: little-endian integer. Default: 0. +// - **MaxECDataCount** \ +// Maximum number of data shards for EC placement policy. +// Value: little-endian integer. Default: 0. +// - **MaxECParityCount** \ +// Maximum number of parity shards for EC placement policy. +// Value: little-endian integer. Default: 0. type NetworkConfig_Parameter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1051,92 +1076,97 @@ var file_netmap_grpc_types_proto_rawDesc = []byte{ 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x07, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x14, 0x0a, - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, - 0x86, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x52, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x66, - 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x46, 0x61, 0x63, 0x74, - 0x6f, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x52, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x07, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, - 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x22, 0xd8, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x1a, 0x4d, 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, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, - 0x42, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, - 0x49, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, - 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, - 0x45, 0x10, 0x03, 0x22, 0x50, 0x0a, 0x06, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x14, 0x0a, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x12, 0x30, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x65, 0x72, 0x22, 0x87, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x14, + 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x63, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x69, 0x74, + 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x65, + 0x63, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x86, 0x02, 0x0a, + 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x08, 0x72, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x66, 0x61, 0x63, 0x74, + 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, + 0x38, 0x0a, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, - 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, - 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x49, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x73, 0x1a, 0x33, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, - 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, - 0x20, 0x0a, 0x0c, 0x6d, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x73, 0x50, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x12, 0x46, 0x0a, 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x70, 0x0a, 0x09, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, - 0x02, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x54, 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, - 0x04, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10, 0x05, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, - 0x06, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10, 0x07, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, - 0x10, 0x08, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x4f, 0x54, 0x10, 0x09, 0x2a, 0x38, 0x0a, 0x06, 0x43, - 0x6c, 0x61, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, - 0x04, 0x53, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, - 0x4e, 0x43, 0x54, 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, - 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, - 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, - 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, - 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, - 0x49, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, + 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, + 0x6e, 0x69, 0x71, 0x75, 0x65, 0x22, 0xd8, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, + 0x44, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x4d, 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, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x42, 0x0a, 0x05, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, + 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, + 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, + 0x22, 0x50, 0x0a, 0x06, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x30, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, + 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x6e, 0x6f, 0x64, + 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x49, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, + 0x33, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, + 0x69, 0x63, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0c, + 0x6d, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x73, 0x50, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x46, + 0x0a, 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x70, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, + 0x0a, 0x02, 0x45, 0x51, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x06, + 0x0a, 0x02, 0x47, 0x54, 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, 0x04, 0x12, 0x06, + 0x0a, 0x02, 0x4c, 0x54, 0x10, 0x05, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x06, + 0x0a, 0x02, 0x4f, 0x52, 0x10, 0x07, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x08, 0x12, + 0x07, 0x0a, 0x03, 0x4e, 0x4f, 0x54, 0x10, 0x09, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c, 0x61, 0x75, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, + 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, 0x43, 0x54, + 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, + 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, + 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/netmap/marshal.go b/netmap/marshal.go index 4f2c1ce..95430da 100644 --- a/netmap/marshal.go +++ b/netmap/marshal.go @@ -19,8 +19,10 @@ const ( attributeSelectorField = 4 filterSelectorField = 5 - countReplicaField = 1 - selectorReplicaField = 2 + countReplicaField = 1 + selectorReplicaField = 2 + ecDataCountReplicaField = 3 + ecParityCountReplicaField = 4 replicasPolicyField = 1 backupPolicyField = 2 @@ -134,7 +136,9 @@ func (r *Replica) StableMarshal(buf []byte) []byte { var offset int offset += protoutil.UInt32Marshal(countReplicaField, buf[offset:], r.count) - protoutil.StringMarshal(selectorReplicaField, buf[offset:], r.selector) + offset += protoutil.StringMarshal(selectorReplicaField, buf[offset:], r.selector) + offset += protoutil.UInt32Marshal(ecDataCountReplicaField, buf[offset:], r.ecDataCount) + protoutil.UInt32Marshal(ecParityCountReplicaField, buf[offset:], r.ecParityCount) return buf } @@ -146,6 +150,8 @@ func (r *Replica) StableSize() (size int) { size += protoutil.UInt32Size(countReplicaField, r.count) size += protoutil.StringSize(selectorReplicaField, r.selector) + size += protoutil.UInt32Size(ecDataCountReplicaField, r.ecDataCount) + size += protoutil.UInt32Size(ecParityCountReplicaField, r.ecParityCount) return size } diff --git a/netmap/types.go b/netmap/types.go index bda9ec6..dd5db68 100644 --- a/netmap/types.go +++ b/netmap/types.go @@ -50,6 +50,9 @@ type Selector struct { type Replica struct { count uint32 selector string + + ecDataCount uint32 + ecParityCount uint32 } type Operation uint32 @@ -259,6 +262,30 @@ func (r *Replica) SetCount(count uint32) { r.count = count } +func (r *Replica) GetECDataCount() uint32 { + if r != nil { + return r.ecDataCount + } + + return 0 +} + +func (r *Replica) SetECDataCount(count uint32) { + r.ecDataCount = count +} + +func (r *Replica) GetECParityCount() uint32 { + if r != nil { + return r.ecParityCount + } + + return 0 +} + +func (r *Replica) SetECParityCount(count uint32) { + r.ecParityCount = count +} + func (p *PlacementPolicy) GetUnique() bool { if p != nil { return p.unique diff --git a/object/convert.go b/object/convert.go index 07bf89c..8d6c73f 100644 --- a/object/convert.go +++ b/object/convert.go @@ -262,6 +262,51 @@ func (h *SplitHeader) FromGRPCMessage(m grpc.Message) error { return nil } +func (h *ECHeader) ToGRPCMessage() grpc.Message { + var m *object.Header_EC + + if h != nil { + m = new(object.Header_EC) + + m.Parent = h.Parent.ToGRPCMessage().(*refsGRPC.ObjectID) + m.Index = h.Index + m.Total = h.Total + m.Header = h.Header + m.HeaderLength = h.HeaderLength + } + + return m +} + +func (h *ECHeader) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.Header_EC) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + par := v.GetParent() + if par == nil { + h.Parent = nil + } else { + if h.Parent == nil { + h.Parent = new(refs.ObjectID) + } + + err = h.Parent.FromGRPCMessage(par) + if err != nil { + return err + } + } + + h.Index = v.GetIndex() + h.Total = v.GetTotal() + h.Header = v.GetHeader() + h.HeaderLength = v.GetHeaderLength() + return nil +} + func (h *Header) ToGRPCMessage() grpc.Message { var m *object.Header @@ -275,6 +320,7 @@ func (h *Header) ToGRPCMessage() grpc.Message { m.SetContainerId(h.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) m.SetSessionToken(h.sessionToken.ToGRPCMessage().(*sessionGRPC.SessionToken)) m.SetSplit(h.split.ToGRPCMessage().(*object.Header_Split)) + m.Ec = h.ec.ToGRPCMessage().(*object.Header_EC) m.SetAttributes(AttributesToGRPC(h.attr)) m.SetPayloadLength(h.payloadLen) m.SetCreationEpoch(h.creatEpoch) @@ -313,6 +359,9 @@ func (h *Header) FromGRPCMessage(m grpc.Message) error { if err := h.fillSplitHeader(v); err != nil { return err } + if err := h.fillECHeader(v); err != nil { + return err + } h.attr, err = AttributesFromGRPC(v.GetAttributes()) if err != nil { @@ -417,6 +466,19 @@ func (h *Header) fillSplitHeader(v *object.Header) error { return h.split.FromGRPCMessage(split) } +func (h *Header) fillECHeader(v *object.Header) error { + ec := v.GetEc() + if ec == nil { + h.ec = nil + return nil + } + + if h.ec == nil { + h.ec = new(ECHeader) + } + return h.ec.FromGRPCMessage(ec) +} + func (h *HeaderWithSignature) ToGRPCMessage() grpc.Message { var m *object.HeaderWithSignature @@ -591,6 +653,50 @@ func (s *SplitInfo) FromGRPCMessage(m grpc.Message) error { return nil } +func (s *ECInfo) ToGRPCMessage() grpc.Message { + var m *object.ECInfo + + if s != nil { + m = new(object.ECInfo) + + if s.Chunks != nil { + chunks := make([]*object.ECInfo_Chunk, len(s.Chunks)) + for i := range chunks { + chunks[i] = &object.ECInfo_Chunk{ + Id: s.Chunks[i].ID.ToGRPCMessage().(*refsGRPC.ObjectID), + Index: s.Chunks[i].Index, + Total: s.Chunks[i].Total, + } + } + m.Chunks = chunks + } + } + + return m +} + +func (s *ECInfo) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.ECInfo) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + chunks := v.GetChunks() + if chunks == nil { + s.Chunks = nil + } else { + s.Chunks = make([]ECChunk, len(chunks)) + for i := range chunks { + if err := s.Chunks[i].ID.FromGRPCMessage(chunks[i].Id); err != nil { + return err + } + s.Chunks[i].Index = chunks[i].Index + s.Chunks[i].Total = chunks[i].Total + } + } + return nil +} + func (r *GetRequestBody) ToGRPCMessage() grpc.Message { var m *object.GetRequest_Body diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index d339aef..2bfb50b 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: object/grpc/service.proto package object @@ -1337,6 +1337,7 @@ type GetResponse_Body struct { // *GetResponse_Body_Init_ // *GetResponse_Body_Chunk // *GetResponse_Body_SplitInfo + // *GetResponse_Body_EcInfo ObjectPart isGetResponse_Body_ObjectPart `protobuf_oneof:"object_part"` } @@ -1400,6 +1401,13 @@ func (x *GetResponse_Body) GetSplitInfo() *SplitInfo { return nil } +func (x *GetResponse_Body) GetEcInfo() *ECInfo { + if x, ok := x.GetObjectPart().(*GetResponse_Body_EcInfo); ok { + return x.EcInfo + } + return nil +} + type isGetResponse_Body_ObjectPart interface { isGetResponse_Body_ObjectPart() } @@ -1419,12 +1427,19 @@ type GetResponse_Body_SplitInfo struct { SplitInfo *SplitInfo `protobuf:"bytes,3,opt,name=split_info,json=splitInfo,proto3,oneof"` } +type GetResponse_Body_EcInfo struct { + // Meta information for EC object assembly. + EcInfo *ECInfo `protobuf:"bytes,4,opt,name=ec_info,json=ecInfo,proto3,oneof"` +} + func (*GetResponse_Body_Init_) isGetResponse_Body_ObjectPart() {} func (*GetResponse_Body_Chunk) isGetResponse_Body_ObjectPart() {} func (*GetResponse_Body_SplitInfo) isGetResponse_Body_ObjectPart() {} +func (*GetResponse_Body_EcInfo) isGetResponse_Body_ObjectPart() {} + // Initial part of the `Object` structure stream. Technically it's a // set of all `Object` structure's fields except `payload`. type GetResponse_Body_Init struct { @@ -1894,6 +1909,7 @@ type HeadResponse_Body struct { // *HeadResponse_Body_Header // *HeadResponse_Body_ShortHeader // *HeadResponse_Body_SplitInfo + // *HeadResponse_Body_EcInfo Head isHeadResponse_Body_Head `protobuf_oneof:"head"` } @@ -1957,6 +1973,13 @@ func (x *HeadResponse_Body) GetSplitInfo() *SplitInfo { return nil } +func (x *HeadResponse_Body) GetEcInfo() *ECInfo { + if x, ok := x.GetHead().(*HeadResponse_Body_EcInfo); ok { + return x.EcInfo + } + return nil +} + type isHeadResponse_Body_Head interface { isHeadResponse_Body_Head() } @@ -1976,12 +1999,19 @@ type HeadResponse_Body_SplitInfo struct { SplitInfo *SplitInfo `protobuf:"bytes,3,opt,name=split_info,json=splitInfo,proto3,oneof"` } +type HeadResponse_Body_EcInfo struct { + // Meta information for EC object assembly. + EcInfo *ECInfo `protobuf:"bytes,4,opt,name=ec_info,json=ecInfo,proto3,oneof"` +} + func (*HeadResponse_Body_Header) isHeadResponse_Body_Head() {} func (*HeadResponse_Body_ShortHeader) isHeadResponse_Body_Head() {} func (*HeadResponse_Body_SplitInfo) isHeadResponse_Body_Head() {} +func (*HeadResponse_Body_EcInfo) isHeadResponse_Body_Head() {} + // Object Search request body type SearchRequest_Body struct { state protoimpl.MessageState @@ -2301,6 +2331,7 @@ type GetRangeResponse_Body struct { // // *GetRangeResponse_Body_Chunk // *GetRangeResponse_Body_SplitInfo + // *GetRangeResponse_Body_EcInfo RangePart isGetRangeResponse_Body_RangePart `protobuf_oneof:"range_part"` } @@ -2357,6 +2388,13 @@ func (x *GetRangeResponse_Body) GetSplitInfo() *SplitInfo { return nil } +func (x *GetRangeResponse_Body) GetEcInfo() *ECInfo { + if x, ok := x.GetRangePart().(*GetRangeResponse_Body_EcInfo); ok { + return x.EcInfo + } + return nil +} + type isGetRangeResponse_Body_RangePart interface { isGetRangeResponse_Body_RangePart() } @@ -2371,10 +2409,17 @@ type GetRangeResponse_Body_SplitInfo struct { SplitInfo *SplitInfo `protobuf:"bytes,2,opt,name=split_info,json=splitInfo,proto3,oneof"` } +type GetRangeResponse_Body_EcInfo struct { + // Meta information for EC object assembly. + EcInfo *ECInfo `protobuf:"bytes,3,opt,name=ec_info,json=ecInfo,proto3,oneof"` +} + func (*GetRangeResponse_Body_Chunk) isGetRangeResponse_Body_RangePart() {} func (*GetRangeResponse_Body_SplitInfo) isGetRangeResponse_Body_RangePart() {} +func (*GetRangeResponse_Body_EcInfo) isGetRangeResponse_Body_RangePart() {} + // Get hash of object's payload part request body. type GetRangeHashRequest_Body struct { state protoimpl.MessageState @@ -2640,7 +2685,7 @@ var file_object_grpc_service_proto_rawDesc = []byte{ 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x03, 0x72, 0x61, 0x77, 0x22, 0xb9, 0x04, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x03, 0x72, 0x61, 0x77, 0x22, 0xee, 0x04, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, @@ -2654,7 +2699,7 @@ var file_object_grpc_service_proto_rawDesc = []byte{ 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, 0xd5, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, + 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x8a, 0x03, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, @@ -2664,260 +2709,270 @@ var file_object_grpc_service_proto_rawDesc = []byte{ 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x6c, - 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0xa8, 0x01, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, + 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 0x0a, 0x07, 0x65, 0x63, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, + 0x6f, 0x48, 0x00, 0x52, 0x06, 0x65, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0xa8, 0x01, 0x0a, 0x04, + 0x49, 0x6e, 0x69, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, + 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x70, 0x61, 0x72, 0x74, 0x22, 0x9b, 0x04, 0x0a, 0x0a, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 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, 0xbb, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3c, + 0x0a, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, + 0x49, 0x6e, 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x05, + 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x63, + 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0xcd, 0x01, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x35, 0x0a, + 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, + 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, + 0x61, 0x72, 0x74, 0x22, 0xa0, 0x02, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 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, 0x3d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, - 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, - 0x22, 0x9b, 0x04, 0x0a, 0x0a, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x35, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2e, 0x50, 0x75, 0x74, 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, 0xbb, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3c, 0x0a, 0x04, 0x69, 0x6e, 0x69, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x48, - 0x00, 0x52, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x1a, - 0xcd, 0x01, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, - 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, - 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, - 0x70, 0x69, 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, - 0x0d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x22, 0xa0, - 0x02, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, - 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, - 0x50, 0x75, 0x74, 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, 0x3d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, - 0x64, 0x22, 0x9e, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 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, 0x39, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, - 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x22, 0xa6, 0x02, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 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, 0x3d, 0x0a, 0x04, - 0x42, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x52, 0x09, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x22, 0xc9, 0x02, 0x0a, 0x0b, - 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, - 0x64, 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, 0x68, 0x0a, - 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, - 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x61, 0x69, - 0x6e, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, 0x80, 0x01, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, - 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xb7, 0x03, 0x0a, 0x0c, 0x48, - 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, - 0x64, 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, 0xd1, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3f, 0x0a, 0x06, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0c, 0x73, 0x68, - 0x6f, 0x72, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, - 0x00, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3c, - 0x0a, 0x0a, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x48, - 0x00, 0x52, 0x09, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x06, 0x0a, 0x04, - 0x68, 0x65, 0x61, 0x64, 0x22, 0xfb, 0x03, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 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, 0x95, 0x02, 0x0a, 0x04, 0x42, - 0x6f, 0x64, 0x79, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, - 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x73, 0x1a, 0x6c, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3a, - 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 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, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x22, 0x9e, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 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, 0x39, 0x0a, 0x04, - 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x69, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 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, - 0x06, 0x69, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x37, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x22, 0xe3, 0x02, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 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, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 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, 0x7a, 0x0a, 0x04, 0x42, 0x6f, - 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2d, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, - 0x61, 0x6e, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, 0xd7, 0x02, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, - 0x52, 0x61, 0x6e, 0x67, 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, + 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa6, 0x02, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 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, 0x3d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x74, 0x6f, 0x6d, + 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x09, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, + 0x22, 0xc9, 0x02, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x36, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 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, 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, + 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, 0x68, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, + 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, + 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, 0x80, 0x01, 0x0a, + 0x13, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, + 0xec, 0x03, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x37, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 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, 0x86, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3f, + 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x42, 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0a, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x33, 0x0a, 0x07, 0x65, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x06, + 0x65, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x06, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x22, 0xfb, + 0x03, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 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, 0x6a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x16, 0x0a, 0x05, - 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x63, - 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x3c, 0x0a, 0x0a, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x6e, - 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x70, 0x6c, 0x69, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, + 0x61, 0x64, 0x65, 0x72, 0x1a, 0x95, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3e, 0x0a, + 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, + 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x6c, + 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa2, 0x02, 0x0a, + 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 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, 0x39, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, + 0x0a, 0x07, 0x69, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 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, 0x06, 0x69, 0x64, 0x4c, 0x69, 0x73, + 0x74, 0x22, 0x37, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0xe3, 0x02, 0x0a, 0x0f, 0x47, + 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, + 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 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, 0x7a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x2d, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x72, 0x61, 0x77, + 0x22, 0x8d, 0x03, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 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, 0x9f, + 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x16, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x12, + 0x3c, 0x0a, 0x0a, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 0x0a, + 0x07, 0x65, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x06, 0x65, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x0c, 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x22, 0xa2, 0x03, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, @@ -3111,12 +3166,13 @@ var file_object_grpc_service_proto_goTypes = []interface{}{ (*grpc1.Signature)(nil), // 42: neo.fs.v2.refs.Signature (*grpc1.Address)(nil), // 43: neo.fs.v2.refs.Address (*SplitInfo)(nil), // 44: neo.fs.v2.object.SplitInfo - (*grpc1.ObjectID)(nil), // 45: neo.fs.v2.refs.ObjectID - (*ShortHeader)(nil), // 46: neo.fs.v2.object.ShortHeader - (*grpc1.ContainerID)(nil), // 47: neo.fs.v2.refs.ContainerID - (MatchType)(0), // 48: neo.fs.v2.object.MatchType - (grpc1.ChecksumType)(0), // 49: neo.fs.v2.refs.ChecksumType - (*Object)(nil), // 50: neo.fs.v2.object.Object + (*ECInfo)(nil), // 45: neo.fs.v2.object.ECInfo + (*grpc1.ObjectID)(nil), // 46: neo.fs.v2.refs.ObjectID + (*ShortHeader)(nil), // 47: neo.fs.v2.object.ShortHeader + (*grpc1.ContainerID)(nil), // 48: neo.fs.v2.refs.ContainerID + (MatchType)(0), // 49: neo.fs.v2.object.MatchType + (grpc1.ChecksumType)(0), // 50: neo.fs.v2.refs.ChecksumType + (*Object)(nil), // 51: neo.fs.v2.object.Object } var file_object_grpc_service_proto_depIdxs = []int32{ 18, // 0: neo.fs.v2.object.GetRequest.body:type_name -> neo.fs.v2.object.GetRequest.Body @@ -3172,53 +3228,56 @@ var file_object_grpc_service_proto_depIdxs = []int32{ 43, // 50: neo.fs.v2.object.GetRequest.Body.address:type_name -> neo.fs.v2.refs.Address 20, // 51: neo.fs.v2.object.GetResponse.Body.init:type_name -> neo.fs.v2.object.GetResponse.Body.Init 44, // 52: neo.fs.v2.object.GetResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 45, // 53: neo.fs.v2.object.GetResponse.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID - 42, // 54: neo.fs.v2.object.GetResponse.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature - 41, // 55: neo.fs.v2.object.GetResponse.Body.Init.header:type_name -> neo.fs.v2.object.Header - 22, // 56: neo.fs.v2.object.PutRequest.Body.init:type_name -> neo.fs.v2.object.PutRequest.Body.Init - 45, // 57: neo.fs.v2.object.PutRequest.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID - 42, // 58: neo.fs.v2.object.PutRequest.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature - 41, // 59: neo.fs.v2.object.PutRequest.Body.Init.header:type_name -> neo.fs.v2.object.Header - 45, // 60: neo.fs.v2.object.PutResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID - 43, // 61: neo.fs.v2.object.DeleteRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 43, // 62: neo.fs.v2.object.DeleteResponse.Body.tombstone:type_name -> neo.fs.v2.refs.Address - 43, // 63: neo.fs.v2.object.HeadRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 7, // 64: neo.fs.v2.object.HeadResponse.Body.header:type_name -> neo.fs.v2.object.HeaderWithSignature - 46, // 65: neo.fs.v2.object.HeadResponse.Body.short_header:type_name -> neo.fs.v2.object.ShortHeader - 44, // 66: neo.fs.v2.object.HeadResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 47, // 67: neo.fs.v2.object.SearchRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 29, // 68: neo.fs.v2.object.SearchRequest.Body.filters:type_name -> neo.fs.v2.object.SearchRequest.Body.Filter - 48, // 69: neo.fs.v2.object.SearchRequest.Body.Filter.match_type:type_name -> neo.fs.v2.object.MatchType - 45, // 70: neo.fs.v2.object.SearchResponse.Body.id_list:type_name -> neo.fs.v2.refs.ObjectID - 43, // 71: neo.fs.v2.object.GetRangeRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 11, // 72: neo.fs.v2.object.GetRangeRequest.Body.range:type_name -> neo.fs.v2.object.Range - 44, // 73: neo.fs.v2.object.GetRangeResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 43, // 74: neo.fs.v2.object.GetRangeHashRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 11, // 75: neo.fs.v2.object.GetRangeHashRequest.Body.ranges:type_name -> neo.fs.v2.object.Range - 49, // 76: neo.fs.v2.object.GetRangeHashRequest.Body.type:type_name -> neo.fs.v2.refs.ChecksumType - 49, // 77: neo.fs.v2.object.GetRangeHashResponse.Body.type:type_name -> neo.fs.v2.refs.ChecksumType - 50, // 78: neo.fs.v2.object.PutSingleRequest.Body.object:type_name -> neo.fs.v2.object.Object - 0, // 79: neo.fs.v2.object.ObjectService.Get:input_type -> neo.fs.v2.object.GetRequest - 2, // 80: neo.fs.v2.object.ObjectService.Put:input_type -> neo.fs.v2.object.PutRequest - 4, // 81: neo.fs.v2.object.ObjectService.Delete:input_type -> neo.fs.v2.object.DeleteRequest - 6, // 82: neo.fs.v2.object.ObjectService.Head:input_type -> neo.fs.v2.object.HeadRequest - 9, // 83: neo.fs.v2.object.ObjectService.Search:input_type -> neo.fs.v2.object.SearchRequest - 12, // 84: neo.fs.v2.object.ObjectService.GetRange:input_type -> neo.fs.v2.object.GetRangeRequest - 14, // 85: neo.fs.v2.object.ObjectService.GetRangeHash:input_type -> neo.fs.v2.object.GetRangeHashRequest - 16, // 86: neo.fs.v2.object.ObjectService.PutSingle:input_type -> neo.fs.v2.object.PutSingleRequest - 1, // 87: neo.fs.v2.object.ObjectService.Get:output_type -> neo.fs.v2.object.GetResponse - 3, // 88: neo.fs.v2.object.ObjectService.Put:output_type -> neo.fs.v2.object.PutResponse - 5, // 89: neo.fs.v2.object.ObjectService.Delete:output_type -> neo.fs.v2.object.DeleteResponse - 8, // 90: neo.fs.v2.object.ObjectService.Head:output_type -> neo.fs.v2.object.HeadResponse - 10, // 91: neo.fs.v2.object.ObjectService.Search:output_type -> neo.fs.v2.object.SearchResponse - 13, // 92: neo.fs.v2.object.ObjectService.GetRange:output_type -> neo.fs.v2.object.GetRangeResponse - 15, // 93: neo.fs.v2.object.ObjectService.GetRangeHash:output_type -> neo.fs.v2.object.GetRangeHashResponse - 17, // 94: neo.fs.v2.object.ObjectService.PutSingle:output_type -> neo.fs.v2.object.PutSingleResponse - 87, // [87:95] is the sub-list for method output_type - 79, // [79:87] is the sub-list for method input_type - 79, // [79:79] is the sub-list for extension type_name - 79, // [79:79] is the sub-list for extension extendee - 0, // [0:79] is the sub-list for field type_name + 45, // 53: neo.fs.v2.object.GetResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo + 46, // 54: neo.fs.v2.object.GetResponse.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID + 42, // 55: neo.fs.v2.object.GetResponse.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature + 41, // 56: neo.fs.v2.object.GetResponse.Body.Init.header:type_name -> neo.fs.v2.object.Header + 22, // 57: neo.fs.v2.object.PutRequest.Body.init:type_name -> neo.fs.v2.object.PutRequest.Body.Init + 46, // 58: neo.fs.v2.object.PutRequest.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID + 42, // 59: neo.fs.v2.object.PutRequest.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature + 41, // 60: neo.fs.v2.object.PutRequest.Body.Init.header:type_name -> neo.fs.v2.object.Header + 46, // 61: neo.fs.v2.object.PutResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID + 43, // 62: neo.fs.v2.object.DeleteRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 43, // 63: neo.fs.v2.object.DeleteResponse.Body.tombstone:type_name -> neo.fs.v2.refs.Address + 43, // 64: neo.fs.v2.object.HeadRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 7, // 65: neo.fs.v2.object.HeadResponse.Body.header:type_name -> neo.fs.v2.object.HeaderWithSignature + 47, // 66: neo.fs.v2.object.HeadResponse.Body.short_header:type_name -> neo.fs.v2.object.ShortHeader + 44, // 67: neo.fs.v2.object.HeadResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 45, // 68: neo.fs.v2.object.HeadResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo + 48, // 69: neo.fs.v2.object.SearchRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 29, // 70: neo.fs.v2.object.SearchRequest.Body.filters:type_name -> neo.fs.v2.object.SearchRequest.Body.Filter + 49, // 71: neo.fs.v2.object.SearchRequest.Body.Filter.match_type:type_name -> neo.fs.v2.object.MatchType + 46, // 72: neo.fs.v2.object.SearchResponse.Body.id_list:type_name -> neo.fs.v2.refs.ObjectID + 43, // 73: neo.fs.v2.object.GetRangeRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 11, // 74: neo.fs.v2.object.GetRangeRequest.Body.range:type_name -> neo.fs.v2.object.Range + 44, // 75: neo.fs.v2.object.GetRangeResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 45, // 76: neo.fs.v2.object.GetRangeResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo + 43, // 77: neo.fs.v2.object.GetRangeHashRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 11, // 78: neo.fs.v2.object.GetRangeHashRequest.Body.ranges:type_name -> neo.fs.v2.object.Range + 50, // 79: neo.fs.v2.object.GetRangeHashRequest.Body.type:type_name -> neo.fs.v2.refs.ChecksumType + 50, // 80: neo.fs.v2.object.GetRangeHashResponse.Body.type:type_name -> neo.fs.v2.refs.ChecksumType + 51, // 81: neo.fs.v2.object.PutSingleRequest.Body.object:type_name -> neo.fs.v2.object.Object + 0, // 82: neo.fs.v2.object.ObjectService.Get:input_type -> neo.fs.v2.object.GetRequest + 2, // 83: neo.fs.v2.object.ObjectService.Put:input_type -> neo.fs.v2.object.PutRequest + 4, // 84: neo.fs.v2.object.ObjectService.Delete:input_type -> neo.fs.v2.object.DeleteRequest + 6, // 85: neo.fs.v2.object.ObjectService.Head:input_type -> neo.fs.v2.object.HeadRequest + 9, // 86: neo.fs.v2.object.ObjectService.Search:input_type -> neo.fs.v2.object.SearchRequest + 12, // 87: neo.fs.v2.object.ObjectService.GetRange:input_type -> neo.fs.v2.object.GetRangeRequest + 14, // 88: neo.fs.v2.object.ObjectService.GetRangeHash:input_type -> neo.fs.v2.object.GetRangeHashRequest + 16, // 89: neo.fs.v2.object.ObjectService.PutSingle:input_type -> neo.fs.v2.object.PutSingleRequest + 1, // 90: neo.fs.v2.object.ObjectService.Get:output_type -> neo.fs.v2.object.GetResponse + 3, // 91: neo.fs.v2.object.ObjectService.Put:output_type -> neo.fs.v2.object.PutResponse + 5, // 92: neo.fs.v2.object.ObjectService.Delete:output_type -> neo.fs.v2.object.DeleteResponse + 8, // 93: neo.fs.v2.object.ObjectService.Head:output_type -> neo.fs.v2.object.HeadResponse + 10, // 94: neo.fs.v2.object.ObjectService.Search:output_type -> neo.fs.v2.object.SearchResponse + 13, // 95: neo.fs.v2.object.ObjectService.GetRange:output_type -> neo.fs.v2.object.GetRangeResponse + 15, // 96: neo.fs.v2.object.ObjectService.GetRangeHash:output_type -> neo.fs.v2.object.GetRangeHashResponse + 17, // 97: neo.fs.v2.object.ObjectService.PutSingle:output_type -> neo.fs.v2.object.PutSingleResponse + 90, // [90:98] is the sub-list for method output_type + 82, // [82:90] is the sub-list for method input_type + 82, // [82:82] is the sub-list for extension type_name + 82, // [82:82] is the sub-list for extension extendee + 0, // [0:82] is the sub-list for field type_name } func init() { file_object_grpc_service_proto_init() } @@ -3677,6 +3736,7 @@ func file_object_grpc_service_proto_init() { (*GetResponse_Body_Init_)(nil), (*GetResponse_Body_Chunk)(nil), (*GetResponse_Body_SplitInfo)(nil), + (*GetResponse_Body_EcInfo)(nil), } file_object_grpc_service_proto_msgTypes[21].OneofWrappers = []interface{}{ (*PutRequest_Body_Init_)(nil), @@ -3686,10 +3746,12 @@ func file_object_grpc_service_proto_init() { (*HeadResponse_Body_Header)(nil), (*HeadResponse_Body_ShortHeader)(nil), (*HeadResponse_Body_SplitInfo)(nil), + (*HeadResponse_Body_EcInfo)(nil), } file_object_grpc_service_proto_msgTypes[32].OneofWrappers = []interface{}{ (*GetRangeResponse_Body_Chunk)(nil), (*GetRangeResponse_Body_SplitInfo)(nil), + (*GetRangeResponse_Body_EcInfo)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 985b991..1edf647 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.23.4 +// - protoc v4.25.3 // source: object/grpc/service.proto package object diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index c6f2c7a..8f4f383 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: object/grpc/types.proto package object @@ -279,6 +279,8 @@ type Header struct { Attributes []*Header_Attribute `protobuf:"bytes,10,rep,name=attributes,proto3" json:"attributes,omitempty"` // Position of the object in the split hierarchy Split *Header_Split `protobuf:"bytes,11,opt,name=split,proto3" json:"split,omitempty"` + // Erasure code chunk information. + Ec *Header_EC `protobuf:"bytes,12,opt,name=ec,proto3" json:"ec,omitempty"` } func (x *Header) Reset() { @@ -390,6 +392,13 @@ func (x *Header) GetSplit() *Header_Split { return nil } +func (x *Header) GetEc() *Header_EC { + if x != nil { + return x.Ec + } + return nil +} + // Object structure. Object is immutable and content-addressed. It means // `ObjectID` will change if the header or the payload changes. It's calculated // as a hash of header field which contains hash of the object's payload. @@ -544,6 +553,55 @@ func (x *SplitInfo) GetLink() *grpc.ObjectID { return nil } +// Meta information for the erasure-encoded object. +type ECInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Chunk stored on the node. + Chunks []*ECInfo_Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"` +} + +func (x *ECInfo) Reset() { + *x = ECInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ECInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ECInfo) ProtoMessage() {} + +func (x *ECInfo) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_types_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ECInfo.ProtoReflect.Descriptor instead. +func (*ECInfo) Descriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{4} +} + +func (x *ECInfo) GetChunks() []*ECInfo_Chunk { + if x != nil { + return x.Chunks + } + return nil +} + // `Attribute` is a user-defined Key-Value metadata pair attached to an // object. // @@ -559,7 +617,8 @@ func (x *SplitInfo) GetLink() *grpc.ObjectID { // Marks smaller parts of a split bigger object // - [ __SYSTEM__EXPIRATION_EPOCH ] \ // (`__NEOFS__EXPIRATION_EPOCH` is deprecated) \ -// Tells GC to delete object after that epoch +// The epoch after which object with no LOCKs on it becomes unavailable. +// Locked object continues to be available until each of the LOCKs expire. // - [ __SYSTEM__TICK_EPOCH ] \ // (`__NEOFS__TICK_EPOCH` is deprecated) \ // Decimal number that defines what epoch must produce @@ -604,7 +663,7 @@ type Header_Attribute struct { func (x *Header_Attribute) Reset() { *x = Header_Attribute{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[4] + mi := &file_object_grpc_types_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -617,7 +676,7 @@ func (x *Header_Attribute) String() string { func (*Header_Attribute) ProtoMessage() {} func (x *Header_Attribute) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[4] + mi := &file_object_grpc_types_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -675,7 +734,7 @@ type Header_Split struct { func (x *Header_Split) Reset() { *x = Header_Split{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[5] + mi := &file_object_grpc_types_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -688,7 +747,7 @@ func (x *Header_Split) String() string { func (*Header_Split) ProtoMessage() {} func (x *Header_Split) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[5] + mi := &file_object_grpc_types_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -746,6 +805,159 @@ func (x *Header_Split) GetSplitId() []byte { return nil } +// Erasure code can be applied to any object. +// Information about encoded object structure is stored in `EC` header. +// All objects belonging to a single EC group have the same `parent` field. +type Header_EC struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the origin object. Known to all chunks. + Parent *grpc.ObjectID `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // Index of this chunk. + Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + // Total number of chunks in this split. + Total uint32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` + // Total length of a parent header. Used to trim padding zeroes. + HeaderLength uint32 `protobuf:"varint,4,opt,name=header_length,json=headerLength,proto3" json:"header_length,omitempty"` + // Chunk of a parent header. + Header []byte `protobuf:"bytes,5,opt,name=header,proto3" json:"header,omitempty"` +} + +func (x *Header_EC) Reset() { + *x = Header_EC{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Header_EC) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Header_EC) ProtoMessage() {} + +func (x *Header_EC) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_types_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Header_EC.ProtoReflect.Descriptor instead. +func (*Header_EC) Descriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{1, 2} +} + +func (x *Header_EC) GetParent() *grpc.ObjectID { + if x != nil { + return x.Parent + } + return nil +} + +func (x *Header_EC) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *Header_EC) GetTotal() uint32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *Header_EC) GetHeaderLength() uint32 { + if x != nil { + return x.HeaderLength + } + return 0 +} + +func (x *Header_EC) GetHeader() []byte { + if x != nil { + return x.Header + } + return nil +} + +type ECInfo_Chunk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Object ID of the chunk. + Id *grpc.ObjectID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Index of the chunk. + Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + // Total number of chunks in this split. + Total uint32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` +} + +func (x *ECInfo_Chunk) Reset() { + *x = ECInfo_Chunk{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ECInfo_Chunk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ECInfo_Chunk) ProtoMessage() {} + +func (x *ECInfo_Chunk) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_types_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ECInfo_Chunk.ProtoReflect.Descriptor instead. +func (*ECInfo_Chunk) Descriptor() ([]byte, []int) { + return file_object_grpc_types_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *ECInfo_Chunk) GetId() *grpc.ObjectID { + if x != nil { + return x.Id + } + return nil +} + +func (x *ECInfo_Chunk) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *ECInfo_Chunk) GetTotal() uint32 { + if x != nil { + return x.Total + } + return 0 +} + var File_object_grpc_types_proto protoreflect.FileDescriptor var file_object_grpc_types_proto_rawDesc = []byte{ @@ -779,7 +991,7 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x52, 0x0f, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x48, 0x61, - 0x73, 0x68, 0x22, 0xfb, 0x07, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, + 0x73, 0x68, 0x22, 0xca, 0x09, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 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, @@ -819,69 +1031,92 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x05, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x52, 0x05, 0x73, 0x70, - 0x6c, 0x69, 0x74, 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, 0x1a, 0xc5, 0x02, 0x0a, 0x05, 0x53, 0x70, 0x6c, - 0x69, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, - 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, - 0x52, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, + 0x6c, 0x69, 0x74, 0x12, 0x2b, 0x0a, 0x02, 0x65, 0x63, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x45, 0x43, 0x52, 0x02, 0x65, 0x63, + 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, 0x1a, 0xc5, 0x02, 0x0a, 0x05, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x12, + 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x70, + 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, + 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x3d, 0x0a, + 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x08, + 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x05, 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, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, + 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x1a, 0x9f, 0x01, + 0x0a, 0x02, 0x45, 0x43, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, + 0xc4, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, + 0x44, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, - 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x12, 0x3d, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x34, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x05, 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, 0x08, 0x63, 0x68, 0x69, - 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, - 0x22, 0xc4, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x49, 0x44, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, - 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x09, 0x53, 0x70, 0x6c, 0x69, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x64, - 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6c, - 0x61, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, - 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x2a, 0x32, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, - 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, 0x42, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, - 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, 0x2a, 0x73, 0x0a, 0x09, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, - 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, - 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, - 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, - 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, 0x61, - 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, - 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, - 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, - 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x09, 0x53, 0x70, 0x6c, 0x69, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x64, 0x12, + 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, + 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6c, 0x61, + 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x04, + 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x9f, 0x01, 0x0a, 0x06, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x36, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, + 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x1a, 0x5d, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, + 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2a, 0x32, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, + 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, 0x42, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, + 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, 0x2a, 0x73, 0x0a, 0x09, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, + 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, + 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, + 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, + 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, + 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, + 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, + 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, + 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -897,7 +1132,7 @@ func file_object_grpc_types_proto_rawDescGZIP() []byte { } var file_object_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_object_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_object_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_object_grpc_types_proto_goTypes = []interface{}{ (ObjectType)(0), // 0: neo.fs.v2.object.ObjectType (MatchType)(0), // 1: neo.fs.v2.object.MatchType @@ -905,46 +1140,53 @@ var file_object_grpc_types_proto_goTypes = []interface{}{ (*Header)(nil), // 3: neo.fs.v2.object.Header (*Object)(nil), // 4: neo.fs.v2.object.Object (*SplitInfo)(nil), // 5: neo.fs.v2.object.SplitInfo - (*Header_Attribute)(nil), // 6: neo.fs.v2.object.Header.Attribute - (*Header_Split)(nil), // 7: neo.fs.v2.object.Header.Split - (*grpc.Version)(nil), // 8: neo.fs.v2.refs.Version - (*grpc.OwnerID)(nil), // 9: neo.fs.v2.refs.OwnerID - (*grpc.Checksum)(nil), // 10: neo.fs.v2.refs.Checksum - (*grpc.ContainerID)(nil), // 11: neo.fs.v2.refs.ContainerID - (*grpc1.SessionToken)(nil), // 12: neo.fs.v2.session.SessionToken - (*grpc.ObjectID)(nil), // 13: neo.fs.v2.refs.ObjectID - (*grpc.Signature)(nil), // 14: neo.fs.v2.refs.Signature + (*ECInfo)(nil), // 6: neo.fs.v2.object.ECInfo + (*Header_Attribute)(nil), // 7: neo.fs.v2.object.Header.Attribute + (*Header_Split)(nil), // 8: neo.fs.v2.object.Header.Split + (*Header_EC)(nil), // 9: neo.fs.v2.object.Header.EC + (*ECInfo_Chunk)(nil), // 10: neo.fs.v2.object.ECInfo.Chunk + (*grpc.Version)(nil), // 11: neo.fs.v2.refs.Version + (*grpc.OwnerID)(nil), // 12: neo.fs.v2.refs.OwnerID + (*grpc.Checksum)(nil), // 13: neo.fs.v2.refs.Checksum + (*grpc.ContainerID)(nil), // 14: neo.fs.v2.refs.ContainerID + (*grpc1.SessionToken)(nil), // 15: neo.fs.v2.session.SessionToken + (*grpc.ObjectID)(nil), // 16: neo.fs.v2.refs.ObjectID + (*grpc.Signature)(nil), // 17: neo.fs.v2.refs.Signature } var file_object_grpc_types_proto_depIdxs = []int32{ - 8, // 0: neo.fs.v2.object.ShortHeader.version:type_name -> neo.fs.v2.refs.Version - 9, // 1: neo.fs.v2.object.ShortHeader.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 11, // 0: neo.fs.v2.object.ShortHeader.version:type_name -> neo.fs.v2.refs.Version + 12, // 1: neo.fs.v2.object.ShortHeader.owner_id:type_name -> neo.fs.v2.refs.OwnerID 0, // 2: neo.fs.v2.object.ShortHeader.object_type:type_name -> neo.fs.v2.object.ObjectType - 10, // 3: neo.fs.v2.object.ShortHeader.payload_hash:type_name -> neo.fs.v2.refs.Checksum - 10, // 4: neo.fs.v2.object.ShortHeader.homomorphic_hash:type_name -> neo.fs.v2.refs.Checksum - 8, // 5: neo.fs.v2.object.Header.version:type_name -> neo.fs.v2.refs.Version - 11, // 6: neo.fs.v2.object.Header.container_id:type_name -> neo.fs.v2.refs.ContainerID - 9, // 7: neo.fs.v2.object.Header.owner_id:type_name -> neo.fs.v2.refs.OwnerID - 10, // 8: neo.fs.v2.object.Header.payload_hash:type_name -> neo.fs.v2.refs.Checksum + 13, // 3: neo.fs.v2.object.ShortHeader.payload_hash:type_name -> neo.fs.v2.refs.Checksum + 13, // 4: neo.fs.v2.object.ShortHeader.homomorphic_hash:type_name -> neo.fs.v2.refs.Checksum + 11, // 5: neo.fs.v2.object.Header.version:type_name -> neo.fs.v2.refs.Version + 14, // 6: neo.fs.v2.object.Header.container_id:type_name -> neo.fs.v2.refs.ContainerID + 12, // 7: neo.fs.v2.object.Header.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 13, // 8: neo.fs.v2.object.Header.payload_hash:type_name -> neo.fs.v2.refs.Checksum 0, // 9: neo.fs.v2.object.Header.object_type:type_name -> neo.fs.v2.object.ObjectType - 10, // 10: neo.fs.v2.object.Header.homomorphic_hash:type_name -> neo.fs.v2.refs.Checksum - 12, // 11: neo.fs.v2.object.Header.session_token:type_name -> neo.fs.v2.session.SessionToken - 6, // 12: neo.fs.v2.object.Header.attributes:type_name -> neo.fs.v2.object.Header.Attribute - 7, // 13: neo.fs.v2.object.Header.split:type_name -> neo.fs.v2.object.Header.Split - 13, // 14: neo.fs.v2.object.Object.object_id:type_name -> neo.fs.v2.refs.ObjectID - 14, // 15: neo.fs.v2.object.Object.signature:type_name -> neo.fs.v2.refs.Signature - 3, // 16: neo.fs.v2.object.Object.header:type_name -> neo.fs.v2.object.Header - 13, // 17: neo.fs.v2.object.SplitInfo.last_part:type_name -> neo.fs.v2.refs.ObjectID - 13, // 18: neo.fs.v2.object.SplitInfo.link:type_name -> neo.fs.v2.refs.ObjectID - 13, // 19: neo.fs.v2.object.Header.Split.parent:type_name -> neo.fs.v2.refs.ObjectID - 13, // 20: neo.fs.v2.object.Header.Split.previous:type_name -> neo.fs.v2.refs.ObjectID - 14, // 21: neo.fs.v2.object.Header.Split.parent_signature:type_name -> neo.fs.v2.refs.Signature - 3, // 22: neo.fs.v2.object.Header.Split.parent_header:type_name -> neo.fs.v2.object.Header - 13, // 23: neo.fs.v2.object.Header.Split.children:type_name -> neo.fs.v2.refs.ObjectID - 24, // [24:24] is the sub-list for method output_type - 24, // [24:24] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + 13, // 10: neo.fs.v2.object.Header.homomorphic_hash:type_name -> neo.fs.v2.refs.Checksum + 15, // 11: neo.fs.v2.object.Header.session_token:type_name -> neo.fs.v2.session.SessionToken + 7, // 12: neo.fs.v2.object.Header.attributes:type_name -> neo.fs.v2.object.Header.Attribute + 8, // 13: neo.fs.v2.object.Header.split:type_name -> neo.fs.v2.object.Header.Split + 9, // 14: neo.fs.v2.object.Header.ec:type_name -> neo.fs.v2.object.Header.EC + 16, // 15: neo.fs.v2.object.Object.object_id:type_name -> neo.fs.v2.refs.ObjectID + 17, // 16: neo.fs.v2.object.Object.signature:type_name -> neo.fs.v2.refs.Signature + 3, // 17: neo.fs.v2.object.Object.header:type_name -> neo.fs.v2.object.Header + 16, // 18: neo.fs.v2.object.SplitInfo.last_part:type_name -> neo.fs.v2.refs.ObjectID + 16, // 19: neo.fs.v2.object.SplitInfo.link:type_name -> neo.fs.v2.refs.ObjectID + 10, // 20: neo.fs.v2.object.ECInfo.chunks:type_name -> neo.fs.v2.object.ECInfo.Chunk + 16, // 21: neo.fs.v2.object.Header.Split.parent:type_name -> neo.fs.v2.refs.ObjectID + 16, // 22: neo.fs.v2.object.Header.Split.previous:type_name -> neo.fs.v2.refs.ObjectID + 17, // 23: neo.fs.v2.object.Header.Split.parent_signature:type_name -> neo.fs.v2.refs.Signature + 3, // 24: neo.fs.v2.object.Header.Split.parent_header:type_name -> neo.fs.v2.object.Header + 16, // 25: neo.fs.v2.object.Header.Split.children:type_name -> neo.fs.v2.refs.ObjectID + 16, // 26: neo.fs.v2.object.Header.EC.parent:type_name -> neo.fs.v2.refs.ObjectID + 16, // 27: neo.fs.v2.object.ECInfo.Chunk.id:type_name -> neo.fs.v2.refs.ObjectID + 28, // [28:28] is the sub-list for method output_type + 28, // [28:28] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name } func init() { file_object_grpc_types_proto_init() } @@ -1002,7 +1244,7 @@ func file_object_grpc_types_proto_init() { } } file_object_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Header_Attribute); i { + switch v := v.(*ECInfo); i { case 0: return &v.state case 1: @@ -1014,6 +1256,18 @@ func file_object_grpc_types_proto_init() { } } file_object_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Header_Attribute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Header_Split); i { case 0: return &v.state @@ -1025,6 +1279,30 @@ func file_object_grpc_types_proto_init() { return nil } } + file_object_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Header_EC); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ECInfo_Chunk); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1032,7 +1310,7 @@ func file_object_grpc_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_object_grpc_types_proto_rawDesc, NumEnums: 2, - NumMessages: 6, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/object/marshal.go b/object/marshal.go index ddd5746..989dd43 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -26,6 +26,12 @@ const ( splitHdrChildrenField = 5 splitHdrSplitIDField = 6 + ecHdrParentField = 1 + ecHdrIndexField = 2 + ecHdrTotalField = 3 + ecHdrHeaderLengthField = 4 + ecHdrHeaderField = 5 + hdrVersionField = 1 hdrContainerIDField = 2 hdrOwnerIDField = 3 @@ -37,6 +43,7 @@ const ( hdrSessionTokenField = 9 hdrAttributesField = 10 hdrSplitField = 11 + hdrECField = 12 hdrWithSigHeaderField = 1 hdrWithSigSignatureField = 2 @@ -229,6 +236,43 @@ func (h *SplitHeader) Unmarshal(data []byte) error { return message.Unmarshal(h, data, new(object.Header_Split)) } +func (h *ECHeader) StableMarshal(buf []byte) []byte { + if h == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, h.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(ecHdrParentField, buf[offset:], h.Parent) + offset += proto.UInt32Marshal(ecHdrIndexField, buf[offset:], h.Index) + offset += proto.UInt32Marshal(ecHdrTotalField, buf[offset:], h.Total) + offset += proto.UInt32Marshal(ecHdrHeaderLengthField, buf[offset:], h.HeaderLength) + proto.BytesMarshal(ecHdrHeaderField, buf[offset:], h.Header) + return buf +} + +func (h *ECHeader) StableSize() (size int) { + if h == nil { + return 0 + } + + size += proto.NestedStructureSize(ecHdrParentField, h.Parent) + size += proto.UInt32Size(ecHdrIndexField, h.Index) + size += proto.UInt32Size(ecHdrTotalField, h.Total) + size += proto.UInt32Size(ecHdrHeaderLengthField, h.HeaderLength) + size += proto.BytesSize(ecHdrHeaderField, h.Header) + + return size +} + +func (h *ECHeader) Unmarshal(data []byte) error { + return message.Unmarshal(h, data, new(object.Header_EC)) +} + func (h *Header) StableMarshal(buf []byte) []byte { if h == nil { return []byte{} @@ -255,6 +299,7 @@ func (h *Header) StableMarshal(buf []byte) []byte { } proto.NestedStructureMarshal(hdrSplitField, buf[offset:], h.split) + proto.NestedStructureMarshal(hdrECField, buf[offset:], h.ec) return buf } @@ -277,6 +322,7 @@ func (h *Header) StableSize() (size int) { size += proto.NestedStructureSize(hdrAttributesField, &h.attr[i]) } size += proto.NestedStructureSize(hdrSplitField, h.split) + size += proto.NestedStructureSize(hdrECField, h.ec) return size } diff --git a/object/message_test.go b/object/message_test.go index a111c60..e675f49 100644 --- a/object/message_test.go +++ b/object/message_test.go @@ -16,6 +16,7 @@ func TestMessageConvert(t *testing.T) { func(empty bool) message.Message { return objecttest.GenerateHeader(empty) }, func(empty bool) message.Message { return objecttest.GenerateObject(empty) }, func(empty bool) message.Message { return objecttest.GenerateSplitInfo(empty) }, + func(empty bool) message.Message { return objecttest.GenerateECInfo(empty) }, func(empty bool) message.Message { return objecttest.GenerateGetRequestBody(empty) }, func(empty bool) message.Message { return objecttest.GenerateGetRequest(empty) }, func(empty bool) message.Message { return objecttest.GenerateGetObjectPartInit(empty) }, diff --git a/object/test/generate.go b/object/test/generate.go index 085880c..b107023 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -137,6 +137,31 @@ func GenerateSplitInfo(empty bool) *object.SplitInfo { return m } +func GenerateECInfo(empty bool) *object.ECInfo { + m := new(object.ECInfo) + + if !empty { + m.Chunks = make([]object.ECChunk, 2) + for i := range m.Chunks { + m.Chunks[i] = *GenerateECChunk(false) + } + } + + return m +} + +func GenerateECChunk(empty bool) *object.ECChunk { + m := new(object.ECChunk) + + if !empty { + m.ID = *refstest.GenerateObjectID(false) + m.Index = 4 + m.Total = 7 + } + + return m +} + func GenerateGetRequestBody(empty bool) *object.GetRequestBody { m := new(object.GetRequestBody) diff --git a/object/types.go b/object/types.go index f9e2ed6..3af08b6 100644 --- a/object/types.go +++ b/object/types.go @@ -39,6 +39,15 @@ type SplitHeader struct { splitID []byte } +type ECHeader struct { + Parent *refs.ObjectID + Index uint32 + Total uint32 + Header []byte + HeaderLength uint32 + Signature []byte +} + type Header struct { version *refs.Version @@ -59,6 +68,8 @@ type Header struct { attr []Attribute split *SplitHeader + + ec *ECHeader } type HeaderWithSignature struct { @@ -88,6 +99,16 @@ type SplitInfo struct { link *refs.ObjectID } +type ECChunk struct { + ID refs.ObjectID + Index uint32 + Total uint32 +} + +type ECInfo struct { + Chunks []ECChunk +} + type GetRequestBody struct { addr *refs.Address @@ -655,6 +676,17 @@ func (h *Header) SetSplit(v *SplitHeader) { h.split = v } +func (h *Header) GetEC() *ECHeader { + if h != nil { + return h.ec + } + return nil +} + +func (h *Header) SetEC(v *ECHeader) { + h.ec = v +} + func (h *HeaderWithSignature) GetHeader() *Header { if h != nil { return h.header diff --git a/refs/grpc/types.pb.go b/refs/grpc/types.pb.go index cfb51ea..681bb0d 100644 --- a/refs/grpc/types.pb.go +++ b/refs/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: refs/grpc/types.proto package refs @@ -20,7 +20,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Signature scheme describes digital signing scheme used for (key, signature) pair. +// Signature scheme describes digital signing scheme used for (key, signature) +// pair. type SignatureScheme int32 const ( @@ -193,8 +194,8 @@ func (x *Address) GetObjectId() *ObjectID { // // `ObjectID` is a 32 byte long // [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of -// the object's `header` field, which, in it's turn, contains the hash of the object's -// payload. +// the object's `header` field, which, in it's turn, contains the hash of the +// object's payload. // // String presentation is a // [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. @@ -381,7 +382,8 @@ func (x *OwnerID) GetValue() []byte { // API version used by a node. // // String presentation is a Semantic Versioning 2.0.0 compatible version string -// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor number. +// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor +// number. type Version struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/session/grpc/service.pb.go b/session/grpc/service.pb.go index c01bfa8..a6fa504 100644 --- a/session/grpc/service.pb.go +++ b/session/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: session/grpc/service.proto package session diff --git a/session/grpc/service_grpc.pb.go b/session/grpc/service_grpc.pb.go index a67c47a..bdcc3ba 100644 --- a/session/grpc/service_grpc.pb.go +++ b/session/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.23.4 +// - protoc v4.25.3 // source: session/grpc/service.proto package session diff --git a/session/grpc/types.pb.go b/session/grpc/types.pb.go index 23e46c7..e16a7c6 100644 --- a/session/grpc/types.pb.go +++ b/session/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: session/grpc/types.proto package session @@ -342,15 +342,15 @@ func (x *SessionToken) GetSignature() *grpc.Signature { return nil } -// Extended headers for Request/Response. They may contain any user-defined headers -// to be interpreted on application level. +// Extended headers for Request/Response. They may contain any user-defined +// headers to be interpreted on application level. // -// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests or -// Responses with duplicated header names or headers with empty values will be -// considered invalid. +// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests +// or Responses with duplicated header names or headers with empty values will +// be considered invalid. // -// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix that -// affect system behaviour: +// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` +// is deprecated) prefix that affect system behaviour: // // - [ __SYSTEM__NETMAP_EPOCH ] \ // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ @@ -361,8 +361,8 @@ func (x *SessionToken) GetSignature() *grpc.Signature { // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // If object can't be found using current epoch's netmap, this header limits // how many past epochs the node can look up through. The `value` is string -// encoded `uint64` in decimal presentation. If set to '0' or not set, only the -// current epoch will be used. +// encoded `uint64` in decimal presentation. If set to '0' or not set, only +// the current epoch will be used. type XHeader struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/status/grpc/types.pb.go b/status/grpc/types.pb.go index ddbaa6c..0972805 100644 --- a/status/grpc/types.pb.go +++ b/status/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: status/grpc/types.proto package status diff --git a/tombstone/grpc/types.pb.go b/tombstone/grpc/types.pb.go index 109a131..6a064dc 100644 --- a/tombstone/grpc/types.pb.go +++ b/tombstone/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: tombstone/grpc/types.proto package tombstone @@ -28,9 +28,10 @@ type Tombstone struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone - // creator depending on the current NeoFS network settings. A tombstone object - // must have the same expiration epoch value in `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) + // Last NeoFS epoch number of the tombstone lifetime. It's set by the + // tombstone creator depending on the current NeoFS network settings. A + // tombstone object must have the same expiration epoch value in + // `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) // attribute. Otherwise, the tombstone will be rejected by a storage node. ExpirationEpoch uint64 `protobuf:"varint,1,opt,name=expiration_epoch,json=expirationEpoch,proto3" json:"expiration_epoch,omitempty"` // 16 byte UUID used to identify the split object hierarchy parts. Must be diff --git a/util/proto/test/test.pb.go b/util/proto/test/test.pb.go index 2fa2d4e..0b9f43d 100644 --- a/util/proto/test/test.pb.go +++ b/util/proto/test/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: util/proto/test/test.proto package test From 6e9d385f3c72e4eeabd5b30cf89308a4cafd9425 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 26 Mar 2024 18:52:20 +0300 Subject: [PATCH 088/169] [#71] container: Introduce CONTAINER_ACCESS_DENIED status * Regenerate protobufs for object and container service to use a new frostfs-api status CONTAINER_ACCESS_DENIED. Signed-off-by: Airat Arifullin --- container/grpc/service_grpc.pb.go | 48 +++++++++++++++++++++++-------- object/grpc/service_grpc.pb.go | 32 +++++++++++++++++++++ status/grpc/types.pb.go | 33 ++++++++++++--------- 3 files changed, 87 insertions(+), 26 deletions(-) diff --git a/container/grpc/service_grpc.pb.go b/container/grpc/service_grpc.pb.go index 79b0533..6ae8ade 100644 --- a/container/grpc/service_grpc.pb.go +++ b/container/grpc/service_grpc.pb.go @@ -40,7 +40,9 @@ type ContainerServiceClient interface { // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container create access denied. Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -50,7 +52,9 @@ type ContainerServiceClient interface { // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container delete access denied. Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // @@ -59,14 +63,18 @@ type ContainerServiceClient interface { // container has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // requested container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied. Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container list access denied. List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL @@ -75,7 +83,9 @@ type ContainerServiceClient interface { // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // set container eACL access denied. SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. @@ -87,7 +97,9 @@ type ContainerServiceClient interface { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // container not found; // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // eACL table not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container eACL is denied. GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // @@ -181,7 +193,9 @@ type ContainerServiceServer interface { // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container create access denied. Put(context.Context, *PutRequest) (*PutResponse, error) // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is @@ -191,7 +205,9 @@ type ContainerServiceServer interface { // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container delete access denied. Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) // Returns container structure from `Container` smart contract storage. // @@ -200,14 +216,18 @@ type ContainerServiceServer interface { // container has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // requested container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied. Get(context.Context, *GetRequest) (*GetResponse, error) // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container list access denied. List(context.Context, *ListRequest) (*ListResponse, error) // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, changes in an Extended ACL @@ -216,7 +236,9 @@ type ContainerServiceServer interface { // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // set container eACL access denied. SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. @@ -228,7 +250,9 @@ type ContainerServiceServer interface { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // container not found; // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // eACL table not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container eACL is denied. GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) // Announces the space values used by the container for P2P synchronization. // diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 1edf647..16af44a 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -66,6 +66,8 @@ type ObjectServiceClient interface { // the requested object has been marked as deleted; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // 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) @@ -98,6 +100,8 @@ type ObjectServiceClient interface { // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ // (for trusted object preparation) session private key does not exist or // has @@ -130,6 +134,8 @@ type ObjectServiceClient interface { // deleting a locked object is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) @@ -157,6 +163,8 @@ type ObjectServiceClient interface { // the requested object has been marked as deleted; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) @@ -180,6 +188,8 @@ type ObjectServiceClient interface { // access to operation SEARCH of the object is denied; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // search container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // 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) @@ -214,6 +224,8 @@ type ObjectServiceClient interface { // the requested range is out of bounds; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // 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) @@ -246,6 +258,8 @@ type ObjectServiceClient interface { // the requested range is out of bounds; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. GetRangeHash(ctx context.Context, in *GetRangeHashRequest, opts ...grpc.CallOption) (*GetRangeHashResponse, error) @@ -275,6 +289,8 @@ type ObjectServiceClient interface { // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ // (for trusted object preparation) session private key does not exist or // has @@ -496,6 +512,8 @@ type ObjectServiceServer interface { // the requested object has been marked as deleted; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. Get(*GetRequest, ObjectService_GetServer) error @@ -528,6 +546,8 @@ type ObjectServiceServer interface { // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ // (for trusted object preparation) session private key does not exist or // has @@ -560,6 +580,8 @@ type ObjectServiceServer interface { // deleting a locked object is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) @@ -587,6 +609,8 @@ type ObjectServiceServer interface { // the requested object has been marked as deleted; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. Head(context.Context, *HeadRequest) (*HeadResponse, error) @@ -610,6 +634,8 @@ type ObjectServiceServer interface { // access to operation SEARCH of the object is denied; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // search container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. Search(*SearchRequest, ObjectService_SearchServer) error @@ -644,6 +670,8 @@ type ObjectServiceServer interface { // the requested range is out of bounds; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. GetRange(*GetRangeRequest, ObjectService_GetRangeServer) error @@ -676,6 +704,8 @@ type ObjectServiceServer interface { // the requested range is out of bounds; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. GetRangeHash(context.Context, *GetRangeHashRequest) (*GetRangeHashResponse, error) @@ -705,6 +735,8 @@ type ObjectServiceServer interface { // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ // (for trusted object preparation) session private key does not exist or // has diff --git a/status/grpc/types.pb.go b/status/grpc/types.pb.go index 0972805..9637294 100644 --- a/status/grpc/types.pb.go +++ b/status/grpc/types.pb.go @@ -265,6 +265,8 @@ const ( 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. @@ -272,10 +274,12 @@ 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_NOT_FOUND": 0, + "EACL_NOT_FOUND": 1, + "CONTAINER_ACCESS_DENIED": 2, } ) @@ -551,21 +555,22 @@ var file_status_grpc_types_proto_rawDesc = []byte{ 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, 0x38, 0x0a, 0x09, 0x43, 0x6f, + 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, 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, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, - 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, - 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, - 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 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, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, + 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, + 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, + 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 491a47e7fe2474554581c7fa1d19e943642a1c94 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 27 Mar 2024 12:56:03 +0300 Subject: [PATCH 089/169] [#70] netmap: Regenerate protobuf for Replica * Since EC field tags are renumerated, it is required to regenerate netmap grpc. * Add a generator with EC replica to check it with unit-test. Signed-off-by: Airat Arifullin --- netmap/grpc/types.pb.go | 8 ++++---- netmap/test/generate.go | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index 385713d..59f8612 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -402,9 +402,9 @@ type Replica struct { // Named selector bucket to put replicas Selector string `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` // Data shards count - EcDataCount uint32 `protobuf:"varint,6,opt,name=ec_data_count,json=ecDataCount,proto3" json:"ec_data_count,omitempty"` + EcDataCount uint32 `protobuf:"varint,3,opt,name=ec_data_count,json=ecDataCount,proto3" json:"ec_data_count,omitempty"` // Parity shards count - EcParityCount uint32 `protobuf:"varint,7,opt,name=ec_parity_count,json=ecParityCount,proto3" json:"ec_parity_count,omitempty"` + EcParityCount uint32 `protobuf:"varint,4,opt,name=ec_parity_count,json=ecParityCount,proto3" json:"ec_parity_count,omitempty"` } func (x *Replica) Reset() { @@ -1081,9 +1081,9 @@ var file_netmap_grpc_types_proto_rawDesc = []byte{ 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x63, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x43, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x69, 0x74, - 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x65, + 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x65, 0x63, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x86, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, diff --git a/netmap/test/generate.go b/netmap/test/generate.go index 260a024..2b713c5 100644 --- a/netmap/test/generate.go +++ b/netmap/test/generate.go @@ -81,6 +81,17 @@ func GenerateReplica(empty bool) *netmap.Replica { return m } +func GenerateEC(empty bool) *netmap.Replica { + m := new(netmap.Replica) + + if !empty { + m.SetECDataCount(4) + m.SetECParityCount(2) + } + + return m +} + func GenerateReplicas(empty bool) []netmap.Replica { var res []netmap.Replica @@ -88,6 +99,7 @@ func GenerateReplicas(empty bool) []netmap.Replica { res = append(res, *GenerateReplica(false), *GenerateReplica(false), + *GenerateEC(false), ) } From 4a330a5706124b63f4c9a76af49bd0d1b94c608c Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 20 Apr 2024 13:58:44 +0300 Subject: [PATCH 090/169] [#72] session: Unify unmarshaling code gopatch: ``` @@ var err, msg, data, t, protojson identifier var obj expression @@ +import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" -import protojson "google.golang.org/protobuf/encoding/protojson" -msg := obj -if err := protojson.Unmarshal(data, msg); err != nil { -return err -} -return t.FromGRPCMessage(msg) +return message.UnmarshalJSON(t, data, obj) @@ var err, msg, data, t, goproto identifier var obj expression @@ +import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" -import goproto "google.golang.org/protobuf/proto" -msg := obj -if err := goproto.Unmarshal(data, msg); err != nil { -return err -} -return t.FromGRPCMessage(msg) +return message.Unmarshal(t, data, obj) ``` Signed-off-by: Evgenii Stratonikov --- session/json.go | 57 +++++------------------------------------ session/marshal.go | 64 +++++++--------------------------------------- 2 files changed, 16 insertions(+), 105 deletions(-) diff --git a/session/json.go b/session/json.go index 77cbe10..e157fc3 100644 --- a/session/json.go +++ b/session/json.go @@ -3,7 +3,6 @@ package session import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" - "google.golang.org/protobuf/encoding/protojson" ) func (c *ObjectSessionContext) MarshalJSON() ([]byte, error) { @@ -27,13 +26,7 @@ func (t *TokenBody) MarshalJSON() ([]byte, error) { } func (t *TokenBody) UnmarshalJSON(data []byte) error { - msg := new(session.SessionToken_Body) - - if err := protojson.Unmarshal(data, msg); err != nil { - return err - } - - return t.FromGRPCMessage(msg) + return message.UnmarshalJSON(t, data, new(session.SessionToken_Body)) } func (t *Token) MarshalJSON() ([]byte, error) { @@ -41,13 +34,7 @@ func (t *Token) MarshalJSON() ([]byte, error) { } func (t *Token) UnmarshalJSON(data []byte) error { - msg := new(session.SessionToken) - - if err := protojson.Unmarshal(data, msg); err != nil { - return err - } - - return t.FromGRPCMessage(msg) + return message.UnmarshalJSON(t, data, new(session.SessionToken)) } func (x *XHeader) MarshalJSON() ([]byte, error) { @@ -55,13 +42,7 @@ func (x *XHeader) MarshalJSON() ([]byte, error) { } func (x *XHeader) UnmarshalJSON(data []byte) error { - msg := new(session.XHeader) - - if err := protojson.Unmarshal(data, msg); err != nil { - return err - } - - return x.FromGRPCMessage(msg) + return message.UnmarshalJSON(x, data, new(session.XHeader)) } func (r *RequestMetaHeader) MarshalJSON() ([]byte, error) { @@ -69,13 +50,7 @@ func (r *RequestMetaHeader) MarshalJSON() ([]byte, error) { } func (r *RequestMetaHeader) UnmarshalJSON(data []byte) error { - msg := new(session.RequestMetaHeader) - - if err := protojson.Unmarshal(data, msg); err != nil { - return err - } - - return r.FromGRPCMessage(msg) + return message.UnmarshalJSON(r, data, new(session.RequestMetaHeader)) } func (r *RequestVerificationHeader) MarshalJSON() ([]byte, error) { @@ -83,13 +58,7 @@ func (r *RequestVerificationHeader) MarshalJSON() ([]byte, error) { } func (r *RequestVerificationHeader) UnmarshalJSON(data []byte) error { - msg := new(session.RequestVerificationHeader) - - if err := protojson.Unmarshal(data, msg); err != nil { - return err - } - - return r.FromGRPCMessage(msg) + return message.UnmarshalJSON(r, data, new(session.RequestVerificationHeader)) } func (r *ResponseMetaHeader) MarshalJSON() ([]byte, error) { @@ -97,13 +66,7 @@ func (r *ResponseMetaHeader) MarshalJSON() ([]byte, error) { } func (r *ResponseMetaHeader) UnmarshalJSON(data []byte) error { - msg := new(session.ResponseMetaHeader) - - if err := protojson.Unmarshal(data, msg); err != nil { - return err - } - - return r.FromGRPCMessage(msg) + return message.UnmarshalJSON(r, data, new(session.ResponseMetaHeader)) } func (r *ResponseVerificationHeader) MarshalJSON() ([]byte, error) { @@ -111,13 +74,7 @@ func (r *ResponseVerificationHeader) MarshalJSON() ([]byte, error) { } func (r *ResponseVerificationHeader) UnmarshalJSON(data []byte) error { - msg := new(session.ResponseVerificationHeader) - - if err := protojson.Unmarshal(data, msg); err != nil { - return err - } - - return r.FromGRPCMessage(msg) + return message.UnmarshalJSON(r, data, new(session.ResponseVerificationHeader)) } func (x *ContainerSessionContext) MarshalJSON() ([]byte, error) { diff --git a/session/marshal.go b/session/marshal.go index 8632398..c9ca34b 100644 --- a/session/marshal.go +++ b/session/marshal.go @@ -4,7 +4,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" - goproto "google.golang.org/protobuf/proto" ) const ( @@ -154,12 +153,7 @@ func (x *XHeader) StableSize() (size int) { } func (x *XHeader) Unmarshal(data []byte) error { - m := new(session.XHeader) - if err := goproto.Unmarshal(data, m); err != nil { - return err - } - - return x.FromGRPCMessage(m) + return message.Unmarshal(x, data, new(session.XHeader)) } func (l *TokenLifetime) StableMarshal(buf []byte) []byte { @@ -193,12 +187,7 @@ func (l *TokenLifetime) StableSize() (size int) { } func (l *TokenLifetime) Unmarshal(data []byte) error { - m := new(session.SessionToken_Body_TokenLifetime) - if err := goproto.Unmarshal(data, m); err != nil { - return err - } - - return l.FromGRPCMessage(m) + return message.Unmarshal(l, data, new(session.SessionToken_Body_TokenLifetime)) } func (c *ObjectSessionContext) StableMarshal(buf []byte) []byte { @@ -234,12 +223,7 @@ func (c *ObjectSessionContext) StableSize() (size int) { } func (c *ObjectSessionContext) Unmarshal(data []byte) error { - m := new(session.ObjectSessionContext) - if err := goproto.Unmarshal(data, m); err != nil { - return err - } - - return c.FromGRPCMessage(m) + return message.Unmarshal(c, data, new(session.ObjectSessionContext)) } const ( @@ -338,12 +322,7 @@ func (t *TokenBody) StableSize() (size int) { } func (t *TokenBody) Unmarshal(data []byte) error { - m := new(session.SessionToken_Body) - if err := goproto.Unmarshal(data, m); err != nil { - return err - } - - return t.FromGRPCMessage(m) + return message.Unmarshal(t, data, new(session.SessionToken_Body)) } func (t *Token) StableMarshal(buf []byte) []byte { @@ -375,12 +354,7 @@ func (t *Token) StableSize() (size int) { } func (t *Token) Unmarshal(data []byte) error { - m := new(session.SessionToken) - if err := goproto.Unmarshal(data, m); err != nil { - return err - } - - return t.FromGRPCMessage(m) + return message.Unmarshal(t, data, new(session.SessionToken)) } func (r *RequestMetaHeader) StableMarshal(buf []byte) []byte { @@ -435,12 +409,7 @@ func (r *RequestMetaHeader) StableSize() (size int) { } func (r *RequestMetaHeader) Unmarshal(data []byte) error { - m := new(session.RequestMetaHeader) - if err := goproto.Unmarshal(data, m); err != nil { - return err - } - - return r.FromGRPCMessage(m) + return message.Unmarshal(r, data, new(session.RequestMetaHeader)) } func (r *RequestVerificationHeader) StableMarshal(buf []byte) []byte { @@ -476,12 +445,7 @@ func (r *RequestVerificationHeader) StableSize() (size int) { } func (r *RequestVerificationHeader) Unmarshal(data []byte) error { - m := new(session.RequestVerificationHeader) - if err := goproto.Unmarshal(data, m); err != nil { - return err - } - - return r.FromGRPCMessage(m) + return message.Unmarshal(r, data, new(session.RequestVerificationHeader)) } func (r *ResponseMetaHeader) StableMarshal(buf []byte) []byte { @@ -532,12 +496,7 @@ func (r *ResponseMetaHeader) StableSize() (size int) { } func (r *ResponseMetaHeader) Unmarshal(data []byte) error { - m := new(session.ResponseMetaHeader) - if err := goproto.Unmarshal(data, m); err != nil { - return err - } - - return r.FromGRPCMessage(m) + return message.Unmarshal(r, data, new(session.ResponseMetaHeader)) } func (r *ResponseVerificationHeader) StableMarshal(buf []byte) []byte { @@ -573,10 +532,5 @@ func (r *ResponseVerificationHeader) StableSize() (size int) { } func (r *ResponseVerificationHeader) Unmarshal(data []byte) error { - m := new(session.ResponseVerificationHeader) - if err := goproto.Unmarshal(data, m); err != nil { - return err - } - - return r.FromGRPCMessage(m) + return message.Unmarshal(r, data, new(session.ResponseVerificationHeader)) } From df9b65324a4cb49ef14d005942fedf6663999661 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 22 Apr 2024 13:25:29 +0300 Subject: [PATCH 091/169] [#73] object: Implement `Get\Head` requests for EC object Signed-off-by: Anton Nikiforov --- object/convert.go | 55 ++++++++++++++++++++++---- object/grpc/service.go | 14 +++++++ object/json.go | 16 ++++++++ object/marshal.go | 88 ++++++++++++++++++++++++++++++++++++++++++ object/types.go | 6 +++ 5 files changed, 171 insertions(+), 8 deletions(-) diff --git a/object/convert.go b/object/convert.go index 8d6c73f..3a680ac 100644 --- a/object/convert.go +++ b/object/convert.go @@ -662,11 +662,7 @@ func (s *ECInfo) ToGRPCMessage() grpc.Message { if s.Chunks != nil { chunks := make([]*object.ECInfo_Chunk, len(s.Chunks)) for i := range chunks { - chunks[i] = &object.ECInfo_Chunk{ - Id: s.Chunks[i].ID.ToGRPCMessage().(*refsGRPC.ObjectID), - Index: s.Chunks[i].Index, - Total: s.Chunks[i].Total, - } + chunks[i] = s.Chunks[i].ToGRPCMessage().(*object.ECInfo_Chunk) } m.Chunks = chunks } @@ -687,16 +683,43 @@ func (s *ECInfo) FromGRPCMessage(m grpc.Message) error { } else { s.Chunks = make([]ECChunk, len(chunks)) for i := range chunks { - if err := s.Chunks[i].ID.FromGRPCMessage(chunks[i].Id); err != nil { + if err := s.Chunks[i].FromGRPCMessage(chunks[i]); err != nil { return err } - s.Chunks[i].Index = chunks[i].Index - s.Chunks[i].Total = chunks[i].Total } } return nil } +func (c *ECChunk) ToGRPCMessage() grpc.Message { + var m *object.ECInfo_Chunk + + if c != nil { + m = new(object.ECInfo_Chunk) + + m.Total = c.Total + m.Index = c.Index + m.Id = c.ID.ToGRPCMessage().(*refsGRPC.ObjectID) + } + + return m +} + +func (c *ECChunk) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.ECInfo_Chunk) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + if err := c.ID.FromGRPCMessage(v.GetId()); err != nil { + return err + } + c.Index = v.Index + c.Total = v.Total + + return nil +} + func (r *GetRequestBody) ToGRPCMessage() grpc.Message { var m *object.GetRequest_Body @@ -877,6 +900,8 @@ func (r *GetResponseBody) ToGRPCMessage() grpc.Message { m.SetChunk(t.ToGRPCMessage().(*object.GetResponse_Body_Chunk)) case *SplitInfo: m.SetSplitInfo(t.ToGRPCMessage().(*object.SplitInfo)) + case *ECInfo: + m.SetECInfo(t.ToGRPCMessage().(*object.ECInfo)) default: panic(fmt.Sprintf("unknown get object part %T", t)) } @@ -915,6 +940,12 @@ func (r *GetResponseBody) FromGRPCMessage(m grpc.Message) error { r.objPart = partSplit err = partSplit.FromGRPCMessage(pt.SplitInfo) } + case *object.GetResponse_Body_EcInfo: + if pt != nil { + partEC := new(ECInfo) + r.objPart = partEC + err = partEC.FromGRPCMessage(pt.EcInfo) + } default: err = fmt.Errorf("unknown get object part %T", pt) } @@ -1454,6 +1485,8 @@ func (r *HeadResponseBody) ToGRPCMessage() grpc.Message { m.SetShortHeader(v.ToGRPCMessage().(*object.ShortHeader)) case *SplitInfo: m.SetSplitInfo(v.ToGRPCMessage().(*object.SplitInfo)) + case *ECInfo: + m.SetECInfo(v.ToGRPCMessage().(*object.ECInfo)) default: panic(fmt.Sprintf("unknown head part %T", v)) } @@ -1492,6 +1525,12 @@ func (r *HeadResponseBody) FromGRPCMessage(m grpc.Message) error { r.hdrPart = partSplit err = partSplit.FromGRPCMessage(pt.SplitInfo) } + case *object.HeadResponse_Body_EcInfo: + if pt != nil { + partEC := new(ECInfo) + r.hdrPart = partEC + err = partEC.FromGRPCMessage(pt.EcInfo) + } default: err = fmt.Errorf("unknown head part %T", pt) } diff --git a/object/grpc/service.go b/object/grpc/service.go index 27645dd..fa7cf45 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -78,6 +78,13 @@ func (m *GetResponse_Body) SetSplitInfo(v *SplitInfo) { } } +// SetECInfo sets part of the object payload. +func (m *GetResponse_Body) SetECInfo(v *ECInfo) { + m.ObjectPart = &GetResponse_Body_EcInfo{ + EcInfo: v, + } +} + // SetBody sets body of the response. func (m *GetResponse) SetBody(v *GetResponse_Body) { m.Body = v @@ -275,6 +282,13 @@ func (m *HeadResponse_Body) SetSplitInfo(v *SplitInfo) { } } +// SetECInfo sets meta info about the erasure coded object. +func (m *HeadResponse_Body) SetECInfo(v *ECInfo) { + m.Head = &HeadResponse_Body_EcInfo{ + EcInfo: v, + } +} + // SetBody sets body of the response. func (m *HeadResponse) SetBody(v *HeadResponse_Body) { m.Body = v diff --git a/object/json.go b/object/json.go index 1a04031..98030bb 100644 --- a/object/json.go +++ b/object/json.go @@ -61,6 +61,22 @@ func (s *SplitInfo) UnmarshalJSON(data []byte) error { return message.UnmarshalJSON(s, data, new(object.SplitInfo)) } +func (e *ECInfo) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(e) +} + +func (e *ECInfo) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(e, data, new(object.ECInfo)) +} + +func (e *ECChunk) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(e) +} + +func (e *ECChunk) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(e, data, new(object.ECInfo_Chunk)) +} + func (f *SearchFilter) MarshalJSON() ([]byte, error) { return message.MarshalJSON(f) } diff --git a/object/marshal.go b/object/marshal.go index 989dd43..c02ae83 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -57,6 +57,12 @@ const ( splitInfoLastPartField = 2 splitInfoLinkField = 3 + ecInfoChunksField = 1 + + ecChunkIDField = 1 + ecChunkIndexField = 2 + ecChunkTotalField = 3 + getReqBodyAddressField = 1 getReqBodyRawFlagField = 2 @@ -67,6 +73,7 @@ const ( getRespBodyInitField = 1 getRespBodyChunkField = 2 getRespBodySplitInfoField = 3 + getRespBodyECInfoField = 4 putReqInitObjectIDField = 1 putReqInitSignatureField = 2 @@ -89,6 +96,7 @@ const ( headRespBodyHeaderField = 1 headRespBodyShortHeaderField = 2 headRespBodySplitInfoField = 3 + headRespBodyECInfoField = 4 searchFilterMatchField = 1 searchFilterNameField = 2 @@ -451,6 +459,74 @@ func (s *SplitInfo) Unmarshal(data []byte) error { return message.Unmarshal(s, data, new(object.SplitInfo)) } +func (e *ECInfo) StableMarshal(buf []byte) []byte { + if e == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, e.StableSize()) + } + + var offset int + + for i := range e.Chunks { + offset += proto.NestedStructureMarshal(ecInfoChunksField, buf[offset:], &e.Chunks[i]) + } + + return buf +} + +func (e *ECInfo) StableSize() (size int) { + if e == nil { + return 0 + } + + for i := range e.Chunks { + size += proto.NestedStructureSize(ecInfoChunksField, &e.Chunks[i]) + } + + return size +} + +func (e *ECInfo) Unmarshal(data []byte) error { + return message.Unmarshal(e, data, new(object.ECInfo)) +} + +func (c *ECChunk) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(ecChunkIDField, buf[offset:], &c.ID) + offset += proto.UInt32Marshal(ecChunkIndexField, buf[offset:], c.Index) + proto.UInt32Marshal(ecChunkTotalField, buf[offset:], c.Total) + + return buf +} + +func (c *ECChunk) StableSize() (size int) { + if c == nil { + return 0 + } + + size += proto.NestedStructureSize(ecChunkIDField, &c.ID) + size += proto.UInt32Size(ecChunkIndexField, c.Index) + size += proto.UInt32Size(ecChunkTotalField, c.Total) + + return size +} + +func (c *ECChunk) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(object.ECInfo_Chunk)) +} + func (r *GetRequestBody) StableMarshal(buf []byte) []byte { if r == nil { return []byte{} @@ -536,6 +612,8 @@ func (r *GetResponseBody) StableMarshal(buf []byte) []byte { } case *SplitInfo: proto.NestedStructureMarshal(getRespBodySplitInfoField, buf, v) + case *ECInfo: + proto.NestedStructureMarshal(getRespBodyECInfoField, buf, v) default: panic("unknown one of object get response body type") } @@ -558,6 +636,8 @@ func (r *GetResponseBody) StableSize() (size int) { } case *SplitInfo: size += proto.NestedStructureSize(getRespBodySplitInfoField, v) + case *ECInfo: + size += proto.NestedStructureSize(getRespBodyECInfoField, v) default: panic("unknown one of object get response body type") } @@ -796,6 +876,10 @@ func (r *HeadResponseBody) StableMarshal(buf []byte) []byte { if v != nil { proto.NestedStructureMarshal(headRespBodySplitInfoField, buf, v) } + case *ECInfo: + if v != nil { + proto.NestedStructureMarshal(headRespBodyECInfoField, buf, v) + } default: panic("unknown one of object put request body type") } @@ -822,6 +906,10 @@ func (r *HeadResponseBody) StableSize() (size int) { if v != nil { size += proto.NestedStructureSize(headRespBodySplitInfoField, v) } + case *ECInfo: + if v != nil { + size += proto.NestedStructureSize(headRespBodyECInfoField, v) + } default: panic("unknown one of object put request body type") } diff --git a/object/types.go b/object/types.go index 3af08b6..4588f13 100644 --- a/object/types.go +++ b/object/types.go @@ -1508,3 +1508,9 @@ func (r *PutSingleResponse) GetBody() *PutSingleResponseBody { func (r *PutSingleResponse) SetBody(v *PutSingleResponseBody) { r.body = v } + +func (s *ECInfo) getObjectPart() {} + +func (s *ECInfo) getHeaderPart() {} + +func (s *ECInfo) getRangePart() {} From 67c6f305b21fbe68ed0815563514fd597f6d2ae7 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Sat, 27 Apr 2024 23:03:26 +0300 Subject: [PATCH 092/169] [#79] object: Implement `Range\RangeHash` requests for EC object Signed-off-by: Anton Nikiforov --- object/convert.go | 8 ++++++++ object/grpc/service.go | 7 +++++++ object/marshal.go | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/object/convert.go b/object/convert.go index 3a680ac..9b266ac 100644 --- a/object/convert.go +++ b/object/convert.go @@ -1962,6 +1962,8 @@ func (r *GetRangeResponseBody) ToGRPCMessage() grpc.Message { m.SetChunk(v.ToGRPCMessage().(*object.GetRangeResponse_Body_Chunk)) case *SplitInfo: m.SetSplitInfo(v.ToGRPCMessage().(*object.SplitInfo)) + case *ECInfo: + m.SetECInfo(v.ToGRPCMessage().(*object.ECInfo)) default: panic(fmt.Sprintf("unknown get range part %T", v)) } @@ -1994,6 +1996,12 @@ func (r *GetRangeResponseBody) FromGRPCMessage(m grpc.Message) error { r.rngPart = partSplit err = partSplit.FromGRPCMessage(pt.SplitInfo) } + case *object.GetRangeResponse_Body_EcInfo: + if pt != nil { + partEC := new(ECInfo) + r.rngPart = partEC + err = partEC.FromGRPCMessage(pt.EcInfo) + } default: err = fmt.Errorf("unknown get range part %T", pt) } diff --git a/object/grpc/service.go b/object/grpc/service.go index fa7cf45..49f160b 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -435,6 +435,13 @@ func (m *GetRangeResponse_Body) SetSplitInfo(v *SplitInfo) { } } +// SetECInfo sets meta info about the erasure-coded object. +func (m *GetRangeResponse_Body) SetECInfo(v *ECInfo) { + m.RangePart = &GetRangeResponse_Body_EcInfo{ + EcInfo: v, + } +} + // SetBody sets body of the response. func (m *GetRangeResponse) SetBody(v *GetRangeResponse_Body) { m.Body = v diff --git a/object/marshal.go b/object/marshal.go index c02ae83..a8d399c 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -117,6 +117,7 @@ const ( getRangeRespChunkField = 1 getRangeRespSplitInfoField = 2 + getRangeRespECInfoField = 3 getRangeHashReqBodyAddressField = 1 getRangeHashReqBodyRangesField = 2 @@ -1110,6 +1111,10 @@ func (r *GetRangeResponseBody) StableMarshal(buf []byte) []byte { if v != nil { proto.NestedStructureMarshal(getRangeRespSplitInfoField, buf, v) } + case *ECInfo: + if v != nil { + proto.NestedStructureMarshal(getRangeRespECInfoField, buf, v) + } default: panic("unknown one of object get range request body type") } @@ -1132,6 +1137,10 @@ func (r *GetRangeResponseBody) StableSize() (size int) { if v != nil { size = proto.NestedStructureSize(getRangeRespSplitInfoField, v) } + case *ECInfo: + if v != nil { + size = proto.NestedStructureSize(getRangeRespECInfoField, v) + } default: panic("unknown one of object get range request body type") } From 387b850e5ef667ca99e5d4f883f52442fc82514b Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 24 Apr 2024 16:00:37 +0300 Subject: [PATCH 093/169] [#74] apemanager: Generate protobufs for apemanager service * Generate protobufs. * Make marshallers, unmarshallers, json-encoders etc. * Create message encoding/decoding unit-tests. Signed-off-by: Airat Arifullin --- apemanager/convert.go | 481 ++++++++++++ apemanager/grpc/service.go | 105 +++ apemanager/grpc/service.pb.go | 1131 ++++++++++++++++++++++++++++ apemanager/grpc/service_grpc.pb.go | 245 ++++++ apemanager/grpc/types.go | 21 + apemanager/grpc/types.pb.go | 312 ++++++++ apemanager/json.go | 14 + apemanager/marshal.go | 288 +++++++ apemanager/message_test.go | 27 + apemanager/status.go | 76 ++ apemanager/status_test.go | 30 + apemanager/string.go | 18 + apemanager/test/generate.go | 208 +++++ apemanager/types.go | 244 ++++++ rpc/apemanager.go | 60 ++ signature/body.go | 15 + status/grpc/types.pb.go | 145 ++-- 17 files changed, 3375 insertions(+), 45 deletions(-) create mode 100644 apemanager/convert.go create mode 100644 apemanager/grpc/service.go create mode 100644 apemanager/grpc/service.pb.go create mode 100644 apemanager/grpc/service_grpc.pb.go create mode 100644 apemanager/grpc/types.go create mode 100644 apemanager/grpc/types.pb.go create mode 100644 apemanager/json.go create mode 100644 apemanager/marshal.go create mode 100644 apemanager/message_test.go create mode 100644 apemanager/status.go create mode 100644 apemanager/status_test.go create mode 100644 apemanager/string.go create mode 100644 apemanager/test/generate.go create mode 100644 apemanager/types.go create mode 100644 rpc/apemanager.go diff --git a/apemanager/convert.go b/apemanager/convert.go new file mode 100644 index 0000000..12b087c --- /dev/null +++ b/apemanager/convert.go @@ -0,0 +1,481 @@ +package apemanager + +import ( + "fmt" + + apemanager "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" +) + +func TargetTypeToGRPCField(typ TargetType) apemanager.TargetType { + switch typ { + case TargetTypeNamespace: + return apemanager.TargetType_NAMESPACE + case TargetTypeContainer: + return apemanager.TargetType_CONTAINER + case TargetTypeUser: + return apemanager.TargetType_USER + case TargetTypeGroup: + return apemanager.TargetType_GROUP + default: + return apemanager.TargetType_UNDEFINED + } +} + +func TargetTypeFromGRPCField(typ apemanager.TargetType) TargetType { + switch typ { + case apemanager.TargetType_NAMESPACE: + return TargetTypeNamespace + case apemanager.TargetType_CONTAINER: + return TargetTypeContainer + case apemanager.TargetType_USER: + return TargetTypeUser + case apemanager.TargetType_GROUP: + return TargetTypeGroup + default: + return TargetTypeUndefined + } +} + +func TargetTypeToGRPC(typ TargetType) apemanager.TargetType { + return apemanager.TargetType(typ) +} + +func TargetTypeFromGRPC(typ apemanager.TargetType) TargetType { + return TargetType(typ) +} + +func (v2 *ChainTarget) ToGRPCMessage() grpc.Message { + var mgrpc *apemanager.ChainTarget + + if v2 != nil { + mgrpc = new(apemanager.ChainTarget) + + mgrpc.SetType(TargetTypeToGRPC(v2.GetTargetType())) + mgrpc.SetName(v2.GetName()) + } + + return mgrpc +} + +func (v2 *ChainTarget) FromGRPCMessage(m grpc.Message) error { + mgrpc, ok := m.(*apemanager.ChainTarget) + if !ok { + return message.NewUnexpectedMessageType(m, mgrpc) + } + + v2.SetTargetType(TargetTypeFromGRPC(mgrpc.GetType())) + v2.SetName(mgrpc.GetName()) + + return nil +} + +func (v2 *ChainRaw) ToGRPCMessage() grpc.Message { + var mgrpc *apemanager.Chain_Raw + + if v2 != nil { + mgrpc = new(apemanager.Chain_Raw) + + mgrpc.SetRaw(v2.GetRaw()) + } + + return mgrpc +} + +func (v2 *ChainRaw) FromGRPCMessage(m grpc.Message) error { + mgrpc, ok := m.(*apemanager.Chain_Raw) + if !ok { + return message.NewUnexpectedMessageType(m, mgrpc) + } + + v2.SetRaw(mgrpc.GetRaw()) + + return nil +} + +func (v2 *Chain) ToGRPCMessage() grpc.Message { + var mgrpc *apemanager.Chain + + if v2 != nil { + mgrpc = new(apemanager.Chain) + + switch chainKind := v2.GetKind().(type) { + default: + panic(fmt.Sprintf("unsupported chain kind: %T", chainKind)) + case *ChainRaw: + mgrpc.SetKind(chainKind.ToGRPCMessage().(*apemanager.Chain_Raw)) + } + } + + return mgrpc +} + +func (v2 *Chain) FromGRPCMessage(m grpc.Message) error { + mgrpc, ok := m.(*apemanager.Chain) + if !ok { + return message.NewUnexpectedMessageType(m, mgrpc) + } + + switch chainKind := mgrpc.GetKind().(type) { + default: + return fmt.Errorf("unsupported chain kind: %T", chainKind) + case *apemanager.Chain_Raw: + chainRaw := new(ChainRaw) + if err := chainRaw.FromGRPCMessage(chainKind); err != nil { + return err + } + v2.SetKind(chainRaw) + } + + return nil +} + +func (reqBody *AddChainRequestBody) ToGRPCMessage() grpc.Message { + var reqBodygrpc *apemanager.AddChainRequest_Body + + if reqBody != nil { + reqBodygrpc = new(apemanager.AddChainRequest_Body) + + reqBodygrpc.SetTarget(reqBody.GetTarget().ToGRPCMessage().(*apemanager.ChainTarget)) + reqBodygrpc.SetChain(reqBody.GetChain().ToGRPCMessage().(*apemanager.Chain)) + } + + return reqBodygrpc +} + +func (reqBody *AddChainRequestBody) FromGRPCMessage(m grpc.Message) error { + reqBodygrpc, ok := m.(*apemanager.AddChainRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, reqBodygrpc) + } + + if targetgrpc := reqBodygrpc.GetTarget(); targetgrpc != nil { + reqBody.target = new(ChainTarget) + if err := reqBody.target.FromGRPCMessage(targetgrpc); err != nil { + return err + } + } + + if chaingrpc := reqBodygrpc.GetChain(); chaingrpc != nil { + reqBody.chain = new(Chain) + if err := reqBody.GetChain().FromGRPCMessage(chaingrpc); err != nil { + return err + } + } + + return nil +} + +func (req *AddChainRequest) ToGRPCMessage() grpc.Message { + var reqgrpc *apemanager.AddChainRequest + + if req != nil { + reqgrpc = new(apemanager.AddChainRequest) + + reqgrpc.SetBody(req.GetBody().ToGRPCMessage().(*apemanager.AddChainRequest_Body)) + req.RequestHeaders.ToMessage(reqgrpc) + } + + return reqgrpc +} + +func (req *AddChainRequest) FromGRPCMessage(m grpc.Message) error { + reqgrpc, ok := m.(*apemanager.AddChainRequest) + if !ok { + return message.NewUnexpectedMessageType(m, reqgrpc) + } + + if reqBodygrpc := reqgrpc.GetBody(); reqBodygrpc != nil { + req.body = new(AddChainRequestBody) + if err := req.body.FromGRPCMessage(reqBodygrpc); err != nil { + return err + } + } + + return req.RequestHeaders.FromMessage(reqgrpc) +} + +func (respBody *AddChainResponseBody) ToGRPCMessage() grpc.Message { + var respBodygrpc *apemanager.AddChainResponse_Body + + if respBody != nil { + respBodygrpc = new(apemanager.AddChainResponse_Body) + + respBodygrpc.SetChainID(respBody.GetChainID()) + } + + return respBodygrpc +} + +func (respBody *AddChainResponseBody) FromGRPCMessage(m grpc.Message) error { + respBodygrpc, ok := m.(*apemanager.AddChainResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, respBodygrpc) + } + + respBody.SetChainID(respBodygrpc.GetChainId()) + + return nil +} + +func (resp *AddChainResponse) ToGRPCMessage() grpc.Message { + var respgrpc *apemanager.AddChainResponse + + if resp != nil { + respgrpc = new(apemanager.AddChainResponse) + + respgrpc.SetBody(resp.body.ToGRPCMessage().(*apemanager.AddChainResponse_Body)) + resp.ResponseHeaders.ToMessage(respgrpc) + } + + return respgrpc +} + +func (resp *AddChainResponse) FromGRPCMessage(m grpc.Message) error { + respgrpc, ok := m.(*apemanager.AddChainResponse) + if !ok { + return message.NewUnexpectedMessageType(m, respgrpc) + } + + if respBodygrpc := respgrpc.GetBody(); respBodygrpc != nil { + resp.body = new(AddChainResponseBody) + if err := resp.body.FromGRPCMessage(respBodygrpc); err != nil { + return err + } + } + + return resp.ResponseHeaders.FromMessage(respgrpc) +} + +func (reqBody *RemoveChainRequestBody) ToGRPCMessage() grpc.Message { + var reqBodygrpc *apemanager.RemoveChainRequest_Body + + if reqBody != nil { + reqBodygrpc = new(apemanager.RemoveChainRequest_Body) + + reqBodygrpc.SetTarget(reqBody.target.ToGRPCMessage().(*apemanager.ChainTarget)) + reqBodygrpc.SetChainID(reqBody.GetChainID()) + } + + return reqBodygrpc +} + +func (reqBody *RemoveChainRequestBody) FromGRPCMessage(m grpc.Message) error { + reqBodygrpc, ok := m.(*apemanager.RemoveChainRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, reqBodygrpc) + } + + if targetgrpc := reqBodygrpc.GetTarget(); targetgrpc != nil { + reqBody.target = new(ChainTarget) + if err := reqBody.target.FromGRPCMessage(targetgrpc); err != nil { + return err + } + } + + reqBody.SetChainID(reqBodygrpc.GetChainId()) + + return nil +} + +func (req *RemoveChainRequest) ToGRPCMessage() grpc.Message { + var reqgrpc *apemanager.RemoveChainRequest + + if req != nil { + reqgrpc = new(apemanager.RemoveChainRequest) + + reqgrpc.SetBody(req.body.ToGRPCMessage().(*apemanager.RemoveChainRequest_Body)) + req.RequestHeaders.ToMessage(reqgrpc) + } + + return reqgrpc +} + +func (req *RemoveChainRequest) FromGRPCMessage(m grpc.Message) error { + reqgrpc, ok := m.(*apemanager.RemoveChainRequest) + if !ok { + return message.NewUnexpectedMessageType(m, reqgrpc) + } + + if reqBodygrpc := reqgrpc.GetBody(); reqBodygrpc != nil { + req.body = new(RemoveChainRequestBody) + if err := req.body.FromGRPCMessage(reqBodygrpc); err != nil { + return err + } + } + + return req.RequestHeaders.FromMessage(reqgrpc) +} + +func (respBody *RemoveChainResponseBody) ToGRPCMessage() grpc.Message { + var respBodygrpc *apemanager.RemoveChainResponse_Body + + if respBody != nil { + respBodygrpc = new(apemanager.RemoveChainResponse_Body) + } + + return respBodygrpc +} + +func (respBody *RemoveChainResponseBody) FromGRPCMessage(m grpc.Message) error { + respBodygrpc, ok := m.(*apemanager.RemoveChainResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, respBodygrpc) + } + + return nil +} + +func (resp *RemoveChainResponse) ToGRPCMessage() grpc.Message { + var respgrpc *apemanager.RemoveChainResponse + + if resp != nil { + respgrpc = new(apemanager.RemoveChainResponse) + + respgrpc.SetBody(resp.body.ToGRPCMessage().(*apemanager.RemoveChainResponse_Body)) + resp.ResponseHeaders.ToMessage(respgrpc) + } + + return respgrpc +} + +func (resp *RemoveChainResponse) FromGRPCMessage(m grpc.Message) error { + respgrpc, ok := m.(*apemanager.RemoveChainResponse) + if !ok { + return message.NewUnexpectedMessageType(m, respgrpc) + } + + if respBodygrpc := respgrpc.GetBody(); respBodygrpc != nil { + resp.body = new(RemoveChainResponseBody) + if err := resp.body.FromGRPCMessage(respBodygrpc); err != nil { + return err + } + } + + return resp.ResponseHeaders.FromMessage(respgrpc) +} + +func (reqBody *ListChainsRequestBody) ToGRPCMessage() grpc.Message { + var reqBodygrpc *apemanager.ListChainsRequest_Body + + if reqBody != nil { + reqBodygrpc = new(apemanager.ListChainsRequest_Body) + + reqBodygrpc.SetTarget(reqBody.target.ToGRPCMessage().(*apemanager.ChainTarget)) + } + + return reqBodygrpc +} + +func (reqBody *ListChainsRequestBody) FromGRPCMessage(m grpc.Message) error { + reqBodygrpc, ok := m.(*apemanager.ListChainsRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, reqBodygrpc) + } + + if targetgrpc := reqBodygrpc.GetTarget(); targetgrpc != nil { + reqBody.target = new(ChainTarget) + if err := reqBody.target.FromGRPCMessage(targetgrpc); err != nil { + return err + } + } + + return nil +} + +func (req *ListChainsRequest) ToGRPCMessage() grpc.Message { + var reqgrpc *apemanager.ListChainsRequest + + if req != nil { + reqgrpc = new(apemanager.ListChainsRequest) + + reqgrpc.SetBody(req.body.ToGRPCMessage().(*apemanager.ListChainsRequest_Body)) + req.RequestHeaders.ToMessage(reqgrpc) + } + + return reqgrpc +} + +func (req *ListChainsRequest) FromGRPCMessage(m grpc.Message) error { + reqgrpc, ok := m.(*apemanager.ListChainsRequest) + if !ok { + return message.NewUnexpectedMessageType(m, reqgrpc) + } + + if reqBodygrpc := reqgrpc.GetBody(); reqBodygrpc != nil { + req.body = new(ListChainsRequestBody) + if err := req.body.FromGRPCMessage(reqBodygrpc); err != nil { + return err + } + } + + return req.RequestHeaders.FromMessage(reqgrpc) +} + +func (respBody *ListChainsResponseBody) ToGRPCMessage() grpc.Message { + var respBodygrpc *apemanager.ListChainsResponse_Body + + if respBody != nil { + respBodygrpc = new(apemanager.ListChainsResponse_Body) + + chainsgrpc := make([]*apemanager.Chain, 0, len(respBody.GetChains())) + for _, chain := range respBody.GetChains() { + chainsgrpc = append(chainsgrpc, chain.ToGRPCMessage().(*apemanager.Chain)) + } + + respBodygrpc.SetChains(chainsgrpc) + } + + return respBodygrpc +} + +func (respBody *ListChainsResponseBody) FromGRPCMessage(m grpc.Message) error { + respBodygrpc, ok := m.(*apemanager.ListChainsResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, respBodygrpc) + } + + chains := make([]*Chain, 0, len(respBodygrpc.GetChains())) + + for _, chaingrpc := range respBodygrpc.GetChains() { + chain := new(Chain) + if err := chain.FromGRPCMessage(chaingrpc); err != nil { + return err + } + chains = append(chains, chain) + } + + respBody.SetChains(chains) + + return nil +} + +func (resp *ListChainsResponse) ToGRPCMessage() grpc.Message { + var respgrpc *apemanager.ListChainsResponse + + if resp != nil { + respgrpc = new(apemanager.ListChainsResponse) + + respgrpc.SetBody(resp.body.ToGRPCMessage().(*apemanager.ListChainsResponse_Body)) + resp.ResponseHeaders.ToMessage(respgrpc) + } + + return respgrpc +} + +func (resp *ListChainsResponse) FromGRPCMessage(m grpc.Message) error { + respgrpc, ok := m.(*apemanager.ListChainsResponse) + if !ok { + return message.NewUnexpectedMessageType(m, respgrpc) + } + + if respBodygrpc := respgrpc.GetBody(); respBodygrpc != nil { + resp.body = new(ListChainsResponseBody) + if err := resp.body.FromGRPCMessage(respBodygrpc); err != nil { + return err + } + } + + return resp.ResponseHeaders.FromMessage(respgrpc) +} diff --git a/apemanager/grpc/service.go b/apemanager/grpc/service.go new file mode 100644 index 0000000..89ffa71 --- /dev/null +++ b/apemanager/grpc/service.go @@ -0,0 +1,105 @@ +package apemanager + +import ( + session_grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" +) + +func (rb *AddChainRequest_Body) SetTarget(t *ChainTarget) { + rb.Target = t +} + +func (rb *AddChainRequest_Body) SetChain(chain *Chain) { + rb.Chain = chain +} + +func (r *AddChainRequest) SetBody(rb *AddChainRequest_Body) { + r.Body = rb +} + +func (r *AddChainRequest) SetMetaHeader(mh *session_grpc.RequestMetaHeader) { + r.MetaHeader = mh +} + +func (r *AddChainRequest) SetVerifyHeader(vh *session_grpc.RequestVerificationHeader) { + r.VerifyHeader = vh +} + +func (rb *AddChainResponse_Body) SetChainID(chainID []byte) { + rb.ChainId = chainID +} + +func (r *AddChainResponse) SetBody(rb *AddChainResponse_Body) { + r.Body = rb +} + +func (r *AddChainResponse) SetMetaHeader(mh *session_grpc.ResponseMetaHeader) { + r.MetaHeader = mh +} + +func (r *AddChainResponse) SetVerifyHeader(vh *session_grpc.ResponseVerificationHeader) { + r.VerifyHeader = vh +} + +func (rb *RemoveChainRequest_Body) SetTarget(t *ChainTarget) { + rb.Target = t +} + +func (rb *RemoveChainRequest_Body) SetChainID(chainID []byte) { + rb.ChainId = chainID +} + +func (r *RemoveChainRequest) SetBody(rb *RemoveChainRequest_Body) { + r.Body = rb +} + +func (r *RemoveChainRequest) SetMetaHeader(mh *session_grpc.RequestMetaHeader) { + r.MetaHeader = mh +} + +func (r *RemoveChainRequest) SetVerifyHeader(vh *session_grpc.RequestVerificationHeader) { + r.VerifyHeader = vh +} + +func (r *RemoveChainResponse) SetBody(rb *RemoveChainResponse_Body) { + r.Body = rb +} + +func (r *RemoveChainResponse) SetMetaHeader(mh *session_grpc.ResponseMetaHeader) { + r.MetaHeader = mh +} + +func (r *RemoveChainResponse) SetVerifyHeader(vh *session_grpc.ResponseVerificationHeader) { + r.VerifyHeader = vh +} + +func (r *ListChainsRequest_Body) SetTarget(t *ChainTarget) { + r.Target = t +} + +func (r *ListChainsRequest) SetBody(rb *ListChainsRequest_Body) { + r.Body = rb +} + +func (r *ListChainsRequest) SetMetaHeader(mh *session_grpc.RequestMetaHeader) { + r.MetaHeader = mh +} + +func (r *ListChainsRequest) SetVerifyHeader(vh *session_grpc.RequestVerificationHeader) { + r.VerifyHeader = vh +} + +func (rb *ListChainsResponse_Body) SetChains(chains []*Chain) { + rb.Chains = chains +} + +func (r *ListChainsResponse) SetBody(rb *ListChainsResponse_Body) { + r.Body = rb +} + +func (r *ListChainsResponse) SetMetaHeader(mh *session_grpc.ResponseMetaHeader) { + r.MetaHeader = mh +} + +func (r *ListChainsResponse) SetVerifyHeader(vh *session_grpc.ResponseVerificationHeader) { + r.VerifyHeader = vh +} diff --git a/apemanager/grpc/service.pb.go b/apemanager/grpc/service.pb.go new file mode 100644 index 0000000..157da44 --- /dev/null +++ b/apemanager/grpc/service.pb.go @@ -0,0 +1,1131 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: apemanager/grpc/service.proto + +package apemanager + +import ( + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AddChainRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The request's body. + Body *AddChainRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *AddChainRequest) Reset() { + *x = AddChainRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddChainRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddChainRequest) ProtoMessage() {} + +func (x *AddChainRequest) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddChainRequest.ProtoReflect.Descriptor instead. +func (*AddChainRequest) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{0} +} + +func (x *AddChainRequest) GetBody() *AddChainRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *AddChainRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *AddChainRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type AddChainResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The response's body. + Body *AddChainResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *AddChainResponse) Reset() { + *x = AddChainResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddChainResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddChainResponse) ProtoMessage() {} + +func (x *AddChainResponse) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddChainResponse.ProtoReflect.Descriptor instead. +func (*AddChainResponse) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{1} +} + +func (x *AddChainResponse) GetBody() *AddChainResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *AddChainResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *AddChainResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type RemoveChainRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The request's body. + Body *RemoveChainRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *RemoveChainRequest) Reset() { + *x = RemoveChainRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveChainRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveChainRequest) ProtoMessage() {} + +func (x *RemoveChainRequest) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveChainRequest.ProtoReflect.Descriptor instead. +func (*RemoveChainRequest) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{2} +} + +func (x *RemoveChainRequest) GetBody() *RemoveChainRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *RemoveChainRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *RemoveChainRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type RemoveChainResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The response's body. + Body *RemoveChainResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *RemoveChainResponse) Reset() { + *x = RemoveChainResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveChainResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveChainResponse) ProtoMessage() {} + +func (x *RemoveChainResponse) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveChainResponse.ProtoReflect.Descriptor instead. +func (*RemoveChainResponse) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{3} +} + +func (x *RemoveChainResponse) GetBody() *RemoveChainResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *RemoveChainResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *RemoveChainResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type ListChainsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The request's body. + Body *ListChainsRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *ListChainsRequest) Reset() { + *x = ListChainsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListChainsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListChainsRequest) ProtoMessage() {} + +func (x *ListChainsRequest) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListChainsRequest.ProtoReflect.Descriptor instead. +func (*ListChainsRequest) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{4} +} + +func (x *ListChainsRequest) GetBody() *ListChainsRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *ListChainsRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *ListChainsRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type ListChainsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The response's body. + Body *ListChainsResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *ListChainsResponse) Reset() { + *x = ListChainsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListChainsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListChainsResponse) ProtoMessage() {} + +func (x *ListChainsResponse) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListChainsResponse.ProtoReflect.Descriptor instead. +func (*ListChainsResponse) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{5} +} + +func (x *ListChainsResponse) GetBody() *ListChainsResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *ListChainsResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *ListChainsResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +type AddChainRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A target for which a rule chain is added. + Target *ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + // The chain to set for the target. + Chain *Chain `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"` +} + +func (x *AddChainRequest_Body) Reset() { + *x = AddChainRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddChainRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddChainRequest_Body) ProtoMessage() {} + +func (x *AddChainRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddChainRequest_Body.ProtoReflect.Descriptor instead. +func (*AddChainRequest_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *AddChainRequest_Body) GetTarget() *ChainTarget { + if x != nil { + return x.Target + } + return nil +} + +func (x *AddChainRequest_Body) GetChain() *Chain { + if x != nil { + return x.Chain + } + return nil +} + +type AddChainResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Chain ID assigned for the added rule chain. + // If chain ID is left empty in the request, then + // it will be generated. + ChainId []byte `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (x *AddChainResponse_Body) Reset() { + *x = AddChainResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddChainResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddChainResponse_Body) ProtoMessage() {} + +func (x *AddChainResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddChainResponse_Body.ProtoReflect.Descriptor instead. +func (*AddChainResponse_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *AddChainResponse_Body) GetChainId() []byte { + if x != nil { + return x.ChainId + } + return nil +} + +type RemoveChainRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Target for which a rule chain is removed. + Target *ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + // Chain ID assigned for the rule chain. + ChainId []byte `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (x *RemoveChainRequest_Body) Reset() { + *x = RemoveChainRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveChainRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveChainRequest_Body) ProtoMessage() {} + +func (x *RemoveChainRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveChainRequest_Body.ProtoReflect.Descriptor instead. +func (*RemoveChainRequest_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *RemoveChainRequest_Body) GetTarget() *ChainTarget { + if x != nil { + return x.Target + } + return nil +} + +func (x *RemoveChainRequest_Body) GetChainId() []byte { + if x != nil { + return x.ChainId + } + return nil +} + +// Since RemoveChain is an idempotent operation, then the only indicator that +// operation could not be performed is an error returning to a client. +type RemoveChainResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemoveChainResponse_Body) Reset() { + *x = RemoveChainResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveChainResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveChainResponse_Body) ProtoMessage() {} + +func (x *RemoveChainResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveChainResponse_Body.ProtoReflect.Descriptor instead. +func (*RemoveChainResponse_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{3, 0} +} + +type ListChainsRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Target for which rule chains are listed. + Target *ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` +} + +func (x *ListChainsRequest_Body) Reset() { + *x = ListChainsRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListChainsRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListChainsRequest_Body) ProtoMessage() {} + +func (x *ListChainsRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListChainsRequest_Body.ProtoReflect.Descriptor instead. +func (*ListChainsRequest_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *ListChainsRequest_Body) GetTarget() *ChainTarget { + if x != nil { + return x.Target + } + return nil +} + +type ListChainsResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of chains defined for the reqeusted target. + Chains []*Chain `protobuf:"bytes,1,rep,name=chains,proto3" json:"chains,omitempty"` +} + +func (x *ListChainsResponse_Body) Reset() { + *x = ListChainsResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_grpc_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListChainsResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListChainsResponse_Body) ProtoMessage() {} + +func (x *ListChainsResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_apemanager_grpc_service_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListChainsResponse_Body.ProtoReflect.Descriptor instead. +func (*ListChainsResponse_Body) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *ListChainsResponse_Body) GetChains() []*Chain { + if x != nil { + return x.Chains + } + return nil +} + +var File_apemanager_grpc_service_proto protoreflect.FileDescriptor + +var file_apemanager_grpc_service_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x15, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x1a, 0x1b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x02, + 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, + 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, 0x76, 0x0a, 0x04, + 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x12, 0x32, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x05, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x22, 0x93, 0x02, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, + 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 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, 0x21, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, + 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x22, 0xd1, 0x02, 0x0a, 0x12, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x42, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2e, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, + 0x61, 0x69, 0x6e, 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, + 0x5d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x22, 0xfe, + 0x01, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 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, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, + 0xb4, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 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, 0x42, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x72, 0x6f, + 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0xb2, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 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, 0x3c, 0x0a, + 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x52, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x32, 0xb9, 0x02, 0x0a, 0x11, + 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x5b, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, + 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, + 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x29, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x73, 0x12, 0x28, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, + 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x70, 0x65, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x70, 0x65, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_apemanager_grpc_service_proto_rawDescOnce sync.Once + file_apemanager_grpc_service_proto_rawDescData = file_apemanager_grpc_service_proto_rawDesc +) + +func file_apemanager_grpc_service_proto_rawDescGZIP() []byte { + file_apemanager_grpc_service_proto_rawDescOnce.Do(func() { + file_apemanager_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_apemanager_grpc_service_proto_rawDescData) + }) + return file_apemanager_grpc_service_proto_rawDescData +} + +var file_apemanager_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_apemanager_grpc_service_proto_goTypes = []interface{}{ + (*AddChainRequest)(nil), // 0: frostfs.v2.apemanager.AddChainRequest + (*AddChainResponse)(nil), // 1: frostfs.v2.apemanager.AddChainResponse + (*RemoveChainRequest)(nil), // 2: frostfs.v2.apemanager.RemoveChainRequest + (*RemoveChainResponse)(nil), // 3: frostfs.v2.apemanager.RemoveChainResponse + (*ListChainsRequest)(nil), // 4: frostfs.v2.apemanager.ListChainsRequest + (*ListChainsResponse)(nil), // 5: frostfs.v2.apemanager.ListChainsResponse + (*AddChainRequest_Body)(nil), // 6: frostfs.v2.apemanager.AddChainRequest.Body + (*AddChainResponse_Body)(nil), // 7: frostfs.v2.apemanager.AddChainResponse.Body + (*RemoveChainRequest_Body)(nil), // 8: frostfs.v2.apemanager.RemoveChainRequest.Body + (*RemoveChainResponse_Body)(nil), // 9: frostfs.v2.apemanager.RemoveChainResponse.Body + (*ListChainsRequest_Body)(nil), // 10: frostfs.v2.apemanager.ListChainsRequest.Body + (*ListChainsResponse_Body)(nil), // 11: frostfs.v2.apemanager.ListChainsResponse.Body + (*grpc.RequestMetaHeader)(nil), // 12: neo.fs.v2.session.RequestMetaHeader + (*grpc.RequestVerificationHeader)(nil), // 13: neo.fs.v2.session.RequestVerificationHeader + (*grpc.ResponseMetaHeader)(nil), // 14: neo.fs.v2.session.ResponseMetaHeader + (*grpc.ResponseVerificationHeader)(nil), // 15: neo.fs.v2.session.ResponseVerificationHeader + (*ChainTarget)(nil), // 16: frostfs.v2.apemanager.ChainTarget + (*Chain)(nil), // 17: frostfs.v2.apemanager.Chain +} +var file_apemanager_grpc_service_proto_depIdxs = []int32{ + 6, // 0: frostfs.v2.apemanager.AddChainRequest.body:type_name -> frostfs.v2.apemanager.AddChainRequest.Body + 12, // 1: frostfs.v2.apemanager.AddChainRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 13, // 2: frostfs.v2.apemanager.AddChainRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 7, // 3: frostfs.v2.apemanager.AddChainResponse.body:type_name -> frostfs.v2.apemanager.AddChainResponse.Body + 14, // 4: frostfs.v2.apemanager.AddChainResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 15, // 5: frostfs.v2.apemanager.AddChainResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 8, // 6: frostfs.v2.apemanager.RemoveChainRequest.body:type_name -> frostfs.v2.apemanager.RemoveChainRequest.Body + 12, // 7: frostfs.v2.apemanager.RemoveChainRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 13, // 8: frostfs.v2.apemanager.RemoveChainRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 9, // 9: frostfs.v2.apemanager.RemoveChainResponse.body:type_name -> frostfs.v2.apemanager.RemoveChainResponse.Body + 14, // 10: frostfs.v2.apemanager.RemoveChainResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 15, // 11: frostfs.v2.apemanager.RemoveChainResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 10, // 12: frostfs.v2.apemanager.ListChainsRequest.body:type_name -> frostfs.v2.apemanager.ListChainsRequest.Body + 12, // 13: frostfs.v2.apemanager.ListChainsRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 13, // 14: frostfs.v2.apemanager.ListChainsRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 11, // 15: frostfs.v2.apemanager.ListChainsResponse.body:type_name -> frostfs.v2.apemanager.ListChainsResponse.Body + 14, // 16: frostfs.v2.apemanager.ListChainsResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 15, // 17: frostfs.v2.apemanager.ListChainsResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 16, // 18: frostfs.v2.apemanager.AddChainRequest.Body.target:type_name -> frostfs.v2.apemanager.ChainTarget + 17, // 19: frostfs.v2.apemanager.AddChainRequest.Body.chain:type_name -> frostfs.v2.apemanager.Chain + 16, // 20: frostfs.v2.apemanager.RemoveChainRequest.Body.target:type_name -> frostfs.v2.apemanager.ChainTarget + 16, // 21: frostfs.v2.apemanager.ListChainsRequest.Body.target:type_name -> frostfs.v2.apemanager.ChainTarget + 17, // 22: frostfs.v2.apemanager.ListChainsResponse.Body.chains:type_name -> frostfs.v2.apemanager.Chain + 0, // 23: frostfs.v2.apemanager.APEManagerService.AddChain:input_type -> frostfs.v2.apemanager.AddChainRequest + 2, // 24: frostfs.v2.apemanager.APEManagerService.RemoveChain:input_type -> frostfs.v2.apemanager.RemoveChainRequest + 4, // 25: frostfs.v2.apemanager.APEManagerService.ListChains:input_type -> frostfs.v2.apemanager.ListChainsRequest + 1, // 26: frostfs.v2.apemanager.APEManagerService.AddChain:output_type -> frostfs.v2.apemanager.AddChainResponse + 3, // 27: frostfs.v2.apemanager.APEManagerService.RemoveChain:output_type -> frostfs.v2.apemanager.RemoveChainResponse + 5, // 28: frostfs.v2.apemanager.APEManagerService.ListChains:output_type -> frostfs.v2.apemanager.ListChainsResponse + 26, // [26:29] is the sub-list for method output_type + 23, // [23:26] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name +} + +func init() { file_apemanager_grpc_service_proto_init() } +func file_apemanager_grpc_service_proto_init() { + if File_apemanager_grpc_service_proto != nil { + return + } + file_apemanager_grpc_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_apemanager_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddChainRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddChainResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveChainRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveChainResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListChainsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListChainsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddChainRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddChainResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveChainRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveChainResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListChainsRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListChainsResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_apemanager_grpc_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_apemanager_grpc_service_proto_goTypes, + DependencyIndexes: file_apemanager_grpc_service_proto_depIdxs, + MessageInfos: file_apemanager_grpc_service_proto_msgTypes, + }.Build() + File_apemanager_grpc_service_proto = out.File + file_apemanager_grpc_service_proto_rawDesc = nil + file_apemanager_grpc_service_proto_goTypes = nil + file_apemanager_grpc_service_proto_depIdxs = nil +} diff --git a/apemanager/grpc/service_grpc.pb.go b/apemanager/grpc/service_grpc.pb.go new file mode 100644 index 0000000..484fec5 --- /dev/null +++ b/apemanager/grpc/service_grpc.pb.go @@ -0,0 +1,245 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: apemanager/grpc/service.proto + +package apemanager + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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 + +const ( + APEManagerService_AddChain_FullMethodName = "/frostfs.v2.apemanager.APEManagerService/AddChain" + APEManagerService_RemoveChain_FullMethodName = "/frostfs.v2.apemanager.APEManagerService/RemoveChain" + APEManagerService_ListChains_FullMethodName = "/frostfs.v2.apemanager.APEManagerService/ListChains" +) + +// 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. +type APEManagerServiceClient interface { + // Add a rule chain for a specific target to `Policy` smart contract. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the chain has been successfully added; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + AddChain(ctx context.Context, in *AddChainRequest, opts ...grpc.CallOption) (*AddChainResponse, error) + // Remove a rule chain for a specific target from `Policy` smart contract. + // RemoveChain is an idempotent operation: removal of non-existing rule chain + // also means success. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the chain has been successfully removed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + RemoveChain(ctx context.Context, in *RemoveChainRequest, opts ...grpc.CallOption) (*RemoveChainResponse, error) + // List chains defined for a specific target from `Policy` smart contract. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // chains have been successfully listed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + ListChains(ctx context.Context, in *ListChainsRequest, opts ...grpc.CallOption) (*ListChainsResponse, error) +} + +type aPEManagerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAPEManagerServiceClient(cc grpc.ClientConnInterface) APEManagerServiceClient { + return &aPEManagerServiceClient{cc} +} + +func (c *aPEManagerServiceClient) AddChain(ctx context.Context, in *AddChainRequest, opts ...grpc.CallOption) (*AddChainResponse, error) { + out := new(AddChainResponse) + err := c.cc.Invoke(ctx, APEManagerService_AddChain_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPEManagerServiceClient) RemoveChain(ctx context.Context, in *RemoveChainRequest, opts ...grpc.CallOption) (*RemoveChainResponse, error) { + out := new(RemoveChainResponse) + err := c.cc.Invoke(ctx, APEManagerService_RemoveChain_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPEManagerServiceClient) ListChains(ctx context.Context, in *ListChainsRequest, opts ...grpc.CallOption) (*ListChainsResponse, error) { + out := new(ListChainsResponse) + err := c.cc.Invoke(ctx, APEManagerService_ListChains_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// APEManagerServiceServer is the server API for APEManagerService service. +// All implementations should embed UnimplementedAPEManagerServiceServer +// for forward compatibility +type APEManagerServiceServer interface { + // Add a rule chain for a specific target to `Policy` smart contract. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the chain has been successfully added; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + AddChain(context.Context, *AddChainRequest) (*AddChainResponse, error) + // Remove a rule chain for a specific target from `Policy` smart contract. + // RemoveChain is an idempotent operation: removal of non-existing rule chain + // also means success. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the chain has been successfully removed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + RemoveChain(context.Context, *RemoveChainRequest) (*RemoveChainResponse, error) + // List chains defined for a specific target from `Policy` smart contract. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // chains have been successfully listed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + ListChains(context.Context, *ListChainsRequest) (*ListChainsResponse, error) +} + +// UnimplementedAPEManagerServiceServer should be embedded to have forward compatible implementations. +type UnimplementedAPEManagerServiceServer struct { +} + +func (UnimplementedAPEManagerServiceServer) AddChain(context.Context, *AddChainRequest) (*AddChainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddChain not implemented") +} +func (UnimplementedAPEManagerServiceServer) RemoveChain(context.Context, *RemoveChainRequest) (*RemoveChainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveChain not implemented") +} +func (UnimplementedAPEManagerServiceServer) ListChains(context.Context, *ListChainsRequest) (*ListChainsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListChains not implemented") +} + +// 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 +// result in compilation errors. +type UnsafeAPEManagerServiceServer interface { + mustEmbedUnimplementedAPEManagerServiceServer() +} + +func RegisterAPEManagerServiceServer(s grpc.ServiceRegistrar, srv APEManagerServiceServer) { + s.RegisterService(&APEManagerService_ServiceDesc, srv) +} + +func _APEManagerService_AddChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddChainRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APEManagerServiceServer).AddChain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: APEManagerService_AddChain_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APEManagerServiceServer).AddChain(ctx, req.(*AddChainRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APEManagerService_RemoveChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveChainRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APEManagerServiceServer).RemoveChain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: APEManagerService_RemoveChain_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APEManagerServiceServer).RemoveChain(ctx, req.(*RemoveChainRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APEManagerService_ListChains_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListChainsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APEManagerServiceServer).ListChains(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: APEManagerService_ListChains_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APEManagerServiceServer).ListChains(ctx, req.(*ListChainsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// APEManagerService_ServiceDesc is the grpc.ServiceDesc for APEManagerService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var APEManagerService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "frostfs.v2.apemanager.APEManagerService", + HandlerType: (*APEManagerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddChain", + Handler: _APEManagerService_AddChain_Handler, + }, + { + MethodName: "RemoveChain", + Handler: _APEManagerService_RemoveChain_Handler, + }, + { + MethodName: "ListChains", + Handler: _APEManagerService_ListChains_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "apemanager/grpc/service.proto", +} diff --git a/apemanager/grpc/types.go b/apemanager/grpc/types.go new file mode 100644 index 0000000..0f2ebb2 --- /dev/null +++ b/apemanager/grpc/types.go @@ -0,0 +1,21 @@ +package apemanager + +func (t *ChainTarget) SetType(typ TargetType) { + t.Type = typ +} + +func (t *ChainTarget) SetName(name string) { + t.Name = name +} + +func (c *Chain) SetKind(kind isChain_Kind) { + c.Kind = kind +} + +func (cr *Chain_Raw) SetRaw(raw []byte) { + cr.Raw = raw +} + +func (cr *Chain_Raw) GetRaw() []byte { + return cr.Raw +} diff --git a/apemanager/grpc/types.pb.go b/apemanager/grpc/types.pb.go new file mode 100644 index 0000000..395857a --- /dev/null +++ b/apemanager/grpc/types.pb.go @@ -0,0 +1,312 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: apemanager/grpc/types.proto + +package apemanager + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// TargetType is a type target to which a rule chain is defined. +type TargetType int32 + +const ( + TargetType_UNDEFINED TargetType = 0 + TargetType_NAMESPACE TargetType = 1 + TargetType_CONTAINER TargetType = 2 + TargetType_USER TargetType = 3 + TargetType_GROUP TargetType = 4 +) + +// Enum value maps for TargetType. +var ( + TargetType_name = map[int32]string{ + 0: "UNDEFINED", + 1: "NAMESPACE", + 2: "CONTAINER", + 3: "USER", + 4: "GROUP", + } + TargetType_value = map[string]int32{ + "UNDEFINED": 0, + "NAMESPACE": 1, + "CONTAINER": 2, + "USER": 3, + "GROUP": 4, + } +) + +func (x TargetType) Enum() *TargetType { + p := new(TargetType) + *p = x + return p +} + +func (x TargetType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TargetType) Descriptor() protoreflect.EnumDescriptor { + return file_apemanager_grpc_types_proto_enumTypes[0].Descriptor() +} + +func (TargetType) Type() protoreflect.EnumType { + return &file_apemanager_grpc_types_proto_enumTypes[0] +} + +func (x TargetType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TargetType.Descriptor instead. +func (TargetType) EnumDescriptor() ([]byte, []int) { + return file_apemanager_grpc_types_proto_rawDescGZIP(), []int{0} +} + +// ChainTarget is an object to which a rule chain is defined. +type ChainTarget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type TargetType `protobuf:"varint,1,opt,name=type,proto3,enum=frostfs.v2.apemanager.TargetType" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *ChainTarget) Reset() { + *x = ChainTarget{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_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_apemanager_grpc_types_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChainTarget.ProtoReflect.Descriptor instead. +func (*ChainTarget) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_types_proto_rawDescGZIP(), []int{0} +} + +func (x *ChainTarget) GetType() TargetType { + if x != nil { + return x.Type + } + return TargetType_UNDEFINED +} + +func (x *ChainTarget) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Chain is a chain of rules defined for a specific target. +type Chain struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Kind: + // + // *Chain_Raw + Kind isChain_Kind `protobuf_oneof:"kind"` +} + +func (x *Chain) Reset() { + *x = Chain{} + if protoimpl.UnsafeEnabled { + mi := &file_apemanager_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_apemanager_grpc_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Chain.ProtoReflect.Descriptor instead. +func (*Chain) Descriptor() ([]byte, []int) { + return file_apemanager_grpc_types_proto_rawDescGZIP(), []int{1} +} + +func (m *Chain) GetKind() isChain_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *Chain) GetRaw() []byte { + if x, ok := x.GetKind().(*Chain_Raw); ok { + return x.Raw + } + return nil +} + +type isChain_Kind interface { + isChain_Kind() +} + +type Chain_Raw struct { + // Raw representation of a serizalized rule chain. + Raw []byte `protobuf:"bytes,1,opt,name=raw,proto3,oneof"` +} + +func (*Chain_Raw) isChain_Kind() {} + +var File_apemanager_grpc_types_proto protoreflect.FileDescriptor + +var file_apemanager_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x22, 0x58, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x21, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, + 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 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, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, + 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_apemanager_grpc_types_proto_rawDescOnce sync.Once + file_apemanager_grpc_types_proto_rawDescData = file_apemanager_grpc_types_proto_rawDesc +) + +func file_apemanager_grpc_types_proto_rawDescGZIP() []byte { + file_apemanager_grpc_types_proto_rawDescOnce.Do(func() { + file_apemanager_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_apemanager_grpc_types_proto_rawDescData) + }) + return file_apemanager_grpc_types_proto_rawDescData +} + +var file_apemanager_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_apemanager_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_apemanager_grpc_types_proto_goTypes = []interface{}{ + (TargetType)(0), // 0: frostfs.v2.apemanager.TargetType + (*ChainTarget)(nil), // 1: frostfs.v2.apemanager.ChainTarget + (*Chain)(nil), // 2: frostfs.v2.apemanager.Chain +} +var file_apemanager_grpc_types_proto_depIdxs = []int32{ + 0, // 0: frostfs.v2.apemanager.ChainTarget.type:type_name -> frostfs.v2.apemanager.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_apemanager_grpc_types_proto_init() } +func file_apemanager_grpc_types_proto_init() { + if File_apemanager_grpc_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_apemanager_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChainTarget); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_apemanager_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Chain); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_apemanager_grpc_types_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*Chain_Raw)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_apemanager_grpc_types_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_apemanager_grpc_types_proto_goTypes, + DependencyIndexes: file_apemanager_grpc_types_proto_depIdxs, + EnumInfos: file_apemanager_grpc_types_proto_enumTypes, + MessageInfos: file_apemanager_grpc_types_proto_msgTypes, + }.Build() + File_apemanager_grpc_types_proto = out.File + file_apemanager_grpc_types_proto_rawDesc = nil + file_apemanager_grpc_types_proto_goTypes = nil + file_apemanager_grpc_types_proto_depIdxs = nil +} diff --git a/apemanager/json.go b/apemanager/json.go new file mode 100644 index 0000000..4f44d5e --- /dev/null +++ b/apemanager/json.go @@ -0,0 +1,14 @@ +package apemanager + +import ( + apemanager_grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" +) + +func (t *ChainTarget) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(t) +} + +func (t *ChainTarget) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(t, data, new(apemanager_grpc.ChainTarget)) +} diff --git a/apemanager/marshal.go b/apemanager/marshal.go new file mode 100644 index 0000000..22e092e --- /dev/null +++ b/apemanager/marshal.go @@ -0,0 +1,288 @@ +package apemanager + +import ( + "fmt" + + apemanager "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" +) + +const ( + chainTargetTargetTypeField = 1 + chainTargetNameField = 2 + + chainRawField = 1 + + addChainReqBodyTargetField = 1 + addChainReqBodyChainField = 2 + + addChainRespBodyChainIDField = 1 + + removeChainReqBodyTargetField = 1 + removeChainReqBodyChainField = 2 + + /* + Fields for RemoveResponseBody are missed since RemoveResponseBody is empty. + */ + + listChainsReqBodyTargetField = 1 + + listChainsRespBodyChainsField = 1 +) + +func (t *ChainTarget) StableSize() (size int) { + if t == nil { + return 0 + } + + size += proto.EnumSize(chainTargetTargetTypeField, int32(t.targeType)) + size += proto.StringSize(chainTargetNameField, t.name) + + return size +} + +func (t *ChainTarget) StableMarshal(buf []byte) []byte { + if t == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, t.StableSize()) + } + + var offset int + + offset += proto.EnumMarshal(chainTargetTargetTypeField, buf[offset:], int32(t.targeType)) + proto.StringMarshal(chainTargetNameField, buf[offset:], t.name) + + return buf +} + +func (t *ChainTarget) Unmarshal(data []byte) error { + return message.Unmarshal(t, data, new(apemanager.ChainTarget)) +} + +func (c *Chain) StableSize() (size int) { + if c == nil { + return 0 + } + + switch v := c.GetKind().(type) { + case *ChainRaw: + if v != nil { + size += proto.BytesSize(chainRawField, v.GetRaw()) + } + default: + panic(fmt.Sprintf("unsupported chain kind: %T", v)) + } + + return size +} + +func (c *Chain) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + var offset int + + switch v := c.GetKind().(type) { + case *ChainRaw: + if v != nil { + proto.BytesMarshal(chainRawField, buf[offset:], v.GetRaw()) + } + default: + panic(fmt.Sprintf("unsupported chain kind: %T", v)) + } + + return buf +} + +func (c *Chain) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(apemanager.Chain)) +} + +func (rb *AddChainRequestBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + size += proto.NestedStructureSize(addChainReqBodyTargetField, rb.target) + size += proto.NestedStructureSize(addChainReqBodyChainField, rb.chain) + + return size +} + +func (rb *AddChainRequestBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(addChainReqBodyTargetField, buf[offset:], rb.target) + proto.NestedStructureMarshal(addChainReqBodyChainField, buf[offset:], rb.chain) + + return buf +} + +func (rb *AddChainRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.AddChainRequest_Body)) +} + +func (rb *AddChainResponseBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + size += proto.BytesSize(addChainRespBodyChainIDField, rb.chainID) + + return size +} + +func (rb *AddChainResponseBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + var offset int + + proto.BytesMarshal(addChainRespBodyChainIDField, buf[offset:], rb.chainID) + + return buf +} + +func (rb *AddChainResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.AddChainResponse_Body)) +} + +func (rb *RemoveChainRequestBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + size += proto.NestedStructureSize(addChainReqBodyTargetField, rb.target) + size += proto.BytesSize(addChainReqBodyChainField, rb.chainID) + + return size +} + +func (rb *RemoveChainRequestBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + var offset int + + offset += proto.NestedStructureMarshal(removeChainReqBodyTargetField, buf[offset:], rb.target) + proto.BytesMarshal(removeChainReqBodyChainField, buf[offset:], rb.chainID) + + return buf +} + +func (rb *RemoveChainRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.RemoveChainRequest_Body)) +} + +func (rb *RemoveChainResponseBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + return size +} + +func (rb *RemoveChainResponseBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + return buf +} + +func (rb *RemoveChainResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.RemoveChainResponse_Body)) +} + +func (rb *ListChainsRequestBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + size += proto.NestedStructureSize(listChainsReqBodyTargetField, rb.target) + + return size +} + +func (rb *ListChainsRequestBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + var offset int + proto.NestedStructureMarshal(addChainReqBodyTargetField, buf[offset:], rb.target) + + return buf +} + +func (rb *ListChainsRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.ListChainsRequest_Body)) +} + +func (rb *ListChainsResponseBody) StableSize() (size int) { + if rb == nil { + return 0 + } + + for _, chain := range rb.GetChains() { + size += proto.NestedStructureSize(listChainsRespBodyChainsField, chain) + } + + return size +} + +func (rb *ListChainsResponseBody) StableMarshal(buf []byte) []byte { + if rb == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, rb.StableSize()) + } + + var offset int + for _, chain := range rb.GetChains() { + offset += proto.NestedStructureMarshal(listChainsRespBodyChainsField, buf[offset:], chain) + } + + return buf +} + +func (rb *ListChainsResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(rb, data, new(apemanager.ListChainsResponse_Body)) +} diff --git a/apemanager/message_test.go b/apemanager/message_test.go new file mode 100644 index 0000000..2d623d5 --- /dev/null +++ b/apemanager/message_test.go @@ -0,0 +1,27 @@ +package apemanager_test + +import ( + "testing" + + apemanagertest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return apemanagertest.GenerateChainTarget(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateAddChainRequestBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateAddChainRequest(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateAddChainResponseBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateAddChainResponse(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateRemoveChainRequestBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateRemoveChainRequest(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateRemoveChainResponseBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateRemoveChainResponse(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateListChainsRequestBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateListChainsRequest(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateListChainsResponseBody(empty) }, + func(empty bool) message.Message { return apemanagertest.GenerateListChainsResponse(empty) }, + ) +} diff --git a/apemanager/status.go b/apemanager/status.go new file mode 100644 index 0000000..932fa6b --- /dev/null +++ b/apemanager/status.go @@ -0,0 +1,76 @@ +package apemanager + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + statusgrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" +) + +// LocalizeFailStatus checks if passed global status.Code is related to ape manager failure and: +// +// then localizes the code and returns true, +// else leaves the code unchanged and returns false. +// +// Arg must be non-nil. +func LocalizeFailStatus(c *status.Code) bool { + return status.LocalizeIfInSection(c, uint32(statusgrpc.Section_SECTION_APE_MANAGER)) +} + +// GlobalizeFail globalizes local code of ape manager failure. +// +// Arg must be non-nil. +func GlobalizeFail(c *status.Code) { + c.GlobalizeSection(uint32(statusgrpc.Section_SECTION_APE_MANAGER)) +} + +const ( + // StatusAPEManagerAccessDenied is a local status.Code value for + // ACCESS_DENIED ape manager failure. + StatusAPEManagerAccessDenied status.Code = iota +) + +const ( + // detailAccessDeniedDesc is a StatusAccessDenied detail ID for + // human-readable description. + detailAccessDeniedDesc = iota +) + +// WriteAccessDeniedDesc writes human-readable description of StatusAccessDenied +// into status.Status as a detail. The status must not be nil. +// +// Existing details are expected to be ID-unique, otherwise undefined behavior. +func WriteAccessDeniedDesc(st *status.Status, desc string) { + var found bool + + st.IterateDetails(func(d *status.Detail) bool { + if d.ID() == detailAccessDeniedDesc { + found = true + d.SetValue([]byte(desc)) + } + + return found + }) + + if !found { + var d status.Detail + + d.SetID(detailAccessDeniedDesc) + d.SetValue([]byte(desc)) + + st.AppendDetails(d) + } +} + +// ReadAccessDeniedDesc looks up for status detail with human-readable description +// of StatusAccessDenied. Returns empty string if detail is missing. +func ReadAccessDeniedDesc(st status.Status) (desc string) { + st.IterateDetails(func(d *status.Detail) bool { + if d.ID() == detailAccessDeniedDesc { + desc = string(d.Value()) + return true + } + + return false + }) + + return +} diff --git a/apemanager/status_test.go b/apemanager/status_test.go new file mode 100644 index 0000000..c150ac7 --- /dev/null +++ b/apemanager/status_test.go @@ -0,0 +1,30 @@ +package apemanager_test + +import ( + "testing" + + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status" + statustest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/test" + "github.com/stretchr/testify/require" +) + +func TestStatusCodes(t *testing.T) { + statustest.TestCodes(t, apemanager.LocalizeFailStatus, apemanager.GlobalizeFail, + apemanager.StatusAPEManagerAccessDenied, 5120, + ) +} + +func TestAccessDeniedDesc(t *testing.T) { + var st status.Status + + require.Empty(t, apemanager.ReadAccessDeniedDesc(st)) + + const desc = "some description" + + apemanager.WriteAccessDeniedDesc(&st, desc) + require.Equal(t, desc, apemanager.ReadAccessDeniedDesc(st)) + + apemanager.WriteAccessDeniedDesc(&st, desc+"1") + require.Equal(t, desc+"1", apemanager.ReadAccessDeniedDesc(st)) +} diff --git a/apemanager/string.go b/apemanager/string.go new file mode 100644 index 0000000..dddeede --- /dev/null +++ b/apemanager/string.go @@ -0,0 +1,18 @@ +package apemanager + +import ( + apemanager_grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" +) + +func (tt TargetType) String() string { + return TargetTypeToGRPCField(tt).String() +} + +func (tt *TargetType) FromString(s string) bool { + i, ok := apemanager_grpc.TargetType_value[s] + if ok { + *tt = TargetType(i) + } + + return ok +} diff --git a/apemanager/test/generate.go b/apemanager/test/generate.go new file mode 100644 index 0000000..00dd236 --- /dev/null +++ b/apemanager/test/generate.go @@ -0,0 +1,208 @@ +package apemanagertest + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + sessiontest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/test" +) + +func generateChainID(empty bool) []byte { + if empty { + return []byte{} + } + + return []byte("616c6c6f774f626a476574436e72") +} + +func generateRawChains(empty bool, n int) []*apemanager.Chain { + if empty { + return []*apemanager.Chain{} + } + + res := make([]*apemanager.Chain, n) + for i := range res { + res[i] = generateRawChain(empty) + } + return res +} + +func generateRawChain(empty bool) *apemanager.Chain { + chRaw := new(apemanager.ChainRaw) + + if empty { + chRaw.SetRaw([]byte("{}")) + } else { + chRaw.SetRaw([]byte(`{ + "ID": "", + "Rules": [ + { + "Status": "Allow", + "Actions": { + "Inverted": false, + "Names": [ + "GetObject" + ] + }, + "Resources": { + "Inverted": false, + "Names": [ + "native:object/*" + ] + }, + "Any": false, + "Condition": [ + { + "Op": "StringEquals", + "Object": "Resource", + "Key": "Department", + "Value": "HR" + } + ] + } + ], + "MatchType": "DenyPriority" + }`)) + } + + ch := new(apemanager.Chain) + ch.SetKind(chRaw) + return ch +} + +func GenerateChainTarget(empty bool) *apemanager.ChainTarget { + m := new(apemanager.ChainTarget) + + if !empty { + m.SetTargetType(apemanager.TargetTypeContainer) + m.SetName("BzQw5HH3feoxFDD5tCT87Y1726qzgLfxEE7wgtoRzB3R") + } + + return m +} + +func GenerateAddChainRequestBody(empty bool) *apemanager.AddChainRequestBody { + m := new(apemanager.AddChainRequestBody) + + if !empty { + m.SetTarget(GenerateChainTarget(empty)) + m.SetChain(generateRawChain(empty)) + } + + return m +} + +func GenerateAddChainRequest(empty bool) *apemanager.AddChainRequest { + m := new(apemanager.AddChainRequest) + + if !empty { + m.SetBody(GenerateAddChainRequestBody(empty)) + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + } + + return m +} + +func GenerateAddChainResponseBody(empty bool) *apemanager.AddChainResponseBody { + m := new(apemanager.AddChainResponseBody) + + if !empty { + m.SetChainID(generateChainID(empty)) + } + + return m +} + +func GenerateAddChainResponse(empty bool) *apemanager.AddChainResponse { + m := new(apemanager.AddChainResponse) + + if !empty { + m.SetBody(GenerateAddChainResponseBody(empty)) + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + } + + return m +} + +func GenerateRemoveChainRequestBody(empty bool) *apemanager.RemoveChainRequestBody { + m := new(apemanager.RemoveChainRequestBody) + + if !empty { + m.SetChainID(generateChainID(empty)) + m.SetTarget(GenerateChainTarget(empty)) + } + + return m +} + +func GenerateRemoveChainRequest(empty bool) *apemanager.RemoveChainRequest { + m := new(apemanager.RemoveChainRequest) + + if !empty { + m.SetBody(GenerateRemoveChainRequestBody(empty)) + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + } + + return m +} + +func GenerateRemoveChainResponseBody(_ bool) *apemanager.RemoveChainResponseBody { + return new(apemanager.RemoveChainResponseBody) +} + +func GenerateRemoveChainResponse(empty bool) *apemanager.RemoveChainResponse { + m := new(apemanager.RemoveChainResponse) + + if !empty { + m.SetBody(GenerateRemoveChainResponseBody(empty)) + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + } + + return m +} + +func GenerateListChainsRequestBody(empty bool) *apemanager.ListChainsRequestBody { + m := new(apemanager.ListChainsRequestBody) + + if !empty { + m.SetTarget(GenerateChainTarget(empty)) + } + + return m +} + +func GenerateListChainsRequest(empty bool) *apemanager.ListChainsRequest { + m := new(apemanager.ListChainsRequest) + + if !empty { + m.SetBody(GenerateListChainsRequestBody(empty)) + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + } + + return m +} + +func GenerateListChainsResponseBody(empty bool) *apemanager.ListChainsResponseBody { + m := new(apemanager.ListChainsResponseBody) + + if !empty { + m.SetChains(generateRawChains(empty, 10)) + } + + return m +} + +func GenerateListChainsResponse(empty bool) *apemanager.ListChainsResponse { + m := new(apemanager.ListChainsResponse) + + if !empty { + m.SetBody(GenerateListChainsResponseBody(empty)) + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + } + + return m +} diff --git a/apemanager/types.go b/apemanager/types.go new file mode 100644 index 0000000..1fcca29 --- /dev/null +++ b/apemanager/types.go @@ -0,0 +1,244 @@ +package apemanager + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" +) + +type TargetType uint32 + +const ( + TargetTypeUndefined TargetType = iota + TargetTypeNamespace + TargetTypeContainer + TargetTypeUser + TargetTypeGroup +) + +type ChainTarget struct { + targeType TargetType + + name string +} + +func (ct *ChainTarget) SetTargetType(targeType TargetType) { + ct.targeType = targeType +} + +func (ct *ChainTarget) SetName(name string) { + ct.name = name +} + +func (ct *ChainTarget) GetTargetType() TargetType { + if ct != nil { + return ct.targeType + } + + return 0 +} + +func (ct *ChainTarget) GetName() string { + if ct != nil { + return ct.name + } + + return "" +} + +type AddChainRequest struct { + body *AddChainRequestBody + + session.RequestHeaders +} + +func (r *AddChainRequest) SetBody(body *AddChainRequestBody) { + r.body = body +} + +func (r *AddChainRequest) GetBody() *AddChainRequestBody { + return r.body +} + +type chainKind interface { + isChainKind() +} + +type Chain struct { + kind chainKind +} + +func (c *Chain) SetKind(kind chainKind) { + c.kind = kind +} + +func (c *Chain) GetKind() chainKind { + return c.kind +} + +type ChainRaw struct { + Raw []byte +} + +func (*ChainRaw) isChainKind() {} + +func (c *ChainRaw) SetRaw(raw []byte) { + c.Raw = raw +} + +func (c *ChainRaw) GetRaw() []byte { + return c.Raw +} + +type AddChainRequestBody struct { + target *ChainTarget + + chain *Chain +} + +func (rb *AddChainRequestBody) SetTarget(target *ChainTarget) { + rb.target = target +} + +func (rb *AddChainRequestBody) GetTarget() *ChainTarget { + return rb.target +} + +func (rb *AddChainRequestBody) SetChain(chain *Chain) { + rb.chain = chain +} + +func (rb *AddChainRequestBody) GetChain() *Chain { + return rb.chain +} + +type AddChainResponse struct { + body *AddChainResponseBody + + session.ResponseHeaders +} + +func (r *AddChainResponse) SetBody(body *AddChainResponseBody) { + r.body = body +} + +func (r *AddChainResponse) GetBody() *AddChainResponseBody { + return r.body +} + +type AddChainResponseBody struct { + chainID []byte +} + +func (rb *AddChainResponseBody) SetChainID(chainID []byte) { + rb.chainID = chainID +} + +func (rb *AddChainResponseBody) GetChainID() []byte { + return rb.chainID +} + +type RemoveChainRequest struct { + body *RemoveChainRequestBody + + session.RequestHeaders +} + +func (r *RemoveChainRequest) SetBody(body *RemoveChainRequestBody) { + r.body = body +} + +func (r *RemoveChainRequest) GetBody() *RemoveChainRequestBody { + return r.body +} + +type RemoveChainRequestBody struct { + target *ChainTarget + + chainID []byte +} + +func (rb *RemoveChainRequestBody) SetTarget(target *ChainTarget) { + rb.target = target +} + +func (rb *RemoveChainRequestBody) GetTarget() *ChainTarget { + return rb.target +} + +func (rb *RemoveChainRequestBody) SetChainID(chainID []byte) { + rb.chainID = chainID +} + +func (rb *RemoveChainRequestBody) GetChainID() []byte { + return rb.chainID +} + +type RemoveChainResponse struct { + body *RemoveChainResponseBody + + session.ResponseHeaders +} + +type RemoveChainResponseBody struct { +} + +func (r *RemoveChainResponse) SetBody(body *RemoveChainResponseBody) { + r.body = body +} + +func (r *RemoveChainResponse) GetBody() *RemoveChainResponseBody { + return r.body +} + +type ListChainsRequest struct { + body *ListChainsRequestBody + + session.RequestHeaders +} + +func (r *ListChainsRequest) SetBody(body *ListChainsRequestBody) { + r.body = body +} + +func (r *ListChainsRequest) GetBody() *ListChainsRequestBody { + return r.body +} + +type ListChainsRequestBody struct { + target *ChainTarget +} + +func (rb *ListChainsRequestBody) SetTarget(target *ChainTarget) { + rb.target = target +} + +func (rb *ListChainsRequestBody) GetTarget() *ChainTarget { + return rb.target +} + +type ListChainsResponse struct { + body *ListChainsResponseBody + + session.ResponseHeaders +} + +func (r *ListChainsResponse) SetBody(body *ListChainsResponseBody) { + r.body = body +} + +func (r *ListChainsResponse) GetBody() *ListChainsResponseBody { + return r.body +} + +type ListChainsResponseBody struct { + chains []*Chain + + session.RequestHeaders +} + +func (r *ListChainsResponseBody) SetChains(chains []*Chain) { + r.chains = chains +} + +func (r *ListChainsResponseBody) GetChains() []*Chain { + return r.chains +} diff --git a/rpc/apemanager.go b/rpc/apemanager.go new file mode 100644 index 0000000..3f3d6cd --- /dev/null +++ b/rpc/apemanager.go @@ -0,0 +1,60 @@ +package rpc + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" +) + +const serviceAPEManager = serviceNamePrefix + "apemanager.APEManagerService" + +const ( + rpcAPEManagerAddChain = "AddChain" + rpcAPEManagerRemoveChain = "RemoveChain" + rpcAPEManagerListChains = "ListChains" +) + +func AddChain( + cli *client.Client, + req *apemanager.AddChainRequest, + opts ...client.CallOption, +) (*apemanager.AddChainResponse, error) { + resp := new(apemanager.AddChainResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerAddChain), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +func RemoveChain( + cli *client.Client, + req *apemanager.RemoveChainRequest, + opts ...client.CallOption, +) (*apemanager.RemoveChainResponse, error) { + resp := new(apemanager.RemoveChainResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerRemoveChain), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} + +func ListChains( + cli *client.Client, + req *apemanager.ListChainsRequest, + opts ...client.CallOption, +) (*apemanager.ListChainsResponse, error) { + resp := new(apemanager.ListChainsResponse) + + err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceAPEManager, rpcAPEManagerListChains), req, resp, opts...) + if err != nil { + return nil, err + } + + return resp, nil +} diff --git a/signature/body.go b/signature/body.go index b7bb6b4..3362e95 100644 --- a/signature/body.go +++ b/signature/body.go @@ -4,6 +4,7 @@ import ( "fmt" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" @@ -105,5 +106,19 @@ func serviceMessageBody(req any) stableMarshaler { return v.GetBody() case *netmap.SnapshotResponse: return v.GetBody() + + /* APEManager */ + case *apemanager.AddChainRequest: + return v.GetBody() + case *apemanager.AddChainResponse: + return v.GetBody() + case *apemanager.RemoveChainRequest: + return v.GetBody() + case *apemanager.RemoveChainResponse: + return v.GetBody() + case *apemanager.ListChainsRequest: + return v.GetBody() + case *apemanager.ListChainsResponse: + return v.GetBody() } } diff --git a/status/grpc/types.pb.go b/status/grpc/types.pb.go index 9637294..64a0835 100644 --- a/status/grpc/types.pb.go +++ b/status/grpc/types.pb.go @@ -34,6 +34,8 @@ const ( 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. @@ -44,6 +46,7 @@ var ( 2: "SECTION_OBJECT", 3: "SECTION_CONTAINER", 4: "SECTION_SESSION", + 5: "SECTION_APE_MANAGER", } Section_value = map[string]int32{ "SECTION_SUCCESS": 0, @@ -51,6 +54,7 @@ var ( "SECTION_OBJECT": 2, "SECTION_CONTAINER": 3, "SECTION_SESSION": 4, + "SECTION_APE_MANAGER": 5, } ) @@ -359,6 +363,51 @@ func (Session) EnumDescriptor() ([]byte, []int) { return file_status_grpc_types_proto_rawDescGZIP(), []int{5} } +// Section of status for APE manager related operations. +type APEManager int32 + +const ( + // [**5120**] The operation is denied by APE manager. + APEManager_APE_MANAGER_ACCESS_DENIED APEManager = 0 +) + +// Enum value maps for APEManager. +var ( + APEManager_name = map[int32]string{ + 0: "APE_MANAGER_ACCESS_DENIED", + } + APEManager_value = map[string]int32{ + "APE_MANAGER_ACCESS_DENIED": 0, + } +) + +func (x APEManager) Enum() *APEManager { + p := new(APEManager) + *p = x + return p +} + +func (x APEManager) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (APEManager) Descriptor() protoreflect.EnumDescriptor { + return file_status_grpc_types_proto_enumTypes[6].Descriptor() +} + +func (APEManager) Type() protoreflect.EnumType { + return &file_status_grpc_types_proto_enumTypes[6] +} + +func (x APEManager) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use APEManager.Descriptor instead. +func (APEManager) EnumDescriptor() ([]byte, []int) { + return file_status_grpc_types_proto_rawDescGZIP(), []int{6} +} + // Declares the general format of the status returns of the NeoFS RPC protocol. // Status is present in all response messages. Each RPC of NeoFS protocol // describes the possible outcomes and details of the operation. @@ -531,46 +580,51 @@ var file_status_grpc_types_proto_rawDesc = []byte{ 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, - 0x7a, 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, 0x2a, 0x11, 0x0a, 0x07, 0x53, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x2a, 0x6f, - 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, 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, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, - 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, - 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, - 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 0x6f, 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, 0x2a, 0x88, 0x01, 0x0a, 0x06, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, + 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x42, 0x4a, 0x45, 0x43, + 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, + 0x06, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x4c, 0x4f, 0x43, + 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x4f, 0x42, + 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, + 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, + 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, + 0x47, 0x45, 0x10, 0x05, 0x2a, 0x55, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, + 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x41, + 0x43, 0x4c, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x1b, + 0x0a, 0x17, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, + 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x31, 0x0a, 0x07, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, + 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, + 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x2b, + 0x0a, 0x0a, 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, + 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, + 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x42, 0x61, 0x5a, 0x42, 0x67, + 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, + 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, + 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -585,7 +639,7 @@ func file_status_grpc_types_proto_rawDescGZIP() []byte { return file_status_grpc_types_proto_rawDescData } -var file_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 7) var file_status_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_status_grpc_types_proto_goTypes = []interface{}{ (Section)(0), // 0: neo.fs.v2.status.Section @@ -594,11 +648,12 @@ var file_status_grpc_types_proto_goTypes = []interface{}{ (Object)(0), // 3: neo.fs.v2.status.Object (Container)(0), // 4: neo.fs.v2.status.Container (Session)(0), // 5: neo.fs.v2.status.Session - (*Status)(nil), // 6: neo.fs.v2.status.Status - (*Status_Detail)(nil), // 7: neo.fs.v2.status.Status.Detail + (APEManager)(0), // 6: neo.fs.v2.status.APEManager + (*Status)(nil), // 7: neo.fs.v2.status.Status + (*Status_Detail)(nil), // 8: neo.fs.v2.status.Status.Detail } var file_status_grpc_types_proto_depIdxs = []int32{ - 7, // 0: neo.fs.v2.status.Status.details:type_name -> neo.fs.v2.status.Status.Detail + 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 @@ -642,7 +697,7 @@ func file_status_grpc_types_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_status_grpc_types_proto_rawDesc, - NumEnums: 6, + NumEnums: 7, NumMessages: 2, NumExtensions: 0, NumServices: 0, From fa8f92d6621faa76b027c451f1dbef7de637d170 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 25 Apr 2024 15:12:32 +0300 Subject: [PATCH 094/169] [#75] audit: Remove deprecated service Signed-off-by: Evgenii Stratonikov --- audit/convert.go | 94 ------------- audit/grpc/types.go | 75 ---------- audit/grpc/types.pb.go | 311 ----------------------------------------- audit/json.go | 14 -- audit/marshal.go | 88 ------------ audit/message_test.go | 15 -- audit/test/generate.go | 29 ---- audit/types.go | 243 -------------------------------- 8 files changed, 869 deletions(-) delete mode 100644 audit/convert.go delete mode 100644 audit/grpc/types.go delete mode 100644 audit/grpc/types.pb.go delete mode 100644 audit/json.go delete mode 100644 audit/marshal.go delete mode 100644 audit/message_test.go delete mode 100644 audit/test/generate.go delete mode 100644 audit/types.go diff --git a/audit/convert.go b/audit/convert.go deleted file mode 100644 index a841928..0000000 --- a/audit/convert.go +++ /dev/null @@ -1,94 +0,0 @@ -package audit - -import ( - audit "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" -) - -func (a *DataAuditResult) ToGRPCMessage() grpc.Message { - var m *audit.DataAuditResult - - if a != nil { - m = new(audit.DataAuditResult) - - m.SetAuditEpoch(a.auditEpoch) - m.SetPublicKey(a.pubKey) - m.SetContainerId(a.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) - m.SetComplete(a.complete) - m.SetVersion(a.version.ToGRPCMessage().(*refsGRPC.Version)) - m.SetPassNodes(a.passNodes) - m.SetFailNodes(a.failNodes) - m.SetRetries(a.retries) - m.SetRequests(a.requests) - m.SetHit(a.hit) - m.SetMiss(a.miss) - m.SetFail(a.fail) - m.SetPassSg(refs.ObjectIDListToGRPCMessage(a.passSG)) - m.SetFailSg(refs.ObjectIDListToGRPCMessage(a.failSG)) - } - - return m -} - -func (a *DataAuditResult) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*audit.DataAuditResult) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - cid := v.GetContainerId() - if cid == nil { - a.cid = nil - } else { - if a.cid == nil { - a.cid = new(refs.ContainerID) - } - - err = a.cid.FromGRPCMessage(cid) - if err != nil { - return err - } - } - - version := v.GetVersion() - if version == nil { - a.version = nil - } else { - if a.version == nil { - a.version = new(refs.Version) - } - - err = a.version.FromGRPCMessage(version) - if err != nil { - return err - } - } - - a.passSG, err = refs.ObjectIDListFromGRPCMessage(v.GetPassSg()) - if err != nil { - return err - } - - a.failSG, err = refs.ObjectIDListFromGRPCMessage(v.GetFailSg()) - if err != nil { - return err - } - - a.auditEpoch = v.GetAuditEpoch() - a.pubKey = v.GetPublicKey() - a.complete = v.GetComplete() - a.passNodes = v.GetPassNodes() - a.failNodes = v.GetFailNodes() - a.retries = v.GetRetries() - a.requests = v.GetRequests() - a.hit = v.GetHit() - a.miss = v.GetMiss() - a.fail = v.GetFail() - - return err -} diff --git a/audit/grpc/types.go b/audit/grpc/types.go deleted file mode 100644 index 59bb184..0000000 --- a/audit/grpc/types.go +++ /dev/null @@ -1,75 +0,0 @@ -package audit - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" -) - -// SetVersion is a Version field setter. -func (x *DataAuditResult) SetVersion(v *refs.Version) { - x.Version = v -} - -// SetAuditEpoch is an AuditEpoch field setter. -func (x *DataAuditResult) SetAuditEpoch(v uint64) { - x.AuditEpoch = v -} - -// SetContainerId is a ContainerId field setter. -func (x *DataAuditResult) SetContainerId(v *refs.ContainerID) { - x.ContainerId = v -} - -// SetPublicKey is a PublicKey field setter. -func (x *DataAuditResult) SetPublicKey(v []byte) { - x.PublicKey = v -} - -// SetComplete is a Complete field setter. -func (x *DataAuditResult) SetComplete(v bool) { - x.Complete = v -} - -// SetRequests is a Requests field setter. -func (x *DataAuditResult) SetRequests(v uint32) { - x.Requests = v -} - -// SetRetries is a Retries field setter. -func (x *DataAuditResult) SetRetries(v uint32) { - x.Retries = v -} - -// SetPassSg is a PassSg field setter. -func (x *DataAuditResult) SetPassSg(v []*refs.ObjectID) { - x.PassSg = v -} - -// SetFailSg is a FailSg field setter. -func (x *DataAuditResult) SetFailSg(v []*refs.ObjectID) { - x.FailSg = v -} - -// SetHit is a Hit field setter. -func (x *DataAuditResult) SetHit(v uint32) { - x.Hit = v -} - -// SetMiss is a Miss field setter. -func (x *DataAuditResult) SetMiss(v uint32) { - x.Miss = v -} - -// SetFail is a Fail field setter. -func (x *DataAuditResult) SetFail(v uint32) { - x.Fail = v -} - -// SetPassNodes is a PassNodes field setter. -func (x *DataAuditResult) SetPassNodes(v [][]byte) { - x.PassNodes = v -} - -// SetFailNodes is a FailNodes field setter. -func (x *DataAuditResult) SetFailNodes(v [][]byte) { - x.FailNodes = v -} diff --git a/audit/grpc/types.pb.go b/audit/grpc/types.pb.go deleted file mode 100644 index 57243ef..0000000 --- a/audit/grpc/types.pb.go +++ /dev/null @@ -1,311 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v4.25.3 -// source: audit/grpc/types.proto - -package audit - -import ( - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// DataAuditResult keeps record of conducted Data Audits. The detailed report is -// generated separately. -type DataAuditResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Data Audit Result format version. Effectively, the version of API library - // used to report DataAuditResult structure. - Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Epoch number when the Data Audit was conducted - AuditEpoch uint64 `protobuf:"fixed64,2,opt,name=audit_epoch,json=auditEpoch,proto3" json:"audit_epoch,omitempty"` - // Container under audit - ContainerId *grpc.ContainerID `protobuf:"bytes,3,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"` - // Public key of the auditing InnerRing node in a binary format - PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // Shows if Data Audit process was complete in time or if it was cancelled - Complete bool `protobuf:"varint,5,opt,name=complete,proto3" json:"complete,omitempty"` - // Number of request done at PoR stage - Requests uint32 `protobuf:"varint,6,opt,name=requests,proto3" json:"requests,omitempty"` - // Number of retries done at PoR stage - Retries uint32 `protobuf:"varint,7,opt,name=retries,proto3" json:"retries,omitempty"` - // List of Storage Groups that passed audit PoR stage - PassSg []*grpc.ObjectID `protobuf:"bytes,8,rep,name=pass_sg,json=passSG,proto3" json:"pass_sg,omitempty"` - // List of Storage Groups that failed audit PoR stage - FailSg []*grpc.ObjectID `protobuf:"bytes,9,rep,name=fail_sg,json=failSG,proto3" json:"fail_sg,omitempty"` - // Number of sampled objects under the audit placed in an optimal way - // according to the containers placement policy when checking PoP - Hit uint32 `protobuf:"varint,10,opt,name=hit,proto3" json:"hit,omitempty"` - // Number of sampled objects under the audit placed in suboptimal way - // according to the containers placement policy, but still at a satisfactory - // level when checking PoP - Miss uint32 `protobuf:"varint,11,opt,name=miss,proto3" json:"miss,omitempty"` - // Number of sampled objects under the audit stored inconsistently with the - // placement policy or not found at all when checking PoP - Fail uint32 `protobuf:"varint,12,opt,name=fail,proto3" json:"fail,omitempty"` - // List of storage node public keys that passed at least one PDP - PassNodes [][]byte `protobuf:"bytes,13,rep,name=pass_nodes,json=passNodes,proto3" json:"pass_nodes,omitempty"` - // List of storage node public keys that failed at least one PDP - FailNodes [][]byte `protobuf:"bytes,14,rep,name=fail_nodes,json=failNodes,proto3" json:"fail_nodes,omitempty"` -} - -func (x *DataAuditResult) Reset() { - *x = DataAuditResult{} - if protoimpl.UnsafeEnabled { - mi := &file_audit_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DataAuditResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataAuditResult) ProtoMessage() {} - -func (x *DataAuditResult) ProtoReflect() protoreflect.Message { - mi := &file_audit_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DataAuditResult.ProtoReflect.Descriptor instead. -func (*DataAuditResult) Descriptor() ([]byte, []int) { - return file_audit_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *DataAuditResult) GetVersion() *grpc.Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *DataAuditResult) GetAuditEpoch() uint64 { - if x != nil { - return x.AuditEpoch - } - return 0 -} - -func (x *DataAuditResult) GetContainerId() *grpc.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -func (x *DataAuditResult) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *DataAuditResult) GetComplete() bool { - if x != nil { - return x.Complete - } - return false -} - -func (x *DataAuditResult) GetRequests() uint32 { - if x != nil { - return x.Requests - } - return 0 -} - -func (x *DataAuditResult) GetRetries() uint32 { - if x != nil { - return x.Retries - } - return 0 -} - -func (x *DataAuditResult) GetPassSg() []*grpc.ObjectID { - if x != nil { - return x.PassSg - } - return nil -} - -func (x *DataAuditResult) GetFailSg() []*grpc.ObjectID { - if x != nil { - return x.FailSg - } - return nil -} - -func (x *DataAuditResult) GetHit() uint32 { - if x != nil { - return x.Hit - } - return 0 -} - -func (x *DataAuditResult) GetMiss() uint32 { - if x != nil { - return x.Miss - } - return 0 -} - -func (x *DataAuditResult) GetFail() uint32 { - if x != nil { - return x.Fail - } - return 0 -} - -func (x *DataAuditResult) GetPassNodes() [][]byte { - if x != nil { - return x.PassNodes - } - return nil -} - -func (x *DataAuditResult) GetFailNodes() [][]byte { - if x != nil { - return x.FailNodes - } - return nil -} - -var File_audit_grpc_types_proto protoreflect.FileDescriptor - -var file_audit_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x61, 0x75, 0x64, 0x69, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xf4, 0x03, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x41, 0x75, 0x64, 0x69, 0x74, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 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, 0x1f, 0x0a, 0x0b, 0x61, 0x75, 0x64, 0x69, 0x74, - 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0a, 0x61, 0x75, - 0x64, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, - 0x18, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x07, 0x70, 0x61, 0x73, - 0x73, 0x5f, 0x73, 0x67, 0x18, 0x08, 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, 0x06, 0x70, 0x61, 0x73, 0x73, 0x53, 0x47, 0x12, 0x31, 0x0a, 0x07, - 0x66, 0x61, 0x69, 0x6c, 0x5f, 0x73, 0x67, 0x18, 0x09, 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, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x53, 0x47, 0x12, - 0x10, 0x0a, 0x03, 0x68, 0x69, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x68, 0x69, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x69, 0x73, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x04, 0x6d, 0x69, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x61, 0x69, 0x6c, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x04, 0x66, 0x61, 0x69, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x73, - 0x73, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x70, - 0x61, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x61, 0x69, 0x6c, - 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x66, 0x61, - 0x69, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x5e, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x2e, 0x66, - 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, - 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x75, 0x64, 0x69, 0x74, 0xaa, 0x02, 0x19, 0x4e, 0x65, - 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, - 0x49, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_audit_grpc_types_proto_rawDescOnce sync.Once - file_audit_grpc_types_proto_rawDescData = file_audit_grpc_types_proto_rawDesc -) - -func file_audit_grpc_types_proto_rawDescGZIP() []byte { - file_audit_grpc_types_proto_rawDescOnce.Do(func() { - file_audit_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_audit_grpc_types_proto_rawDescData) - }) - return file_audit_grpc_types_proto_rawDescData -} - -var file_audit_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_audit_grpc_types_proto_goTypes = []interface{}{ - (*DataAuditResult)(nil), // 0: neo.fs.v2.audit.DataAuditResult - (*grpc.Version)(nil), // 1: neo.fs.v2.refs.Version - (*grpc.ContainerID)(nil), // 2: neo.fs.v2.refs.ContainerID - (*grpc.ObjectID)(nil), // 3: neo.fs.v2.refs.ObjectID -} -var file_audit_grpc_types_proto_depIdxs = []int32{ - 1, // 0: neo.fs.v2.audit.DataAuditResult.version:type_name -> neo.fs.v2.refs.Version - 2, // 1: neo.fs.v2.audit.DataAuditResult.container_id:type_name -> neo.fs.v2.refs.ContainerID - 3, // 2: neo.fs.v2.audit.DataAuditResult.pass_sg:type_name -> neo.fs.v2.refs.ObjectID - 3, // 3: neo.fs.v2.audit.DataAuditResult.fail_sg:type_name -> neo.fs.v2.refs.ObjectID - 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_audit_grpc_types_proto_init() } -func file_audit_grpc_types_proto_init() { - if File_audit_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_audit_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataAuditResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_audit_grpc_types_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_audit_grpc_types_proto_goTypes, - DependencyIndexes: file_audit_grpc_types_proto_depIdxs, - MessageInfos: file_audit_grpc_types_proto_msgTypes, - }.Build() - File_audit_grpc_types_proto = out.File - file_audit_grpc_types_proto_rawDesc = nil - file_audit_grpc_types_proto_goTypes = nil - file_audit_grpc_types_proto_depIdxs = nil -} diff --git a/audit/json.go b/audit/json.go deleted file mode 100644 index cbcf41f..0000000 --- a/audit/json.go +++ /dev/null @@ -1,14 +0,0 @@ -package audit - -import ( - audit "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" -) - -func (a *DataAuditResult) MarshalJSON() ([]byte, error) { - return message.MarshalJSON(a) -} - -func (a *DataAuditResult) UnmarshalJSON(data []byte) error { - return message.UnmarshalJSON(a, data, new(audit.DataAuditResult)) -} diff --git a/audit/marshal.go b/audit/marshal.go deleted file mode 100644 index a039baf..0000000 --- a/audit/marshal.go +++ /dev/null @@ -1,88 +0,0 @@ -package audit - -import ( - audit "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/grpc" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" -) - -const ( - _ = iota - versionFNum - auditEpochFNum - cidFNum - pubKeyFNum - completeFNum - requestsFNum - retriesFNum - passSGFNum - failSGFNum - hitFNum - missFNum - failFNum - passNodesFNum - failNodesFNum -) - -// StableMarshal marshals unified DataAuditResult structure into a protobuf -// binary format without field order shuffle. -func (a *DataAuditResult) StableMarshal(buf []byte) []byte { - if a == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, a.StableSize()) - } - - var offset int - - offset += proto.NestedStructureMarshal(versionFNum, buf[offset:], a.version) - offset += proto.Fixed64Marshal(auditEpochFNum, buf[offset:], a.auditEpoch) - offset += proto.NestedStructureMarshal(cidFNum, buf[offset:], a.cid) - offset += proto.BytesMarshal(pubKeyFNum, buf[offset:], a.pubKey) - offset += proto.BoolMarshal(completeFNum, buf[offset:], a.complete) - offset += proto.UInt32Marshal(requestsFNum, buf[offset:], a.requests) - offset += proto.UInt32Marshal(retriesFNum, buf[offset:], a.retries) - offset += refs.ObjectIDNestedListMarshal(passSGFNum, buf[offset:], a.passSG) - offset += refs.ObjectIDNestedListMarshal(failSGFNum, buf[offset:], a.failSG) - offset += proto.UInt32Marshal(hitFNum, buf[offset:], a.hit) - offset += proto.UInt32Marshal(missFNum, buf[offset:], a.miss) - offset += proto.UInt32Marshal(failFNum, buf[offset:], a.fail) - offset += proto.RepeatedBytesMarshal(passNodesFNum, buf[offset:], a.passNodes) - proto.RepeatedBytesMarshal(failNodesFNum, buf[offset:], a.failNodes) - - return buf -} - -// StableSize returns byte length of DataAuditResult structure -// marshaled by StableMarshal function. -func (a *DataAuditResult) StableSize() (size int) { - if a == nil { - return 0 - } - - size += proto.NestedStructureSize(versionFNum, a.version) - size += proto.Fixed64Size(auditEpochFNum, a.auditEpoch) - size += proto.NestedStructureSize(cidFNum, a.cid) - size += proto.BytesSize(pubKeyFNum, a.pubKey) - size += proto.BoolSize(completeFNum, a.complete) - size += proto.UInt32Size(requestsFNum, a.requests) - size += proto.UInt32Size(retriesFNum, a.retries) - size += refs.ObjectIDNestedListSize(passSGFNum, a.passSG) - size += refs.ObjectIDNestedListSize(failSGFNum, a.failSG) - size += proto.UInt32Size(hitFNum, a.hit) - size += proto.UInt32Size(missFNum, a.miss) - size += proto.UInt32Size(failFNum, a.fail) - size += proto.RepeatedBytesSize(passNodesFNum, a.passNodes) - size += proto.RepeatedBytesSize(failNodesFNum, a.failNodes) - - return size -} - -// Unmarshal unmarshals DataAuditResult structure from its protobuf -// binary representation. -func (a *DataAuditResult) Unmarshal(data []byte) error { - return message.Unmarshal(a, data, new(audit.DataAuditResult)) -} diff --git a/audit/message_test.go b/audit/message_test.go deleted file mode 100644 index 02c7f78..0000000 --- a/audit/message_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package audit_test - -import ( - "testing" - - audittest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/test" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" - messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" -) - -func TestMessageConvert(t *testing.T) { - messagetest.TestRPCMessage(t, - func(empty bool) message.Message { return audittest.GenerateDataAuditResult(empty) }, - ) -} diff --git a/audit/test/generate.go b/audit/test/generate.go deleted file mode 100644 index 093cbfe..0000000 --- a/audit/test/generate.go +++ /dev/null @@ -1,29 +0,0 @@ -package audittest - -import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit" - refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" -) - -func GenerateDataAuditResult(empty bool) *audit.DataAuditResult { - m := new(audit.DataAuditResult) - - if !empty { - m.SetPublicKey([]byte{1, 2, 3}) - m.SetAuditEpoch(13) - m.SetHit(100) - m.SetMiss(200) - m.SetFail(300) - m.SetComplete(true) - m.SetPassNodes([][]byte{{1}, {2}}) - m.SetFailNodes([][]byte{{3}, {4}}) - m.SetRequests(666) - m.SetRetries(777) - m.SetVersion(refstest.GenerateVersion(false)) - m.SetContainerID(refstest.GenerateContainerID(false)) - m.SetPassSG(refstest.GenerateObjectIDs(false)) - m.SetFailSG(refstest.GenerateObjectIDs(false)) - } - - return m -} diff --git a/audit/types.go b/audit/types.go deleted file mode 100644 index 6f856f0..0000000 --- a/audit/types.go +++ /dev/null @@ -1,243 +0,0 @@ -package audit - -import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" -) - -// DataAuditResult is a unified structure of -// DataAuditResult message from proto definition. -type DataAuditResult struct { - version *refs.Version - - auditEpoch uint64 - - requests, retries uint32 - - hit, miss, fail uint32 - - cid *refs.ContainerID - - pubKey []byte - - passSG, failSG []refs.ObjectID - - failNodes, passNodes [][]byte - - complete bool -} - -// GetVersion returns version of Data Audit structure. -func (a *DataAuditResult) GetVersion() *refs.Version { - if a != nil { - return a.version - } - - return nil -} - -// SetVersion sets version of Data Audit structure. -func (a *DataAuditResult) SetVersion(v *refs.Version) { - a.version = v -} - -// GetAuditEpoch returns epoch number when the Data Audit was conducted. -func (a *DataAuditResult) GetAuditEpoch() uint64 { - if a != nil { - return a.auditEpoch - } - - return 0 -} - -// SetAuditEpoch sets epoch number when the Data Audit was conducted. -func (a *DataAuditResult) SetAuditEpoch(v uint64) { - a.auditEpoch = v -} - -// GetContainerID returns container under audit. -func (a *DataAuditResult) GetContainerID() *refs.ContainerID { - if a != nil { - return a.cid - } - - return nil -} - -// SetContainerID sets container under audit. -func (a *DataAuditResult) SetContainerID(v *refs.ContainerID) { - a.cid = v -} - -// GetPublicKey returns public key of the auditing InnerRing node in a binary format. -func (a *DataAuditResult) GetPublicKey() []byte { - if a != nil { - return a.pubKey - } - - return nil -} - -// SetPublicKey sets public key of the auditing InnerRing node in a binary format. -func (a *DataAuditResult) SetPublicKey(v []byte) { - a.pubKey = v -} - -// GetPassSG returns list of Storage Groups that passed audit PoR stage. -func (a *DataAuditResult) GetPassSG() []refs.ObjectID { - if a != nil { - return a.passSG - } - - return nil -} - -// SetPassSG sets list of Storage Groups that passed audit PoR stage. -func (a *DataAuditResult) SetPassSG(v []refs.ObjectID) { - a.passSG = v -} - -// GetFailSG returns list of Storage Groups that failed audit PoR stage. -func (a *DataAuditResult) GetFailSG() []refs.ObjectID { - if a != nil { - return a.failSG - } - - return nil -} - -// SetFailSG sets list of Storage Groups that failed audit PoR stage. -func (a *DataAuditResult) SetFailSG(v []refs.ObjectID) { - a.failSG = v -} - -// GetRequests returns number of requests made by PoR audit check to get -// all headers of the objects inside storage groups. -func (a *DataAuditResult) GetRequests() uint32 { - if a != nil { - return a.requests - } - - return 0 -} - -// SetRequests sets number of requests made by PoR audit check to get -// all headers of the objects inside storage groups. -func (a *DataAuditResult) SetRequests(v uint32) { - a.requests = v -} - -// GetRetries returns number of retries made by PoR audit check to get -// all headers of the objects inside storage groups. -func (a *DataAuditResult) GetRetries() uint32 { - if a != nil { - return a.retries - } - - return 0 -} - -// SetRetries sets number of retries made by PoR audit check to get -// all headers of the objects inside storage groups. -func (a *DataAuditResult) SetRetries(v uint32) { - a.retries = v -} - -// GetHit returns number of sampled objects under audit placed -// in an optimal way according to the containers placement policy -// when checking PoP. -func (a *DataAuditResult) GetHit() uint32 { - if a != nil { - return a.hit - } - - return 0 -} - -// SetHit sets number of sampled objects under audit placed -// in an optimal way according to the containers placement policy -// when checking PoP. -func (a *DataAuditResult) SetHit(v uint32) { - a.hit = v -} - -// GetMiss returns number of sampled objects under audit placed -// in suboptimal way according to the containers placement policy, -// but still at a satisfactory level when checking PoP. -func (a *DataAuditResult) GetMiss() uint32 { - if a != nil { - return a.miss - } - - return 0 -} - -// SetMiss sets number of sampled objects under audit placed -// in suboptimal way according to the containers placement policy, -// but still at a satisfactory level when checking PoP. -func (a *DataAuditResult) SetMiss(v uint32) { - a.miss = v -} - -// GetFail returns number of sampled objects under audit stored -// in a way not confirming placement policy or not found at all -// when checking PoP. -func (a *DataAuditResult) GetFail() uint32 { - if a != nil { - return a.fail - } - - return 0 -} - -// SetFail sets number of sampled objects under audit stored -// in a way not confirming placement policy or not found at all -// when checking PoP. -func (a *DataAuditResult) SetFail(v uint32) { - a.fail = v -} - -// GetPassNodes returns list of storage node public keys that -// passed at least one PDP. -func (a *DataAuditResult) GetPassNodes() [][]byte { - if a != nil { - return a.passNodes - } - - return nil -} - -// SetPassNodes sets list of storage node public keys that -// passed at least one PDP. -func (a *DataAuditResult) SetPassNodes(v [][]byte) { - a.passNodes = v -} - -// GetFailNodes returns list of storage node public keys that -// failed at least one PDP. -func (a *DataAuditResult) GetFailNodes() [][]byte { - if a != nil { - return a.failNodes - } - - return nil -} - -// SetFailNodes sets list of storage node public keys that -// failed at least one PDP. -func (a *DataAuditResult) SetFailNodes(v [][]byte) { - a.failNodes = v -} - -// GetComplete returns boolean completion statement of audit result. -func (a *DataAuditResult) GetComplete() bool { - if a != nil { - return a.complete - } - - return false // bool default -} - -// SetComplete sets boolean completion statement of audit result. -func (a *DataAuditResult) SetComplete(v bool) { - a.complete = v -} From 0fe6b9adbb721353b27148853a48bce476d2b8cb Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 26 Apr 2024 11:54:35 +0300 Subject: [PATCH 095/169] [#76] Make setter names more consistent This will make the transition to a new codegen more seamless. 1. Setter should be named as the field itself. 2. Setter should accept 1 parameter. Signed-off-by: Evgenii Stratonikov --- acl/convert.go | 4 ++-- acl/grpc/types.go | 8 ++++---- apemanager/convert.go | 4 ++-- apemanager/grpc/service.go | 4 ++-- object/convert.go | 6 +++--- object/grpc/service.go | 12 ++++++------ refs/convert.go | 2 +- refs/grpc/types.go | 4 ++-- session/convert.go | 11 +++++++---- session/grpc/types.go | 17 +++++++---------- 10 files changed, 36 insertions(+), 36 deletions(-) diff --git a/acl/convert.go b/acl/convert.go index 3020f4d..342c110 100644 --- a/acl/convert.go +++ b/acl/convert.go @@ -164,7 +164,7 @@ func (f *HeaderFilter) ToGRPCMessage() grpc.Message { m.SetKey(f.key) m.SetValue(f.value) - m.SetHeader(HeaderTypeToGRPCField(f.hdrType)) + m.SetHeaderType(HeaderTypeToGRPCField(f.hdrType)) m.SetMatchType(MatchTypeToGRPCField(f.matchType)) } @@ -427,7 +427,7 @@ func (bt *BearerTokenBody) ToGRPCMessage() grpc.Message { m.SetOwnerId(bt.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) m.SetLifetime(bt.lifetime.ToGRPCMessage().(*acl.BearerToken_Body_TokenLifetime)) m.SetEaclTable(bt.eacl.ToGRPCMessage().(*acl.EACLTable)) - m.SetImpersonate(bt.impersonate) + m.SetAllowImpersonate(bt.impersonate) } return m diff --git a/acl/grpc/types.go b/acl/grpc/types.go index b07f893..ce50e2f 100644 --- a/acl/grpc/types.go +++ b/acl/grpc/types.go @@ -39,8 +39,8 @@ func (m *EACLRecord) SetTargets(v []*EACLRecord_Target) { m.Targets = v } -// SetHeader sets header type of the eACL filter. -func (m *EACLRecord_Filter) SetHeader(v HeaderType) { +// SetHeaderType sets header type of the eACL filter. +func (m *EACLRecord_Filter) SetHeaderType(v HeaderType) { m.HeaderType = v } @@ -84,8 +84,8 @@ func (m *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) { m.Lifetime = v } -// SetImpersonate allows impersonate. -func (m *BearerToken_Body) SetImpersonate(v bool) { +// SetAllowImpersonate allows impersonate. +func (m *BearerToken_Body) SetAllowImpersonate(v bool) { m.AllowImpersonate = v } diff --git a/apemanager/convert.go b/apemanager/convert.go index 12b087c..f1cbcda 100644 --- a/apemanager/convert.go +++ b/apemanager/convert.go @@ -202,7 +202,7 @@ func (respBody *AddChainResponseBody) ToGRPCMessage() grpc.Message { if respBody != nil { respBodygrpc = new(apemanager.AddChainResponse_Body) - respBodygrpc.SetChainID(respBody.GetChainID()) + respBodygrpc.SetChainId(respBody.GetChainID()) } return respBodygrpc @@ -255,7 +255,7 @@ func (reqBody *RemoveChainRequestBody) ToGRPCMessage() grpc.Message { reqBodygrpc = new(apemanager.RemoveChainRequest_Body) reqBodygrpc.SetTarget(reqBody.target.ToGRPCMessage().(*apemanager.ChainTarget)) - reqBodygrpc.SetChainID(reqBody.GetChainID()) + reqBodygrpc.SetChainId(reqBody.GetChainID()) } return reqBodygrpc diff --git a/apemanager/grpc/service.go b/apemanager/grpc/service.go index 89ffa71..c07bceb 100644 --- a/apemanager/grpc/service.go +++ b/apemanager/grpc/service.go @@ -24,7 +24,7 @@ func (r *AddChainRequest) SetVerifyHeader(vh *session_grpc.RequestVerificationHe r.VerifyHeader = vh } -func (rb *AddChainResponse_Body) SetChainID(chainID []byte) { +func (rb *AddChainResponse_Body) SetChainId(chainID []byte) { rb.ChainId = chainID } @@ -44,7 +44,7 @@ func (rb *RemoveChainRequest_Body) SetTarget(t *ChainTarget) { rb.Target = t } -func (rb *RemoveChainRequest_Body) SetChainID(chainID []byte) { +func (rb *RemoveChainRequest_Body) SetChainId(chainID []byte) { rb.ChainId = chainID } diff --git a/object/convert.go b/object/convert.go index 9b266ac..f19cc09 100644 --- a/object/convert.go +++ b/object/convert.go @@ -901,7 +901,7 @@ func (r *GetResponseBody) ToGRPCMessage() grpc.Message { case *SplitInfo: m.SetSplitInfo(t.ToGRPCMessage().(*object.SplitInfo)) case *ECInfo: - m.SetECInfo(t.ToGRPCMessage().(*object.ECInfo)) + m.SetEcInfo(t.ToGRPCMessage().(*object.ECInfo)) default: panic(fmt.Sprintf("unknown get object part %T", t)) } @@ -1486,7 +1486,7 @@ func (r *HeadResponseBody) ToGRPCMessage() grpc.Message { case *SplitInfo: m.SetSplitInfo(v.ToGRPCMessage().(*object.SplitInfo)) case *ECInfo: - m.SetECInfo(v.ToGRPCMessage().(*object.ECInfo)) + m.SetEcInfo(v.ToGRPCMessage().(*object.ECInfo)) default: panic(fmt.Sprintf("unknown head part %T", v)) } @@ -1963,7 +1963,7 @@ func (r *GetRangeResponseBody) ToGRPCMessage() grpc.Message { case *SplitInfo: m.SetSplitInfo(v.ToGRPCMessage().(*object.SplitInfo)) case *ECInfo: - m.SetECInfo(v.ToGRPCMessage().(*object.ECInfo)) + m.SetEcInfo(v.ToGRPCMessage().(*object.ECInfo)) default: panic(fmt.Sprintf("unknown get range part %T", v)) } diff --git a/object/grpc/service.go b/object/grpc/service.go index 49f160b..3ff1f3a 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -78,8 +78,8 @@ func (m *GetResponse_Body) SetSplitInfo(v *SplitInfo) { } } -// SetECInfo sets part of the object payload. -func (m *GetResponse_Body) SetECInfo(v *ECInfo) { +// SetEcInfo sets part of the object payload. +func (m *GetResponse_Body) SetEcInfo(v *ECInfo) { m.ObjectPart = &GetResponse_Body_EcInfo{ EcInfo: v, } @@ -282,8 +282,8 @@ func (m *HeadResponse_Body) SetSplitInfo(v *SplitInfo) { } } -// SetECInfo sets meta info about the erasure coded object. -func (m *HeadResponse_Body) SetECInfo(v *ECInfo) { +// SetEcInfo sets meta info about the erasure coded object. +func (m *HeadResponse_Body) SetEcInfo(v *ECInfo) { m.Head = &HeadResponse_Body_EcInfo{ EcInfo: v, } @@ -435,8 +435,8 @@ func (m *GetRangeResponse_Body) SetSplitInfo(v *SplitInfo) { } } -// SetECInfo sets meta info about the erasure-coded object. -func (m *GetRangeResponse_Body) SetECInfo(v *ECInfo) { +// SetEcInfo sets meta info about the erasure-coded object. +func (m *GetRangeResponse_Body) SetEcInfo(v *ECInfo) { m.RangePart = &GetRangeResponse_Body_EcInfo{ EcInfo: v, } diff --git a/refs/convert.go b/refs/convert.go index b2c353c..6f06783 100644 --- a/refs/convert.go +++ b/refs/convert.go @@ -196,7 +196,7 @@ func (c *Checksum) ToGRPCMessage() grpc.Message { if c != nil { m = new(refs.Checksum) - m.SetChecksumType(ChecksumTypeToGRPC(c.typ)) + m.SetType(ChecksumTypeToGRPC(c.typ)) m.SetSum(c.sum) } diff --git a/refs/grpc/types.go b/refs/grpc/types.go index 843a2ee..cdb69aa 100644 --- a/refs/grpc/types.go +++ b/refs/grpc/types.go @@ -25,8 +25,8 @@ func (x *Address) SetObjectId(v *ObjectID) { x.ObjectId = v } -// SetChecksumType in generic checksum structure. -func (x *Checksum) SetChecksumType(v ChecksumType) { +// SetType in generic checksum structure. +func (x *Checksum) SetType(v ChecksumType) { x.Type = v } diff --git a/session/convert.go b/session/convert.go index 870e208..bbfe070 100644 --- a/session/convert.go +++ b/session/convert.go @@ -383,7 +383,7 @@ func (r *RequestMetaHeader) ToGRPCMessage() grpc.Message { m.SetEpoch(r.epoch) m.SetTtl(r.ttl) m.SetOrigin(r.origin.ToGRPCMessage().(*session.RequestMetaHeader)) - m.SetNetworkMagic(r.netMagic) + m.SetMagicNumber(r.netMagic) } return m @@ -674,7 +674,10 @@ func (c *ObjectSessionContext) ToGRPCMessage() grpc.Message { m = new(session.ObjectSessionContext) m.SetVerb(ObjectSessionVerbToGRPCField(c.verb)) - m.SetTarget(c.cnr.ToGRPCMessage().(*refsGRPC.ContainerID), refs.ObjectIDListToGRPCMessage(c.objs)) + m.SetTarget(&session.ObjectSessionContext_Target{ + Container: c.cnr.ToGRPCMessage().(*refsGRPC.ContainerID), + Objects: refs.ObjectIDListToGRPCMessage(c.objs), + }) } return m @@ -724,9 +727,9 @@ func (t *TokenBody) ToGRPCMessage() grpc.Message { case nil: m.Context = nil case *ObjectSessionContext: - m.SetObjectSessionContext(typ.ToGRPCMessage().(*session.ObjectSessionContext)) + m.SetObject(typ.ToGRPCMessage().(*session.ObjectSessionContext)) case *ContainerSessionContext: - m.SetContainerSessionContext(typ.ToGRPCMessage().(*session.ContainerSessionContext)) + m.SetContainer(typ.ToGRPCMessage().(*session.ContainerSessionContext)) } m.SetOwnerId(t.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) diff --git a/session/grpc/types.go b/session/grpc/types.go index bcc92d1..857c45e 100644 --- a/session/grpc/types.go +++ b/session/grpc/types.go @@ -52,25 +52,22 @@ func (m *SessionToken_Body) SetSessionKey(v []byte) { } // SetObjectAddressContext sets object context of the session token. -func (m *SessionToken_Body) SetObjectSessionContext(v *ObjectSessionContext) { +func (m *SessionToken_Body) SetObject(v *ObjectSessionContext) { m.Context = &SessionToken_Body_Object{ Object: v, } } -// SetContainerSessionContext sets container context of the session token. -func (m *SessionToken_Body) SetContainerSessionContext(v *ContainerSessionContext) { +// SetContainer sets container context of the session token. +func (m *SessionToken_Body) SetContainer(v *ContainerSessionContext) { m.Context = &SessionToken_Body_Container{ Container: v, } } // SetTarget specifies objects involved in the object session. -func (m *ObjectSessionContext) SetTarget(cnr *refs.ContainerID, objs []*refs.ObjectID) { - m.Target = &ObjectSessionContext_Target{ - Container: cnr, - Objects: objs, - } +func (m *ObjectSessionContext) SetTarget(tgt *ObjectSessionContext_Target) { + m.Target = tgt } // SetVerb sets type of request for which the token is issued. @@ -147,8 +144,8 @@ func (m *RequestMetaHeader) GetNetworkMagic() uint64 { return 0 } -// SetNetworkMagic sets NeoFS network magic. -func (m *RequestMetaHeader) SetNetworkMagic(v uint64) { +// SetMagicNumber sets NeoFS network magic. +func (m *RequestMetaHeader) SetMagicNumber(v uint64) { m.MagicNumber = v } From b171364079c3dc85db4a4e737232419055f20404 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 6 May 2024 14:28:49 +0300 Subject: [PATCH 096/169] [#81] rpc: Fix apemanager rpc service name * Introduce `frostfsServiceNamePrefix` for rpc interface since `apemanager` uses `frostfs` root instead `neo.fs`. Signed-off-by: Airat Arifullin --- rpc/apemanager.go | 2 +- rpc/common.go | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rpc/apemanager.go b/rpc/apemanager.go index 3f3d6cd..2a89c85 100644 --- a/rpc/apemanager.go +++ b/rpc/apemanager.go @@ -6,7 +6,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common" ) -const serviceAPEManager = serviceNamePrefix + "apemanager.APEManagerService" +const serviceAPEManager = frostfsServiceNamePrefix + "apemanager.APEManagerService" const ( rpcAPEManagerAddChain = "AddChain" diff --git a/rpc/common.go b/rpc/common.go index 7d0bf56..8177694 100644 --- a/rpc/common.go +++ b/rpc/common.go @@ -1,3 +1,10 @@ package rpc -const serviceNamePrefix = "neo.fs.v2." +const ( + // serviceNamePrefix is still used in "old" services but should be + // considered as deprecated. Since new services use "frostfs" root, + // `frostfsServiceNamePrefix` must be used for their rpc interface. + serviceNamePrefix = "neo.fs.v2." + + frostfsServiceNamePrefix = "frostfs.v2." +) From bc7b49eed23af4b5147745374bc1d9c94630440e Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 8 May 2024 15:03:29 +0300 Subject: [PATCH 097/169] [#82] object: Introduce new fields for EC header * Regenerate protobufs as frostfs-api introduced `parent_split_id` and `parent_split_index` fields. * Fix marshaller and converter for EC header. * Extend v2 type `ECHeader` with `ParentSplitID` and `ParentSplitIndex` fields. * Fix message_test for `Object`. Also generate EC headers and check it. Signed-off-by: Airat Arifullin --- object/convert.go | 4 ++ object/grpc/service.pb.go | 3 + object/grpc/types.pb.go | 127 +++++++++++++++++++++++--------------- object/marshal.go | 8 ++- object/message_test.go | 4 +- object/test/generate.go | 44 +++++++++---- object/types.go | 14 +++-- 7 files changed, 133 insertions(+), 71 deletions(-) diff --git a/object/convert.go b/object/convert.go index f19cc09..5b4acda 100644 --- a/object/convert.go +++ b/object/convert.go @@ -269,6 +269,8 @@ func (h *ECHeader) ToGRPCMessage() grpc.Message { m = new(object.Header_EC) m.Parent = h.Parent.ToGRPCMessage().(*refsGRPC.ObjectID) + m.ParentSplitId = h.ParentSplitID + m.ParentSplitIndex = h.ParentSplitIndex m.Index = h.Index m.Total = h.Total m.Header = h.Header @@ -300,6 +302,8 @@ func (h *ECHeader) FromGRPCMessage(m grpc.Message) error { } } + h.ParentSplitID = v.GetParentSplitId() + h.ParentSplitIndex = v.GetParentSplitIndex() h.Index = v.GetIndex() h.Total = v.GetTotal() h.Header = v.GetHeader() diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index 2bfb50b..75d359e 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -2113,6 +2113,9 @@ func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { // object_id of parent // - $Object:split.splitID \ // 16 byte UUIDv4 used to identify the split object hierarchy parts +// - $Object:ec.parent \ +// If the object is stored according to EC policy, then ec_parent attribute +// is set to return an id list of all related EC chunks. // // There are some well-known filter aliases to match objects by certain // properties: diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 8f4f383..254e76d 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -823,6 +823,12 @@ type Header_EC struct { HeaderLength uint32 `protobuf:"varint,4,opt,name=header_length,json=headerLength,proto3" json:"header_length,omitempty"` // Chunk of a parent header. Header []byte `protobuf:"bytes,5,opt,name=header,proto3" json:"header,omitempty"` + // As the origin object is EC-splitted its identifier is known to all + // chunks as parent. But parent itself can be a part of Split (does not relate to EC-split). + // In this case parent_split_id should be set. + ParentSplitId []byte `protobuf:"bytes,6,opt,name=parent_split_id,json=parentSplitID,proto3" json:"parent_split_id,omitempty"` + // Parent's index in Split. + ParentSplitIndex uint32 `protobuf:"varint,7,opt,name=parent_split_index,json=parentSplitIndex,proto3" json:"parent_split_index,omitempty"` } func (x *Header_EC) Reset() { @@ -892,6 +898,20 @@ func (x *Header_EC) GetHeader() []byte { return nil } +func (x *Header_EC) GetParentSplitId() []byte { + if x != nil { + return x.ParentSplitId + } + return nil +} + +func (x *Header_EC) GetParentSplitIndex() uint32 { + if x != nil { + return x.ParentSplitIndex + } + return 0 +} + type ECInfo_Chunk struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -991,7 +1011,7 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x52, 0x0f, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x48, 0x61, - 0x73, 0x68, 0x22, 0xca, 0x09, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, + 0x73, 0x68, 0x22, 0xa0, 0x0a, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 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, @@ -1057,7 +1077,7 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x1a, 0x9f, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x1a, 0xf5, 0x01, 0x0a, 0x02, 0x45, 0x43, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, @@ -1067,56 +1087,61 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, - 0xc4, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, - 0x44, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, - 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x09, 0x53, 0x70, 0x6c, 0x69, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x64, 0x12, - 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x26, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xc4, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8b, 0x01, 0x0a, + 0x09, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, + 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, + 0x6c, 0x69, 0x74, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x61, + 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x49, 0x44, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x04, + 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x49, 0x44, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x9f, 0x01, 0x0a, 0x06, 0x45, + 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x1a, 0x5d, 0x0a, + 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, - 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6c, 0x61, - 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x04, - 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x9f, 0x01, 0x0a, 0x06, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x36, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, - 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x1a, 0x5d, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, - 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2a, 0x32, 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, - 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, 0x42, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, - 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, 0x2a, 0x73, 0x0a, 0x09, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, - 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, - 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, - 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, - 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, - 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, - 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, - 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, - 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2a, 0x32, 0x0a, 0x0a, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, + 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, 0x42, 0x53, + 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, + 0x2a, 0x73, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, + 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, + 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, + 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, + 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, + 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, + 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, + 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, + 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, + 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, + 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, + 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/object/marshal.go b/object/marshal.go index a8d399c..fa2de95 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -31,6 +31,8 @@ const ( ecHdrTotalField = 3 ecHdrHeaderLengthField = 4 ecHdrHeaderField = 5 + ecHdrParentSplitID = 6 + ecHdrParentSplitIndex = 7 hdrVersionField = 1 hdrContainerIDField = 2 @@ -260,7 +262,9 @@ func (h *ECHeader) StableMarshal(buf []byte) []byte { offset += proto.UInt32Marshal(ecHdrIndexField, buf[offset:], h.Index) offset += proto.UInt32Marshal(ecHdrTotalField, buf[offset:], h.Total) offset += proto.UInt32Marshal(ecHdrHeaderLengthField, buf[offset:], h.HeaderLength) - proto.BytesMarshal(ecHdrHeaderField, buf[offset:], h.Header) + offset += proto.BytesMarshal(ecHdrHeaderField, buf[offset:], h.Header) + offset += proto.BytesMarshal(ecHdrParentSplitID, buf[offset:], h.ParentSplitID) + proto.UInt32Marshal(ecHdrParentSplitIndex, buf[offset:], h.ParentSplitIndex) return buf } @@ -274,6 +278,8 @@ func (h *ECHeader) StableSize() (size int) { size += proto.UInt32Size(ecHdrTotalField, h.Total) size += proto.UInt32Size(ecHdrHeaderLengthField, h.HeaderLength) size += proto.BytesSize(ecHdrHeaderField, h.Header) + size += proto.BytesSize(ecHdrParentSplitID, h.ParentSplitID) + size += proto.UInt32Size(ecHdrParentSplitIndex, h.ParentSplitIndex) return size } diff --git a/object/message_test.go b/object/message_test.go index e675f49..749c373 100644 --- a/object/message_test.go +++ b/object/message_test.go @@ -13,7 +13,9 @@ func TestMessageConvert(t *testing.T) { func(empty bool) message.Message { return objecttest.GenerateShortHeader(empty) }, func(empty bool) message.Message { return objecttest.GenerateAttribute(empty) }, func(empty bool) message.Message { return objecttest.GenerateSplitHeader(empty) }, - func(empty bool) message.Message { return objecttest.GenerateHeader(empty) }, + func(empty bool) message.Message { return objecttest.GenerateHeaderWithSplitHeader(empty) }, + func(empty bool) message.Message { return objecttest.GenerateHeaderWithECHeader(empty) }, + func(empty bool) message.Message { return objecttest.GenerateECHeader(empty) }, func(empty bool) message.Message { return objecttest.GenerateObject(empty) }, func(empty bool) message.Message { return objecttest.GenerateSplitInfo(empty) }, func(empty bool) message.Message { return objecttest.GenerateECInfo(empty) }, diff --git a/object/test/generate.go b/object/test/generate.go index b107023..bb774cc 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -68,17 +68,41 @@ func generateSplitHeader(empty, withPar bool) *object.SplitHeader { m.SetParentSignature(refstest.GenerateSignature(empty)) if withPar { - m.SetParentHeader(generateHeader(empty, false)) + m.SetParentHeader(GenerateHeaderWithSplitHeader(empty)) } return m } -func GenerateHeader(empty bool) *object.Header { - return generateHeader(empty, true) +func GenerateHeaderWithSplitHeader(empty bool) *object.Header { + m := generateHeader(empty) + m.SetSplit(generateSplitHeader(empty, false)) + return m } -func generateHeader(empty, withSplit bool) *object.Header { +func GenerateHeaderWithECHeader(empty bool) *object.Header { + m := generateHeader(empty) + m.SetEC(GenerateECHeader(empty)) + return m +} + +func GenerateECHeader(empty bool) *object.ECHeader { + ech := new(object.ECHeader) + + if !empty { + ech.Parent = refstest.GenerateObjectID(empty) + ech.ParentSplitID = []byte{1, 2, 3} + ech.ParentSplitIndex = 1 + ech.Index = 0 + ech.Total = 2 + ech.Header = []byte("chunk of ec-encoded parent header") + ech.HeaderLength = uint32(2 * len(ech.Header)) + } + + return ech +} + +func generateHeader(empty bool) *object.Header { m := new(object.Header) if !empty { @@ -95,10 +119,6 @@ func generateHeader(empty, withSplit bool) *object.Header { m.SetHomomorphicHash(refstest.GenerateChecksum(empty)) m.SetSessionToken(sessiontest.GenerateSessionToken(empty)) - if withSplit { - m.SetSplit(generateSplitHeader(empty, false)) - } - return m } @@ -106,7 +126,7 @@ func GenerateHeaderWithSignature(empty bool) *object.HeaderWithSignature { m := new(object.HeaderWithSignature) m.SetSignature(refstest.GenerateSignature(empty)) - m.SetHeader(GenerateHeader(empty)) + m.SetHeader(GenerateHeaderWithSplitHeader(empty)) return m } @@ -120,7 +140,7 @@ func GenerateObject(empty bool) *object.Object { } m.SetSignature(refstest.GenerateSignature(empty)) - m.SetHeader(GenerateHeader(empty)) + m.SetHeader(GenerateHeaderWithSplitHeader(empty)) return m } @@ -194,7 +214,7 @@ func GenerateGetObjectPartInit(empty bool) *object.GetObjectPartInit { } m.SetSignature(refstest.GenerateSignature(empty)) - m.SetHeader(GenerateHeader(empty)) + m.SetHeader(GenerateHeaderWithSplitHeader(empty)) return m } @@ -248,7 +268,7 @@ func GeneratePutObjectPartInit(empty bool) *object.PutObjectPartInit { } m.SetSignature(refstest.GenerateSignature(empty)) - m.SetHeader(GenerateHeader(empty)) + m.SetHeader(GenerateHeaderWithSplitHeader(empty)) return m } diff --git a/object/types.go b/object/types.go index 4588f13..78c8d43 100644 --- a/object/types.go +++ b/object/types.go @@ -40,12 +40,14 @@ type SplitHeader struct { } type ECHeader struct { - Parent *refs.ObjectID - Index uint32 - Total uint32 - Header []byte - HeaderLength uint32 - Signature []byte + Parent *refs.ObjectID + ParentSplitID []byte + ParentSplitIndex uint32 + Index uint32 + Total uint32 + Header []byte + HeaderLength uint32 + Signature []byte } type Header struct { From 063ce11c243636d1a8a5d8803c3dd7e9568ce3d7 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 8 May 2024 15:07:13 +0300 Subject: [PATCH 098/169] [#82] object: Erase field `Signature` from `ECHeader` v2 type * The field `Signature` is not used and should be factored out. Signed-off-by: Airat Arifullin --- object/types.go | 1 - 1 file changed, 1 deletion(-) diff --git a/object/types.go b/object/types.go index 78c8d43..c9a0519 100644 --- a/object/types.go +++ b/object/types.go @@ -47,7 +47,6 @@ type ECHeader struct { Total uint32 Header []byte HeaderLength uint32 - Signature []byte } type Header struct { From 4fe42ac4add113eb1c634fe7668a1f3c1a5d9137 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 13 May 2024 17:03:55 +0300 Subject: [PATCH 099/169] [#82] object: Add `FilterHeaderECParent` filter for v2 * `FilterHeaderECParent` is used by `Object.Search` Signed-off-by: Airat Arifullin --- object/filters.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/object/filters.go b/object/filters.go index 5eee13b..9fe024d 100644 --- a/object/filters.go +++ b/object/filters.go @@ -36,6 +36,9 @@ const ( // FilterHeaderSplitID is a filter key to "split.splitID" field of the object header. FilterHeaderSplitID = ReservedFilterPrefix + "split.splitID" + + // FilterHeaderECParent is a filter key to "ec.parent" field of the object header. + FilterHeaderECParent = ReservedFilterPrefix + "ec.parent" ) const ( From 0803bc6ded0097443d626c20a4d399cea7ef8868 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Thu, 16 May 2024 12:03:42 +0300 Subject: [PATCH 100/169] [#83] object: Regenerate protobufs for `ECHeader` * Fix marshalers and converters; * Fix unit-tests. Signed-off-by: Airat Arifullin --- object/convert.go | 18 +++++- object/grpc/types.pb.go | 134 +++++++++++++++++++++------------------- object/marshal.go | 18 +++--- object/test/generate.go | 2 +- object/types.go | 14 ++--- 5 files changed, 103 insertions(+), 83 deletions(-) diff --git a/object/convert.go b/object/convert.go index 5b4acda..99047dc 100644 --- a/object/convert.go +++ b/object/convert.go @@ -270,7 +270,7 @@ func (h *ECHeader) ToGRPCMessage() grpc.Message { m.Parent = h.Parent.ToGRPCMessage().(*refsGRPC.ObjectID) m.ParentSplitId = h.ParentSplitID - m.ParentSplitIndex = h.ParentSplitIndex + m.ParentSplitParentId = h.ParentSplitParentID.ToGRPCMessage().(*refsGRPC.ObjectID) m.Index = h.Index m.Total = h.Total m.Header = h.Header @@ -303,7 +303,21 @@ func (h *ECHeader) FromGRPCMessage(m grpc.Message) error { } h.ParentSplitID = v.GetParentSplitId() - h.ParentSplitIndex = v.GetParentSplitIndex() + + parSplitParentID := v.GetParentSplitParentId() + if parSplitParentID == nil { + h.ParentSplitParentID = nil + } else { + if h.ParentSplitParentID == nil { + h.ParentSplitParentID = new(refs.ObjectID) + } + + err = h.ParentSplitParentID.FromGRPCMessage(parSplitParentID) + if err != nil { + return err + } + } + h.Index = v.GetIndex() h.Total = v.GetTotal() h.Header = v.GetHeader() diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 254e76d..3cb44a3 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -827,8 +827,10 @@ type Header_EC struct { // chunks as parent. But parent itself can be a part of Split (does not relate to EC-split). // In this case parent_split_id should be set. ParentSplitId []byte `protobuf:"bytes,6,opt,name=parent_split_id,json=parentSplitID,proto3" json:"parent_split_id,omitempty"` - // Parent's index in Split. - ParentSplitIndex uint32 `protobuf:"varint,7,opt,name=parent_split_index,json=parentSplitIndex,proto3" json:"parent_split_index,omitempty"` + // EC-parent's parent ID. parent_split_parent_id is set if EC-parent, itself, is a part of Split and + // if an object ID of its parent is presented. The field allows to determine how EC-chunk is placed + // in Split hierarchy. + ParentSplitParentId *grpc.ObjectID `protobuf:"bytes,7,opt,name=parent_split_parent_id,json=parentSplitParentID,proto3" json:"parent_split_parent_id,omitempty"` } func (x *Header_EC) Reset() { @@ -905,11 +907,11 @@ func (x *Header_EC) GetParentSplitId() []byte { return nil } -func (x *Header_EC) GetParentSplitIndex() uint32 { +func (x *Header_EC) GetParentSplitParentId() *grpc.ObjectID { if x != nil { - return x.ParentSplitIndex + return x.ParentSplitParentId } - return 0 + return nil } type ECInfo_Chunk struct { @@ -1011,7 +1013,7 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x52, 0x0f, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x48, 0x61, - 0x73, 0x68, 0x22, 0xa0, 0x0a, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, + 0x73, 0x68, 0x22, 0xc1, 0x0a, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 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, @@ -1077,7 +1079,7 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x1a, 0xf5, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x1a, 0x96, 0x02, 0x0a, 0x02, 0x45, 0x43, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, @@ -1090,58 +1092,61 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xc4, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x12, 0x4d, 0x0a, 0x16, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, + 0x44, 0x52, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x22, 0xc4, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8b, 0x01, + 0x0a, 0x09, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x73, + 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, + 0x70, 0x6c, 0x69, 0x74, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, + 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x49, 0x44, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, + 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x9f, 0x01, 0x0a, 0x06, + 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, + 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x1a, 0x5d, + 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8b, 0x01, 0x0a, - 0x09, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, - 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, - 0x6c, 0x69, 0x74, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x61, - 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x49, 0x44, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x04, - 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x49, 0x44, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x9f, 0x01, 0x0a, 0x06, 0x45, - 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x2e, - 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x1a, 0x5d, 0x0a, - 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, - 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2a, 0x32, 0x0a, 0x0a, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, - 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, 0x42, 0x53, - 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, - 0x2a, 0x73, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, - 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, - 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, - 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, - 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x54, - 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, - 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, - 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, - 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, - 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, - 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, - 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2a, 0x32, 0x0a, + 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, + 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, 0x42, + 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, 0x10, + 0x03, 0x2a, 0x73, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, + 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, + 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, + 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, + 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, + 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, + 0x45, 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, + 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, + 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, + 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1206,12 +1211,13 @@ var file_object_grpc_types_proto_depIdxs = []int32{ 3, // 24: neo.fs.v2.object.Header.Split.parent_header:type_name -> neo.fs.v2.object.Header 16, // 25: neo.fs.v2.object.Header.Split.children:type_name -> neo.fs.v2.refs.ObjectID 16, // 26: neo.fs.v2.object.Header.EC.parent:type_name -> neo.fs.v2.refs.ObjectID - 16, // 27: neo.fs.v2.object.ECInfo.Chunk.id:type_name -> neo.fs.v2.refs.ObjectID - 28, // [28:28] is the sub-list for method output_type - 28, // [28:28] is the sub-list for method input_type - 28, // [28:28] is the sub-list for extension type_name - 28, // [28:28] is the sub-list for extension extendee - 0, // [0:28] is the sub-list for field type_name + 16, // 27: neo.fs.v2.object.Header.EC.parent_split_parent_id:type_name -> neo.fs.v2.refs.ObjectID + 16, // 28: neo.fs.v2.object.ECInfo.Chunk.id:type_name -> neo.fs.v2.refs.ObjectID + 29, // [29:29] is the sub-list for method output_type + 29, // [29:29] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name } func init() { file_object_grpc_types_proto_init() } diff --git a/object/marshal.go b/object/marshal.go index fa2de95..bf8fcb9 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -26,13 +26,13 @@ const ( splitHdrChildrenField = 5 splitHdrSplitIDField = 6 - ecHdrParentField = 1 - ecHdrIndexField = 2 - ecHdrTotalField = 3 - ecHdrHeaderLengthField = 4 - ecHdrHeaderField = 5 - ecHdrParentSplitID = 6 - ecHdrParentSplitIndex = 7 + ecHdrParentField = 1 + ecHdrIndexField = 2 + ecHdrTotalField = 3 + ecHdrHeaderLengthField = 4 + ecHdrHeaderField = 5 + ecHdrParentSplitID = 6 + ecHdrParentSplitParentID = 7 hdrVersionField = 1 hdrContainerIDField = 2 @@ -264,7 +264,7 @@ func (h *ECHeader) StableMarshal(buf []byte) []byte { offset += proto.UInt32Marshal(ecHdrHeaderLengthField, buf[offset:], h.HeaderLength) offset += proto.BytesMarshal(ecHdrHeaderField, buf[offset:], h.Header) offset += proto.BytesMarshal(ecHdrParentSplitID, buf[offset:], h.ParentSplitID) - proto.UInt32Marshal(ecHdrParentSplitIndex, buf[offset:], h.ParentSplitIndex) + proto.NestedStructureMarshal(ecHdrParentSplitParentID, buf[offset:], h.ParentSplitParentID) return buf } @@ -279,7 +279,7 @@ func (h *ECHeader) StableSize() (size int) { size += proto.UInt32Size(ecHdrHeaderLengthField, h.HeaderLength) size += proto.BytesSize(ecHdrHeaderField, h.Header) size += proto.BytesSize(ecHdrParentSplitID, h.ParentSplitID) - size += proto.UInt32Size(ecHdrParentSplitIndex, h.ParentSplitIndex) + size += proto.NestedStructureSize(ecHdrParentSplitParentID, h.ParentSplitParentID) return size } diff --git a/object/test/generate.go b/object/test/generate.go index bb774cc..95c76e5 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -92,7 +92,7 @@ func GenerateECHeader(empty bool) *object.ECHeader { if !empty { ech.Parent = refstest.GenerateObjectID(empty) ech.ParentSplitID = []byte{1, 2, 3} - ech.ParentSplitIndex = 1 + ech.ParentSplitParentID = refstest.GenerateObjectID(empty) ech.Index = 0 ech.Total = 2 ech.Header = []byte("chunk of ec-encoded parent header") diff --git a/object/types.go b/object/types.go index c9a0519..7916b1e 100644 --- a/object/types.go +++ b/object/types.go @@ -40,13 +40,13 @@ type SplitHeader struct { } type ECHeader struct { - Parent *refs.ObjectID - ParentSplitID []byte - ParentSplitIndex uint32 - Index uint32 - Total uint32 - Header []byte - HeaderLength uint32 + Parent *refs.ObjectID + ParentSplitID []byte + ParentSplitParentID *refs.ObjectID + Index uint32 + Total uint32 + Header []byte + HeaderLength uint32 } type Header struct { From 9789b79b1d779d478586cb722955e61bc08b705d Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 28 May 2024 11:04:07 +0300 Subject: [PATCH 101/169] [#85] apemanager: Generate protobufs for `ape` package * Regenerate protobufs as APE specific type are defined as separate package; * Move `ape` package related utils methods from `apemanager`. Signed-off-by: Airat Arifullin --- ape/convert.go | 132 ++++++++++++ {apemanager => ape}/grpc/types.go | 2 +- {apemanager => ape}/grpc/types.pb.go | 128 ++++++----- {apemanager => ape}/json.go | 6 +- ape/marshal.go | 92 ++++++++ ape/message_test.go | 15 ++ {apemanager => ape}/string.go | 6 +- ape/test/generate.go | 71 ++++++ ape/types.go | 71 ++++++ apemanager/convert.go | 151 ++----------- apemanager/grpc/service.go | 37 ++-- apemanager/grpc/service.pb.go | 312 +++++++++++++-------------- apemanager/marshal.go | 83 ------- apemanager/message_test.go | 1 - apemanager/test/generate.go | 77 +------ apemanager/types.go | 101 ++------- 16 files changed, 661 insertions(+), 624 deletions(-) create mode 100644 ape/convert.go rename {apemanager => ape}/grpc/types.go (94%) rename {apemanager => ape}/grpc/types.pb.go (51%) rename {apemanager => ape}/json.go (56%) create mode 100644 ape/marshal.go create mode 100644 ape/message_test.go rename {apemanager => ape}/string.go (56%) create mode 100644 ape/test/generate.go create mode 100644 ape/types.go diff --git a/ape/convert.go b/ape/convert.go new file mode 100644 index 0000000..c1dadd5 --- /dev/null +++ b/ape/convert.go @@ -0,0 +1,132 @@ +package ape + +import ( + "fmt" + + ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" +) + +func TargetTypeToGRPCField(typ TargetType) ape.TargetType { + switch typ { + case TargetTypeNamespace: + return ape.TargetType_NAMESPACE + case TargetTypeContainer: + return ape.TargetType_CONTAINER + case TargetTypeUser: + return ape.TargetType_USER + case TargetTypeGroup: + return ape.TargetType_GROUP + default: + return ape.TargetType_UNDEFINED + } +} + +func TargetTypeFromGRPCField(typ ape.TargetType) TargetType { + switch typ { + case ape.TargetType_NAMESPACE: + return TargetTypeNamespace + case ape.TargetType_CONTAINER: + return TargetTypeContainer + case ape.TargetType_USER: + return TargetTypeUser + case ape.TargetType_GROUP: + return TargetTypeGroup + default: + return TargetTypeUndefined + } +} + +func TargetTypeToGRPC(typ TargetType) ape.TargetType { + return ape.TargetType(typ) +} + +func TargetTypeFromGRPC(typ ape.TargetType) TargetType { + return TargetType(typ) +} + +func (v2 *ChainTarget) ToGRPCMessage() grpc.Message { + var mgrpc *ape.ChainTarget + + if v2 != nil { + mgrpc = new(ape.ChainTarget) + + mgrpc.SetType(TargetTypeToGRPC(v2.GetTargetType())) + mgrpc.SetName(v2.GetName()) + } + + return mgrpc +} + +func (v2 *ChainTarget) FromGRPCMessage(m grpc.Message) error { + mgrpc, ok := m.(*ape.ChainTarget) + if !ok { + return message.NewUnexpectedMessageType(m, mgrpc) + } + + v2.SetTargetType(TargetTypeFromGRPC(mgrpc.GetType())) + v2.SetName(mgrpc.GetName()) + + return nil +} + +func (v2 *ChainRaw) ToGRPCMessage() grpc.Message { + var mgrpc *ape.Chain_Raw + + if v2 != nil { + mgrpc = new(ape.Chain_Raw) + + mgrpc.SetRaw(v2.GetRaw()) + } + + return mgrpc +} + +func (v2 *ChainRaw) FromGRPCMessage(m grpc.Message) error { + mgrpc, ok := m.(*ape.Chain_Raw) + if !ok { + return message.NewUnexpectedMessageType(m, mgrpc) + } + + v2.SetRaw(mgrpc.GetRaw()) + + return nil +} + +func (v2 *Chain) ToGRPCMessage() grpc.Message { + var mgrpc *ape.Chain + + if v2 != nil { + mgrpc = new(ape.Chain) + + switch chainKind := v2.GetKind().(type) { + default: + panic(fmt.Sprintf("unsupported chain kind: %T", chainKind)) + case *ChainRaw: + mgrpc.SetKind(chainKind.ToGRPCMessage().(*ape.Chain_Raw)) + } + } + + return mgrpc +} + +func (v2 *Chain) FromGRPCMessage(m grpc.Message) error { + mgrpc, ok := m.(*ape.Chain) + if !ok { + return message.NewUnexpectedMessageType(m, mgrpc) + } + + switch chainKind := mgrpc.GetKind().(type) { + default: + return fmt.Errorf("unsupported chain kind: %T", chainKind) + case *ape.Chain_Raw: + chainRaw := new(ChainRaw) + if err := chainRaw.FromGRPCMessage(chainKind); err != nil { + return err + } + v2.SetKind(chainRaw) + } + + return nil +} diff --git a/apemanager/grpc/types.go b/ape/grpc/types.go similarity index 94% rename from apemanager/grpc/types.go rename to ape/grpc/types.go index 0f2ebb2..931b6a3 100644 --- a/apemanager/grpc/types.go +++ b/ape/grpc/types.go @@ -1,4 +1,4 @@ -package apemanager +package ape func (t *ChainTarget) SetType(typ TargetType) { t.Type = typ diff --git a/apemanager/grpc/types.pb.go b/ape/grpc/types.pb.go similarity index 51% rename from apemanager/grpc/types.pb.go rename to ape/grpc/types.pb.go index 395857a..1da2110 100644 --- a/apemanager/grpc/types.pb.go +++ b/ape/grpc/types.pb.go @@ -2,9 +2,9 @@ // versions: // protoc-gen-go v1.33.0 // protoc v4.25.3 -// source: apemanager/grpc/types.proto +// source: ape/grpc/types.proto -package apemanager +package ape import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -60,11 +60,11 @@ func (x TargetType) String() string { } func (TargetType) Descriptor() protoreflect.EnumDescriptor { - return file_apemanager_grpc_types_proto_enumTypes[0].Descriptor() + return file_ape_grpc_types_proto_enumTypes[0].Descriptor() } func (TargetType) Type() protoreflect.EnumType { - return &file_apemanager_grpc_types_proto_enumTypes[0] + return &file_ape_grpc_types_proto_enumTypes[0] } func (x TargetType) Number() protoreflect.EnumNumber { @@ -73,7 +73,7 @@ func (x TargetType) Number() protoreflect.EnumNumber { // Deprecated: Use TargetType.Descriptor instead. func (TargetType) EnumDescriptor() ([]byte, []int) { - return file_apemanager_grpc_types_proto_rawDescGZIP(), []int{0} + return file_ape_grpc_types_proto_rawDescGZIP(), []int{0} } // ChainTarget is an object to which a rule chain is defined. @@ -82,14 +82,14 @@ type ChainTarget struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type TargetType `protobuf:"varint,1,opt,name=type,proto3,enum=frostfs.v2.apemanager.TargetType" json:"type,omitempty"` + Type TargetType `protobuf:"varint,1,opt,name=type,proto3,enum=frostfs.v2.ape.TargetType" json:"type,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` } func (x *ChainTarget) Reset() { *x = ChainTarget{} if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_types_proto_msgTypes[0] + mi := &file_ape_grpc_types_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -102,7 +102,7 @@ func (x *ChainTarget) String() string { func (*ChainTarget) ProtoMessage() {} func (x *ChainTarget) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_types_proto_msgTypes[0] + mi := &file_ape_grpc_types_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -115,7 +115,7 @@ func (x *ChainTarget) ProtoReflect() protoreflect.Message { // Deprecated: Use ChainTarget.ProtoReflect.Descriptor instead. func (*ChainTarget) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_types_proto_rawDescGZIP(), []int{0} + return file_ape_grpc_types_proto_rawDescGZIP(), []int{0} } func (x *ChainTarget) GetType() TargetType { @@ -147,7 +147,7 @@ type Chain struct { func (x *Chain) Reset() { *x = Chain{} if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_types_proto_msgTypes[1] + mi := &file_ape_grpc_types_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -160,7 +160,7 @@ func (x *Chain) String() string { func (*Chain) ProtoMessage() {} func (x *Chain) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_types_proto_msgTypes[1] + mi := &file_ape_grpc_types_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -173,7 +173,7 @@ func (x *Chain) ProtoReflect() protoreflect.Message { // Deprecated: Use Chain.ProtoReflect.Descriptor instead. func (*Chain) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_types_proto_rawDescGZIP(), []int{1} + return file_ape_grpc_types_proto_rawDescGZIP(), []int{1} } func (m *Chain) GetKind() isChain_Kind { @@ -201,54 +201,52 @@ type Chain_Raw struct { func (*Chain_Raw) isChain_Kind() {} -var File_apemanager_grpc_types_proto protoreflect.FileDescriptor +var File_ape_grpc_types_proto protoreflect.FileDescriptor -var file_apemanager_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x66, - 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x22, 0x58, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x21, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, - 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 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, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, - 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var file_ape_grpc_types_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x22, 0x51, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x70, 0x65, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x23, 0x0a, 0x05, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, + 0x00, 0x52, 0x03, 0x72, 0x61, 0x77, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x2a, 0x4e, + 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, + 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e, + 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, + 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, + 0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x04, 0x42, 0x3e, + 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, + 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, + 0x32, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x70, 0x65, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_apemanager_grpc_types_proto_rawDescOnce sync.Once - file_apemanager_grpc_types_proto_rawDescData = file_apemanager_grpc_types_proto_rawDesc + file_ape_grpc_types_proto_rawDescOnce sync.Once + file_ape_grpc_types_proto_rawDescData = file_ape_grpc_types_proto_rawDesc ) -func file_apemanager_grpc_types_proto_rawDescGZIP() []byte { - file_apemanager_grpc_types_proto_rawDescOnce.Do(func() { - file_apemanager_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_apemanager_grpc_types_proto_rawDescData) +func file_ape_grpc_types_proto_rawDescGZIP() []byte { + file_ape_grpc_types_proto_rawDescOnce.Do(func() { + file_ape_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_ape_grpc_types_proto_rawDescData) }) - return file_apemanager_grpc_types_proto_rawDescData + return file_ape_grpc_types_proto_rawDescData } -var file_apemanager_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_apemanager_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_apemanager_grpc_types_proto_goTypes = []interface{}{ - (TargetType)(0), // 0: frostfs.v2.apemanager.TargetType - (*ChainTarget)(nil), // 1: frostfs.v2.apemanager.ChainTarget - (*Chain)(nil), // 2: frostfs.v2.apemanager.Chain +var file_ape_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_ape_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_ape_grpc_types_proto_goTypes = []interface{}{ + (TargetType)(0), // 0: frostfs.v2.ape.TargetType + (*ChainTarget)(nil), // 1: frostfs.v2.ape.ChainTarget + (*Chain)(nil), // 2: frostfs.v2.ape.Chain } -var file_apemanager_grpc_types_proto_depIdxs = []int32{ - 0, // 0: frostfs.v2.apemanager.ChainTarget.type:type_name -> frostfs.v2.apemanager.TargetType +var file_ape_grpc_types_proto_depIdxs = []int32{ + 0, // 0: frostfs.v2.ape.ChainTarget.type:type_name -> frostfs.v2.ape.TargetType 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -256,13 +254,13 @@ var file_apemanager_grpc_types_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_apemanager_grpc_types_proto_init() } -func file_apemanager_grpc_types_proto_init() { - if File_apemanager_grpc_types_proto != nil { +func init() { file_ape_grpc_types_proto_init() } +func file_ape_grpc_types_proto_init() { + if File_ape_grpc_types_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_apemanager_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_ape_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ChainTarget); i { case 0: return &v.state @@ -274,7 +272,7 @@ func file_apemanager_grpc_types_proto_init() { return nil } } - file_apemanager_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_ape_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Chain); i { case 0: return &v.state @@ -287,26 +285,26 @@ func file_apemanager_grpc_types_proto_init() { } } } - file_apemanager_grpc_types_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_ape_grpc_types_proto_msgTypes[1].OneofWrappers = []interface{}{ (*Chain_Raw)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_apemanager_grpc_types_proto_rawDesc, + RawDescriptor: file_ape_grpc_types_proto_rawDesc, NumEnums: 1, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_apemanager_grpc_types_proto_goTypes, - DependencyIndexes: file_apemanager_grpc_types_proto_depIdxs, - EnumInfos: file_apemanager_grpc_types_proto_enumTypes, - MessageInfos: file_apemanager_grpc_types_proto_msgTypes, + GoTypes: file_ape_grpc_types_proto_goTypes, + DependencyIndexes: file_ape_grpc_types_proto_depIdxs, + EnumInfos: file_ape_grpc_types_proto_enumTypes, + MessageInfos: file_ape_grpc_types_proto_msgTypes, }.Build() - File_apemanager_grpc_types_proto = out.File - file_apemanager_grpc_types_proto_rawDesc = nil - file_apemanager_grpc_types_proto_goTypes = nil - file_apemanager_grpc_types_proto_depIdxs = nil + File_ape_grpc_types_proto = out.File + file_ape_grpc_types_proto_rawDesc = nil + file_ape_grpc_types_proto_goTypes = nil + file_ape_grpc_types_proto_depIdxs = nil } diff --git a/apemanager/json.go b/ape/json.go similarity index 56% rename from apemanager/json.go rename to ape/json.go index 4f44d5e..9760f4e 100644 --- a/apemanager/json.go +++ b/ape/json.go @@ -1,7 +1,7 @@ -package apemanager +package ape import ( - apemanager_grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" + ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) @@ -10,5 +10,5 @@ func (t *ChainTarget) MarshalJSON() ([]byte, error) { } func (t *ChainTarget) UnmarshalJSON(data []byte) error { - return message.UnmarshalJSON(t, data, new(apemanager_grpc.ChainTarget)) + return message.UnmarshalJSON(t, data, new(ape.ChainTarget)) } diff --git a/ape/marshal.go b/ape/marshal.go new file mode 100644 index 0000000..9889261 --- /dev/null +++ b/ape/marshal.go @@ -0,0 +1,92 @@ +package ape + +import ( + "fmt" + + ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" +) + +const ( + chainTargetTargetTypeField = 1 + chainTargetNameField = 2 + + chainRawField = 1 +) + +func (t *ChainTarget) StableSize() (size int) { + if t == nil { + return 0 + } + + size += proto.EnumSize(chainTargetTargetTypeField, int32(t.targeType)) + size += proto.StringSize(chainTargetNameField, t.name) + + return size +} + +func (t *ChainTarget) StableMarshal(buf []byte) []byte { + if t == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, t.StableSize()) + } + + var offset int + + offset += proto.EnumMarshal(chainTargetTargetTypeField, buf[offset:], int32(t.targeType)) + proto.StringMarshal(chainTargetNameField, buf[offset:], t.name) + + return buf +} + +func (t *ChainTarget) Unmarshal(data []byte) error { + return message.Unmarshal(t, data, new(ape.ChainTarget)) +} + +func (c *Chain) StableSize() (size int) { + if c == nil { + return 0 + } + + switch v := c.GetKind().(type) { + case *ChainRaw: + if v != nil { + size += proto.BytesSize(chainRawField, v.GetRaw()) + } + default: + panic(fmt.Sprintf("unsupported chain kind: %T", v)) + } + + return size +} + +func (c *Chain) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + var offset int + + switch v := c.GetKind().(type) { + case *ChainRaw: + if v != nil { + proto.BytesMarshal(chainRawField, buf[offset:], v.GetRaw()) + } + default: + panic(fmt.Sprintf("unsupported chain kind: %T", v)) + } + + return buf +} + +func (c *Chain) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(ape.Chain)) +} diff --git a/ape/message_test.go b/ape/message_test.go new file mode 100644 index 0000000..636a521 --- /dev/null +++ b/ape/message_test.go @@ -0,0 +1,15 @@ +package ape_test + +import ( + "testing" + + apetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/test" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + messagetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message/test" +) + +func TestMessageConvert(t *testing.T) { + messagetest.TestRPCMessage(t, + func(empty bool) message.Message { return apetest.GenerateChainTarget(empty) }, + ) +} diff --git a/apemanager/string.go b/ape/string.go similarity index 56% rename from apemanager/string.go rename to ape/string.go index dddeede..2e2507e 100644 --- a/apemanager/string.go +++ b/ape/string.go @@ -1,7 +1,7 @@ -package apemanager +package ape import ( - apemanager_grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" + apegrpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" ) func (tt TargetType) String() string { @@ -9,7 +9,7 @@ func (tt TargetType) String() string { } func (tt *TargetType) FromString(s string) bool { - i, ok := apemanager_grpc.TargetType_value[s] + i, ok := apegrpc.TargetType_value[s] if ok { *tt = TargetType(i) } diff --git a/ape/test/generate.go b/ape/test/generate.go new file mode 100644 index 0000000..9caf9de --- /dev/null +++ b/ape/test/generate.go @@ -0,0 +1,71 @@ +package test + +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" +) + +func GenerateRawChains(empty bool, n int) []*ape.Chain { + if empty { + return []*ape.Chain{} + } + + res := make([]*ape.Chain, n) + for i := range res { + res[i] = GenerateRawChain(empty) + } + return res +} + +func GenerateRawChain(empty bool) *ape.Chain { + chRaw := new(ape.ChainRaw) + + if empty { + chRaw.SetRaw([]byte("{}")) + } else { + chRaw.SetRaw([]byte(`{ + "ID": "", + "Rules": [ + { + "Status": "Allow", + "Actions": { + "Inverted": false, + "Names": [ + "GetObject" + ] + }, + "Resources": { + "Inverted": false, + "Names": [ + "native:object/*" + ] + }, + "Any": false, + "Condition": [ + { + "Op": "StringEquals", + "Object": "Resource", + "Key": "Department", + "Value": "HR" + } + ] + } + ], + "MatchType": "DenyPriority" + }`)) + } + + ch := new(ape.Chain) + ch.SetKind(chRaw) + return ch +} + +func GenerateChainTarget(empty bool) *ape.ChainTarget { + m := new(ape.ChainTarget) + + if !empty { + m.SetTargetType(ape.TargetTypeContainer) + m.SetName("BzQw5HH3feoxFDD5tCT87Y1726qzgLfxEE7wgtoRzB3R") + } + + return m +} diff --git a/ape/types.go b/ape/types.go new file mode 100644 index 0000000..935a5ea --- /dev/null +++ b/ape/types.go @@ -0,0 +1,71 @@ +package ape + +type TargetType uint32 + +const ( + TargetTypeUndefined TargetType = iota + TargetTypeNamespace + TargetTypeContainer + TargetTypeUser + TargetTypeGroup +) + +type ChainTarget struct { + targeType TargetType + + name string +} + +func (ct *ChainTarget) SetTargetType(targeType TargetType) { + ct.targeType = targeType +} + +func (ct *ChainTarget) SetName(name string) { + ct.name = name +} + +func (ct *ChainTarget) GetTargetType() TargetType { + if ct != nil { + return ct.targeType + } + + return 0 +} + +func (ct *ChainTarget) GetName() string { + if ct != nil { + return ct.name + } + + return "" +} + +type chainKind interface { + isChainKind() +} + +type Chain struct { + kind chainKind +} + +func (c *Chain) SetKind(kind chainKind) { + c.kind = kind +} + +func (c *Chain) GetKind() chainKind { + return c.kind +} + +type ChainRaw struct { + Raw []byte +} + +func (*ChainRaw) isChainKind() {} + +func (c *ChainRaw) SetRaw(raw []byte) { + c.Raw = raw +} + +func (c *ChainRaw) GetRaw() []byte { + return c.Raw +} diff --git a/apemanager/convert.go b/apemanager/convert.go index f1cbcda..fdc5132 100644 --- a/apemanager/convert.go +++ b/apemanager/convert.go @@ -1,144 +1,21 @@ package apemanager import ( - "fmt" - + ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" + apeGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" apemanager "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" ) -func TargetTypeToGRPCField(typ TargetType) apemanager.TargetType { - switch typ { - case TargetTypeNamespace: - return apemanager.TargetType_NAMESPACE - case TargetTypeContainer: - return apemanager.TargetType_CONTAINER - case TargetTypeUser: - return apemanager.TargetType_USER - case TargetTypeGroup: - return apemanager.TargetType_GROUP - default: - return apemanager.TargetType_UNDEFINED - } -} - -func TargetTypeFromGRPCField(typ apemanager.TargetType) TargetType { - switch typ { - case apemanager.TargetType_NAMESPACE: - return TargetTypeNamespace - case apemanager.TargetType_CONTAINER: - return TargetTypeContainer - case apemanager.TargetType_USER: - return TargetTypeUser - case apemanager.TargetType_GROUP: - return TargetTypeGroup - default: - return TargetTypeUndefined - } -} - -func TargetTypeToGRPC(typ TargetType) apemanager.TargetType { - return apemanager.TargetType(typ) -} - -func TargetTypeFromGRPC(typ apemanager.TargetType) TargetType { - return TargetType(typ) -} - -func (v2 *ChainTarget) ToGRPCMessage() grpc.Message { - var mgrpc *apemanager.ChainTarget - - if v2 != nil { - mgrpc = new(apemanager.ChainTarget) - - mgrpc.SetType(TargetTypeToGRPC(v2.GetTargetType())) - mgrpc.SetName(v2.GetName()) - } - - return mgrpc -} - -func (v2 *ChainTarget) FromGRPCMessage(m grpc.Message) error { - mgrpc, ok := m.(*apemanager.ChainTarget) - if !ok { - return message.NewUnexpectedMessageType(m, mgrpc) - } - - v2.SetTargetType(TargetTypeFromGRPC(mgrpc.GetType())) - v2.SetName(mgrpc.GetName()) - - return nil -} - -func (v2 *ChainRaw) ToGRPCMessage() grpc.Message { - var mgrpc *apemanager.Chain_Raw - - if v2 != nil { - mgrpc = new(apemanager.Chain_Raw) - - mgrpc.SetRaw(v2.GetRaw()) - } - - return mgrpc -} - -func (v2 *ChainRaw) FromGRPCMessage(m grpc.Message) error { - mgrpc, ok := m.(*apemanager.Chain_Raw) - if !ok { - return message.NewUnexpectedMessageType(m, mgrpc) - } - - v2.SetRaw(mgrpc.GetRaw()) - - return nil -} - -func (v2 *Chain) ToGRPCMessage() grpc.Message { - var mgrpc *apemanager.Chain - - if v2 != nil { - mgrpc = new(apemanager.Chain) - - switch chainKind := v2.GetKind().(type) { - default: - panic(fmt.Sprintf("unsupported chain kind: %T", chainKind)) - case *ChainRaw: - mgrpc.SetKind(chainKind.ToGRPCMessage().(*apemanager.Chain_Raw)) - } - } - - return mgrpc -} - -func (v2 *Chain) FromGRPCMessage(m grpc.Message) error { - mgrpc, ok := m.(*apemanager.Chain) - if !ok { - return message.NewUnexpectedMessageType(m, mgrpc) - } - - switch chainKind := mgrpc.GetKind().(type) { - default: - return fmt.Errorf("unsupported chain kind: %T", chainKind) - case *apemanager.Chain_Raw: - chainRaw := new(ChainRaw) - if err := chainRaw.FromGRPCMessage(chainKind); err != nil { - return err - } - v2.SetKind(chainRaw) - } - - return nil -} - func (reqBody *AddChainRequestBody) ToGRPCMessage() grpc.Message { var reqBodygrpc *apemanager.AddChainRequest_Body if reqBody != nil { reqBodygrpc = new(apemanager.AddChainRequest_Body) - reqBodygrpc.SetTarget(reqBody.GetTarget().ToGRPCMessage().(*apemanager.ChainTarget)) - reqBodygrpc.SetChain(reqBody.GetChain().ToGRPCMessage().(*apemanager.Chain)) + reqBodygrpc.SetTarget(reqBody.GetTarget().ToGRPCMessage().(*apeGRPC.ChainTarget)) + reqBodygrpc.SetChain(reqBody.GetChain().ToGRPCMessage().(*apeGRPC.Chain)) } return reqBodygrpc @@ -151,14 +28,14 @@ func (reqBody *AddChainRequestBody) FromGRPCMessage(m grpc.Message) error { } if targetgrpc := reqBodygrpc.GetTarget(); targetgrpc != nil { - reqBody.target = new(ChainTarget) + reqBody.target = new(ape.ChainTarget) if err := reqBody.target.FromGRPCMessage(targetgrpc); err != nil { return err } } if chaingrpc := reqBodygrpc.GetChain(); chaingrpc != nil { - reqBody.chain = new(Chain) + reqBody.chain = new(ape.Chain) if err := reqBody.GetChain().FromGRPCMessage(chaingrpc); err != nil { return err } @@ -254,7 +131,7 @@ func (reqBody *RemoveChainRequestBody) ToGRPCMessage() grpc.Message { if reqBody != nil { reqBodygrpc = new(apemanager.RemoveChainRequest_Body) - reqBodygrpc.SetTarget(reqBody.target.ToGRPCMessage().(*apemanager.ChainTarget)) + reqBodygrpc.SetTarget(reqBody.target.ToGRPCMessage().(*apeGRPC.ChainTarget)) reqBodygrpc.SetChainId(reqBody.GetChainID()) } @@ -268,7 +145,7 @@ func (reqBody *RemoveChainRequestBody) FromGRPCMessage(m grpc.Message) error { } if targetgrpc := reqBodygrpc.GetTarget(); targetgrpc != nil { - reqBody.target = new(ChainTarget) + reqBody.target = new(ape.ChainTarget) if err := reqBody.target.FromGRPCMessage(targetgrpc); err != nil { return err } @@ -362,7 +239,7 @@ func (reqBody *ListChainsRequestBody) ToGRPCMessage() grpc.Message { if reqBody != nil { reqBodygrpc = new(apemanager.ListChainsRequest_Body) - reqBodygrpc.SetTarget(reqBody.target.ToGRPCMessage().(*apemanager.ChainTarget)) + reqBodygrpc.SetTarget(reqBody.target.ToGRPCMessage().(*apeGRPC.ChainTarget)) } return reqBodygrpc @@ -375,7 +252,7 @@ func (reqBody *ListChainsRequestBody) FromGRPCMessage(m grpc.Message) error { } if targetgrpc := reqBodygrpc.GetTarget(); targetgrpc != nil { - reqBody.target = new(ChainTarget) + reqBody.target = new(ape.ChainTarget) if err := reqBody.target.FromGRPCMessage(targetgrpc); err != nil { return err } @@ -419,9 +296,9 @@ func (respBody *ListChainsResponseBody) ToGRPCMessage() grpc.Message { if respBody != nil { respBodygrpc = new(apemanager.ListChainsResponse_Body) - chainsgrpc := make([]*apemanager.Chain, 0, len(respBody.GetChains())) + chainsgrpc := make([]*apeGRPC.Chain, 0, len(respBody.GetChains())) for _, chain := range respBody.GetChains() { - chainsgrpc = append(chainsgrpc, chain.ToGRPCMessage().(*apemanager.Chain)) + chainsgrpc = append(chainsgrpc, chain.ToGRPCMessage().(*apeGRPC.Chain)) } respBodygrpc.SetChains(chainsgrpc) @@ -436,10 +313,10 @@ func (respBody *ListChainsResponseBody) FromGRPCMessage(m grpc.Message) error { return message.NewUnexpectedMessageType(m, respBodygrpc) } - chains := make([]*Chain, 0, len(respBodygrpc.GetChains())) + chains := make([]*ape.Chain, 0, len(respBodygrpc.GetChains())) for _, chaingrpc := range respBodygrpc.GetChains() { - chain := new(Chain) + chain := new(ape.Chain) if err := chain.FromGRPCMessage(chaingrpc); err != nil { return err } diff --git a/apemanager/grpc/service.go b/apemanager/grpc/service.go index c07bceb..bd77db0 100644 --- a/apemanager/grpc/service.go +++ b/apemanager/grpc/service.go @@ -1,14 +1,15 @@ package apemanager import ( - session_grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" + session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" ) -func (rb *AddChainRequest_Body) SetTarget(t *ChainTarget) { +func (rb *AddChainRequest_Body) SetTarget(t *ape.ChainTarget) { rb.Target = t } -func (rb *AddChainRequest_Body) SetChain(chain *Chain) { +func (rb *AddChainRequest_Body) SetChain(chain *ape.Chain) { rb.Chain = chain } @@ -16,11 +17,11 @@ func (r *AddChainRequest) SetBody(rb *AddChainRequest_Body) { r.Body = rb } -func (r *AddChainRequest) SetMetaHeader(mh *session_grpc.RequestMetaHeader) { +func (r *AddChainRequest) SetMetaHeader(mh *session.RequestMetaHeader) { r.MetaHeader = mh } -func (r *AddChainRequest) SetVerifyHeader(vh *session_grpc.RequestVerificationHeader) { +func (r *AddChainRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) { r.VerifyHeader = vh } @@ -32,15 +33,15 @@ func (r *AddChainResponse) SetBody(rb *AddChainResponse_Body) { r.Body = rb } -func (r *AddChainResponse) SetMetaHeader(mh *session_grpc.ResponseMetaHeader) { +func (r *AddChainResponse) SetMetaHeader(mh *session.ResponseMetaHeader) { r.MetaHeader = mh } -func (r *AddChainResponse) SetVerifyHeader(vh *session_grpc.ResponseVerificationHeader) { +func (r *AddChainResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) { r.VerifyHeader = vh } -func (rb *RemoveChainRequest_Body) SetTarget(t *ChainTarget) { +func (rb *RemoveChainRequest_Body) SetTarget(t *ape.ChainTarget) { rb.Target = t } @@ -52,11 +53,11 @@ func (r *RemoveChainRequest) SetBody(rb *RemoveChainRequest_Body) { r.Body = rb } -func (r *RemoveChainRequest) SetMetaHeader(mh *session_grpc.RequestMetaHeader) { +func (r *RemoveChainRequest) SetMetaHeader(mh *session.RequestMetaHeader) { r.MetaHeader = mh } -func (r *RemoveChainRequest) SetVerifyHeader(vh *session_grpc.RequestVerificationHeader) { +func (r *RemoveChainRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) { r.VerifyHeader = vh } @@ -64,15 +65,15 @@ func (r *RemoveChainResponse) SetBody(rb *RemoveChainResponse_Body) { r.Body = rb } -func (r *RemoveChainResponse) SetMetaHeader(mh *session_grpc.ResponseMetaHeader) { +func (r *RemoveChainResponse) SetMetaHeader(mh *session.ResponseMetaHeader) { r.MetaHeader = mh } -func (r *RemoveChainResponse) SetVerifyHeader(vh *session_grpc.ResponseVerificationHeader) { +func (r *RemoveChainResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) { r.VerifyHeader = vh } -func (r *ListChainsRequest_Body) SetTarget(t *ChainTarget) { +func (r *ListChainsRequest_Body) SetTarget(t *ape.ChainTarget) { r.Target = t } @@ -80,15 +81,15 @@ func (r *ListChainsRequest) SetBody(rb *ListChainsRequest_Body) { r.Body = rb } -func (r *ListChainsRequest) SetMetaHeader(mh *session_grpc.RequestMetaHeader) { +func (r *ListChainsRequest) SetMetaHeader(mh *session.RequestMetaHeader) { r.MetaHeader = mh } -func (r *ListChainsRequest) SetVerifyHeader(vh *session_grpc.RequestVerificationHeader) { +func (r *ListChainsRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) { r.VerifyHeader = vh } -func (rb *ListChainsResponse_Body) SetChains(chains []*Chain) { +func (rb *ListChainsResponse_Body) SetChains(chains []*ape.Chain) { rb.Chains = chains } @@ -96,10 +97,10 @@ func (r *ListChainsResponse) SetBody(rb *ListChainsResponse_Body) { r.Body = rb } -func (r *ListChainsResponse) SetMetaHeader(mh *session_grpc.ResponseMetaHeader) { +func (r *ListChainsResponse) SetMetaHeader(mh *session.ResponseMetaHeader) { r.MetaHeader = mh } -func (r *ListChainsResponse) SetVerifyHeader(vh *session_grpc.ResponseVerificationHeader) { +func (r *ListChainsResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) { r.VerifyHeader = vh } diff --git a/apemanager/grpc/service.pb.go b/apemanager/grpc/service.pb.go index 157da44..7757aad 100644 --- a/apemanager/grpc/service.pb.go +++ b/apemanager/grpc/service.pb.go @@ -7,6 +7,7 @@ package apemanager import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -441,9 +442,9 @@ type AddChainRequest_Body struct { unknownFields protoimpl.UnknownFields // A target for which a rule chain is added. - Target *ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` // The chain to set for the target. - Chain *Chain `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"` + Chain *grpc1.Chain `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"` } func (x *AddChainRequest_Body) Reset() { @@ -478,14 +479,14 @@ func (*AddChainRequest_Body) Descriptor() ([]byte, []int) { return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{0, 0} } -func (x *AddChainRequest_Body) GetTarget() *ChainTarget { +func (x *AddChainRequest_Body) GetTarget() *grpc1.ChainTarget { if x != nil { return x.Target } return nil } -func (x *AddChainRequest_Body) GetChain() *Chain { +func (x *AddChainRequest_Body) GetChain() *grpc1.Chain { if x != nil { return x.Chain } @@ -548,7 +549,7 @@ type RemoveChainRequest_Body struct { unknownFields protoimpl.UnknownFields // Target for which a rule chain is removed. - Target *ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` // Chain ID assigned for the rule chain. ChainId []byte `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` } @@ -585,7 +586,7 @@ func (*RemoveChainRequest_Body) Descriptor() ([]byte, []int) { return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{2, 0} } -func (x *RemoveChainRequest_Body) GetTarget() *ChainTarget { +func (x *RemoveChainRequest_Body) GetTarget() *grpc1.ChainTarget { if x != nil { return x.Target } @@ -645,7 +646,7 @@ type ListChainsRequest_Body struct { unknownFields protoimpl.UnknownFields // Target for which rule chains are listed. - Target *ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` } func (x *ListChainsRequest_Body) Reset() { @@ -680,7 +681,7 @@ func (*ListChainsRequest_Body) Descriptor() ([]byte, []int) { return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{4, 0} } -func (x *ListChainsRequest_Body) GetTarget() *ChainTarget { +func (x *ListChainsRequest_Body) GetTarget() *grpc1.ChainTarget { if x != nil { return x.Target } @@ -693,7 +694,7 @@ type ListChainsResponse_Body struct { unknownFields protoimpl.UnknownFields // The list of chains defined for the reqeusted target. - Chains []*Chain `protobuf:"bytes,1,rep,name=chains,proto3" json:"chains,omitempty"` + Chains []*grpc1.Chain `protobuf:"bytes,1,rep,name=chains,proto3" json:"chains,omitempty"` } func (x *ListChainsResponse_Body) Reset() { @@ -728,7 +729,7 @@ func (*ListChainsResponse_Body) Descriptor() ([]byte, []int) { return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{5, 0} } -func (x *ListChainsResponse_Body) GetChains() []*Chain { +func (x *ListChainsResponse_Body) GetChains() []*grpc1.Chain { if x != nil { return x.Chains } @@ -741,151 +742,149 @@ var file_apemanager_grpc_service_proto_rawDesc = []byte{ 0x0a, 0x1d, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x1a, 0x1b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x02, - 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2b, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, - 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, 0x76, 0x0a, 0x04, - 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, - 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x12, 0x32, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x05, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x22, 0x93, 0x02, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, - 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x1a, 0x14, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x02, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 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, 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, 0x21, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x22, 0xd1, 0x02, 0x0a, 0x12, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x42, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2e, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, - 0x61, 0x69, 0x6e, 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, - 0x5d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x22, 0xfe, - 0x01, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 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, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, - 0xb4, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 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, + 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, 0x68, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x33, 0x0a, + 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x2e, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, + 0x70, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x22, + 0x93, 0x02, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, + 0x61, 0x69, 0x6e, 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, 0x42, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x72, 0x6f, + 0x65, 0x72, 0x1a, 0x21, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x64, 0x22, 0xca, 0x02, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0xb2, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 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, 0x3c, 0x0a, - 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x52, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x32, 0xb9, 0x02, 0x0a, 0x11, - 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x5b, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x2e, - 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, - 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, - 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x29, 0x2e, - 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 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, 0x56, 0x0a, 0x04, 0x42, 0x6f, + 0x64, 0x79, 0x12, 0x33, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x61, 0x70, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, + 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x49, 0x64, 0x22, 0xfe, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x73, 0x12, 0x28, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 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, 0x06, 0x0a, 0x04, 0x42, + 0x6f, 0x64, 0x79, 0x22, 0xad, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 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, 0x3b, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x33, + 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x2e, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x22, 0xab, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 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, 0x35, 0x0a, 0x04, 0x42, 0x6f, + 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x61, 0x70, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x73, 0x32, 0xb9, 0x02, 0x0a, 0x11, 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5b, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x12, 0x26, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x12, 0x29, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x28, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, - 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, - 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, - 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x70, 0x65, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x70, 0x65, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, + 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, + 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, + 0x2f, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x3b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -918,8 +917,8 @@ var file_apemanager_grpc_service_proto_goTypes = []interface{}{ (*grpc.RequestVerificationHeader)(nil), // 13: neo.fs.v2.session.RequestVerificationHeader (*grpc.ResponseMetaHeader)(nil), // 14: neo.fs.v2.session.ResponseMetaHeader (*grpc.ResponseVerificationHeader)(nil), // 15: neo.fs.v2.session.ResponseVerificationHeader - (*ChainTarget)(nil), // 16: frostfs.v2.apemanager.ChainTarget - (*Chain)(nil), // 17: frostfs.v2.apemanager.Chain + (*grpc1.ChainTarget)(nil), // 16: frostfs.v2.ape.ChainTarget + (*grpc1.Chain)(nil), // 17: frostfs.v2.ape.Chain } var file_apemanager_grpc_service_proto_depIdxs = []int32{ 6, // 0: frostfs.v2.apemanager.AddChainRequest.body:type_name -> frostfs.v2.apemanager.AddChainRequest.Body @@ -940,11 +939,11 @@ var file_apemanager_grpc_service_proto_depIdxs = []int32{ 11, // 15: frostfs.v2.apemanager.ListChainsResponse.body:type_name -> frostfs.v2.apemanager.ListChainsResponse.Body 14, // 16: frostfs.v2.apemanager.ListChainsResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader 15, // 17: frostfs.v2.apemanager.ListChainsResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 16, // 18: frostfs.v2.apemanager.AddChainRequest.Body.target:type_name -> frostfs.v2.apemanager.ChainTarget - 17, // 19: frostfs.v2.apemanager.AddChainRequest.Body.chain:type_name -> frostfs.v2.apemanager.Chain - 16, // 20: frostfs.v2.apemanager.RemoveChainRequest.Body.target:type_name -> frostfs.v2.apemanager.ChainTarget - 16, // 21: frostfs.v2.apemanager.ListChainsRequest.Body.target:type_name -> frostfs.v2.apemanager.ChainTarget - 17, // 22: frostfs.v2.apemanager.ListChainsResponse.Body.chains:type_name -> frostfs.v2.apemanager.Chain + 16, // 18: frostfs.v2.apemanager.AddChainRequest.Body.target:type_name -> frostfs.v2.ape.ChainTarget + 17, // 19: frostfs.v2.apemanager.AddChainRequest.Body.chain:type_name -> frostfs.v2.ape.Chain + 16, // 20: frostfs.v2.apemanager.RemoveChainRequest.Body.target:type_name -> frostfs.v2.ape.ChainTarget + 16, // 21: frostfs.v2.apemanager.ListChainsRequest.Body.target:type_name -> frostfs.v2.ape.ChainTarget + 17, // 22: frostfs.v2.apemanager.ListChainsResponse.Body.chains:type_name -> frostfs.v2.ape.Chain 0, // 23: frostfs.v2.apemanager.APEManagerService.AddChain:input_type -> frostfs.v2.apemanager.AddChainRequest 2, // 24: frostfs.v2.apemanager.APEManagerService.RemoveChain:input_type -> frostfs.v2.apemanager.RemoveChainRequest 4, // 25: frostfs.v2.apemanager.APEManagerService.ListChains:input_type -> frostfs.v2.apemanager.ListChainsRequest @@ -963,7 +962,6 @@ func file_apemanager_grpc_service_proto_init() { if File_apemanager_grpc_service_proto != nil { return } - file_apemanager_grpc_types_proto_init() if !protoimpl.UnsafeEnabled { file_apemanager_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddChainRequest); i { diff --git a/apemanager/marshal.go b/apemanager/marshal.go index 22e092e..7217709 100644 --- a/apemanager/marshal.go +++ b/apemanager/marshal.go @@ -1,19 +1,12 @@ package apemanager import ( - "fmt" - apemanager "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" ) const ( - chainTargetTargetTypeField = 1 - chainTargetNameField = 2 - - chainRawField = 1 - addChainReqBodyTargetField = 1 addChainReqBodyChainField = 2 @@ -31,82 +24,6 @@ const ( listChainsRespBodyChainsField = 1 ) -func (t *ChainTarget) StableSize() (size int) { - if t == nil { - return 0 - } - - size += proto.EnumSize(chainTargetTargetTypeField, int32(t.targeType)) - size += proto.StringSize(chainTargetNameField, t.name) - - return size -} - -func (t *ChainTarget) StableMarshal(buf []byte) []byte { - if t == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, t.StableSize()) - } - - var offset int - - offset += proto.EnumMarshal(chainTargetTargetTypeField, buf[offset:], int32(t.targeType)) - proto.StringMarshal(chainTargetNameField, buf[offset:], t.name) - - return buf -} - -func (t *ChainTarget) Unmarshal(data []byte) error { - return message.Unmarshal(t, data, new(apemanager.ChainTarget)) -} - -func (c *Chain) StableSize() (size int) { - if c == nil { - return 0 - } - - switch v := c.GetKind().(type) { - case *ChainRaw: - if v != nil { - size += proto.BytesSize(chainRawField, v.GetRaw()) - } - default: - panic(fmt.Sprintf("unsupported chain kind: %T", v)) - } - - return size -} - -func (c *Chain) StableMarshal(buf []byte) []byte { - if c == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, c.StableSize()) - } - - var offset int - - switch v := c.GetKind().(type) { - case *ChainRaw: - if v != nil { - proto.BytesMarshal(chainRawField, buf[offset:], v.GetRaw()) - } - default: - panic(fmt.Sprintf("unsupported chain kind: %T", v)) - } - - return buf -} - -func (c *Chain) Unmarshal(data []byte) error { - return message.Unmarshal(c, data, new(apemanager.Chain)) -} - func (rb *AddChainRequestBody) StableSize() (size int) { if rb == nil { return 0 diff --git a/apemanager/message_test.go b/apemanager/message_test.go index 2d623d5..fc4d905 100644 --- a/apemanager/message_test.go +++ b/apemanager/message_test.go @@ -10,7 +10,6 @@ import ( func TestMessageConvert(t *testing.T) { messagetest.TestRPCMessage(t, - func(empty bool) message.Message { return apemanagertest.GenerateChainTarget(empty) }, func(empty bool) message.Message { return apemanagertest.GenerateAddChainRequestBody(empty) }, func(empty bool) message.Message { return apemanagertest.GenerateAddChainRequest(empty) }, func(empty bool) message.Message { return apemanagertest.GenerateAddChainResponseBody(empty) }, diff --git a/apemanager/test/generate.go b/apemanager/test/generate.go index 00dd236..192f7ad 100644 --- a/apemanager/test/generate.go +++ b/apemanager/test/generate.go @@ -1,6 +1,7 @@ package apemanagertest import ( + apetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/test" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" sessiontest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/test" ) @@ -13,78 +14,12 @@ func generateChainID(empty bool) []byte { return []byte("616c6c6f774f626a476574436e72") } -func generateRawChains(empty bool, n int) []*apemanager.Chain { - if empty { - return []*apemanager.Chain{} - } - - res := make([]*apemanager.Chain, n) - for i := range res { - res[i] = generateRawChain(empty) - } - return res -} - -func generateRawChain(empty bool) *apemanager.Chain { - chRaw := new(apemanager.ChainRaw) - - if empty { - chRaw.SetRaw([]byte("{}")) - } else { - chRaw.SetRaw([]byte(`{ - "ID": "", - "Rules": [ - { - "Status": "Allow", - "Actions": { - "Inverted": false, - "Names": [ - "GetObject" - ] - }, - "Resources": { - "Inverted": false, - "Names": [ - "native:object/*" - ] - }, - "Any": false, - "Condition": [ - { - "Op": "StringEquals", - "Object": "Resource", - "Key": "Department", - "Value": "HR" - } - ] - } - ], - "MatchType": "DenyPriority" - }`)) - } - - ch := new(apemanager.Chain) - ch.SetKind(chRaw) - return ch -} - -func GenerateChainTarget(empty bool) *apemanager.ChainTarget { - m := new(apemanager.ChainTarget) - - if !empty { - m.SetTargetType(apemanager.TargetTypeContainer) - m.SetName("BzQw5HH3feoxFDD5tCT87Y1726qzgLfxEE7wgtoRzB3R") - } - - return m -} - func GenerateAddChainRequestBody(empty bool) *apemanager.AddChainRequestBody { m := new(apemanager.AddChainRequestBody) if !empty { - m.SetTarget(GenerateChainTarget(empty)) - m.SetChain(generateRawChain(empty)) + m.SetTarget(apetest.GenerateChainTarget(empty)) + m.SetChain(apetest.GenerateRawChain(empty)) } return m @@ -129,7 +64,7 @@ func GenerateRemoveChainRequestBody(empty bool) *apemanager.RemoveChainRequestBo if !empty { m.SetChainID(generateChainID(empty)) - m.SetTarget(GenerateChainTarget(empty)) + m.SetTarget(apetest.GenerateChainTarget(empty)) } return m @@ -167,7 +102,7 @@ func GenerateListChainsRequestBody(empty bool) *apemanager.ListChainsRequestBody m := new(apemanager.ListChainsRequestBody) if !empty { - m.SetTarget(GenerateChainTarget(empty)) + m.SetTarget(apetest.GenerateChainTarget(empty)) } return m @@ -189,7 +124,7 @@ func GenerateListChainsResponseBody(empty bool) *apemanager.ListChainsResponseBo m := new(apemanager.ListChainsResponseBody) if !empty { - m.SetChains(generateRawChains(empty, 10)) + m.SetChains(apetest.GenerateRawChains(empty, 10)) } return m diff --git a/apemanager/types.go b/apemanager/types.go index 1fcca29..6896bf1 100644 --- a/apemanager/types.go +++ b/apemanager/types.go @@ -1,49 +1,10 @@ package apemanager import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" ) -type TargetType uint32 - -const ( - TargetTypeUndefined TargetType = iota - TargetTypeNamespace - TargetTypeContainer - TargetTypeUser - TargetTypeGroup -) - -type ChainTarget struct { - targeType TargetType - - name string -} - -func (ct *ChainTarget) SetTargetType(targeType TargetType) { - ct.targeType = targeType -} - -func (ct *ChainTarget) SetName(name string) { - ct.name = name -} - -func (ct *ChainTarget) GetTargetType() TargetType { - if ct != nil { - return ct.targeType - } - - return 0 -} - -func (ct *ChainTarget) GetName() string { - if ct != nil { - return ct.name - } - - return "" -} - type AddChainRequest struct { body *AddChainRequestBody @@ -58,55 +19,25 @@ func (r *AddChainRequest) GetBody() *AddChainRequestBody { return r.body } -type chainKind interface { - isChainKind() -} - -type Chain struct { - kind chainKind -} - -func (c *Chain) SetKind(kind chainKind) { - c.kind = kind -} - -func (c *Chain) GetKind() chainKind { - return c.kind -} - -type ChainRaw struct { - Raw []byte -} - -func (*ChainRaw) isChainKind() {} - -func (c *ChainRaw) SetRaw(raw []byte) { - c.Raw = raw -} - -func (c *ChainRaw) GetRaw() []byte { - return c.Raw -} - type AddChainRequestBody struct { - target *ChainTarget + target *ape.ChainTarget - chain *Chain + chain *ape.Chain } -func (rb *AddChainRequestBody) SetTarget(target *ChainTarget) { +func (rb *AddChainRequestBody) SetTarget(target *ape.ChainTarget) { rb.target = target } -func (rb *AddChainRequestBody) GetTarget() *ChainTarget { +func (rb *AddChainRequestBody) GetTarget() *ape.ChainTarget { return rb.target } -func (rb *AddChainRequestBody) SetChain(chain *Chain) { +func (rb *AddChainRequestBody) SetChain(chain *ape.Chain) { rb.chain = chain } -func (rb *AddChainRequestBody) GetChain() *Chain { +func (rb *AddChainRequestBody) GetChain() *ape.Chain { return rb.chain } @@ -151,16 +82,16 @@ func (r *RemoveChainRequest) GetBody() *RemoveChainRequestBody { } type RemoveChainRequestBody struct { - target *ChainTarget + target *ape.ChainTarget chainID []byte } -func (rb *RemoveChainRequestBody) SetTarget(target *ChainTarget) { +func (rb *RemoveChainRequestBody) SetTarget(target *ape.ChainTarget) { rb.target = target } -func (rb *RemoveChainRequestBody) GetTarget() *ChainTarget { +func (rb *RemoveChainRequestBody) GetTarget() *ape.ChainTarget { return rb.target } @@ -204,14 +135,14 @@ func (r *ListChainsRequest) GetBody() *ListChainsRequestBody { } type ListChainsRequestBody struct { - target *ChainTarget + target *ape.ChainTarget } -func (rb *ListChainsRequestBody) SetTarget(target *ChainTarget) { +func (rb *ListChainsRequestBody) SetTarget(target *ape.ChainTarget) { rb.target = target } -func (rb *ListChainsRequestBody) GetTarget() *ChainTarget { +func (rb *ListChainsRequestBody) GetTarget() *ape.ChainTarget { return rb.target } @@ -230,15 +161,15 @@ func (r *ListChainsResponse) GetBody() *ListChainsResponseBody { } type ListChainsResponseBody struct { - chains []*Chain + chains []*ape.Chain session.RequestHeaders } -func (r *ListChainsResponseBody) SetChains(chains []*Chain) { +func (r *ListChainsResponseBody) SetChains(chains []*ape.Chain) { r.chains = chains } -func (r *ListChainsResponseBody) GetChains() []*Chain { +func (r *ListChainsResponseBody) GetChains() []*ape.Chain { return r.chains } From 9e825239ac5f57c27cef2ca5291a17ea7f1e4202 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 28 May 2024 11:54:38 +0300 Subject: [PATCH 102/169] [#85] acl: Regenerate protobufs for Bearer token Signed-off-by: Airat Arifullin --- acl/convert.go | 65 ++++++++- acl/grpc/types.go | 13 ++ acl/grpc/types.pb.go | 338 ++++++++++++++++++++++++++++--------------- acl/json.go | 8 + acl/marshal.go | 52 ++++++- acl/test/generate.go | 15 +- acl/types.go | 41 +++++- 7 files changed, 408 insertions(+), 124 deletions(-) diff --git a/acl/convert.go b/acl/convert.go index 342c110..0cf455c 100644 --- a/acl/convert.go +++ b/acl/convert.go @@ -2,6 +2,8 @@ package acl import ( acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" + apeGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" refsGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" @@ -418,6 +420,54 @@ func (l *TokenLifetime) FromGRPCMessage(m grpc.Message) error { return nil } +func (c *APEOverride) ToGRPCMessage() grpc.Message { + var m *acl.BearerToken_Body_APEOverride + + if c != nil { + m = new(acl.BearerToken_Body_APEOverride) + + m.SetTarget(c.target.ToGRPCMessage().(*apeGRPC.ChainTarget)) + + if len(c.chains) > 0 { + apeChains := make([]*apeGRPC.Chain, len(c.chains)) + for i := range c.chains { + apeChains[i] = c.chains[i].ToGRPCMessage().(*apeGRPC.Chain) + } + m.SetChains(apeChains) + } + } + + return m +} + +func (c *APEOverride) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*acl.BearerToken_Body_APEOverride) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + if targetGRPC := v.GetTarget(); targetGRPC != nil { + if c.target == nil { + c.target = new(ape.ChainTarget) + } + if err := c.target.FromGRPCMessage(v.GetTarget()); err != nil { + return err + } + } + + if apeChains := v.GetChains(); len(apeChains) > 0 { + 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 { + return err + } + } + } + + return nil +} + func (bt *BearerTokenBody) ToGRPCMessage() grpc.Message { var m *acl.BearerToken_Body @@ -428,6 +478,7 @@ func (bt *BearerTokenBody) ToGRPCMessage() grpc.Message { m.SetLifetime(bt.lifetime.ToGRPCMessage().(*acl.BearerToken_Body_TokenLifetime)) m.SetEaclTable(bt.eacl.ToGRPCMessage().(*acl.EACLTable)) m.SetAllowImpersonate(bt.impersonate) + m.SetAPEOverride(bt.apeOverride.ToGRPCMessage().(*acl.BearerToken_Body_APEOverride)) } return m @@ -477,7 +528,19 @@ func (bt *BearerTokenBody) FromGRPCMessage(m grpc.Message) error { bt.eacl = new(Table) } - err = bt.eacl.FromGRPCMessage(eacl) + if err = bt.eacl.FromGRPCMessage(eacl); err != nil { + return err + } + } + + if apeOverrideGRPC := v.GetApeOverride(); apeOverrideGRPC != nil { + if bt.apeOverride == nil { + bt.apeOverride = new(APEOverride) + } + err = bt.apeOverride.FromGRPCMessage(apeOverrideGRPC) + if err != nil { + return err + } } bt.impersonate = v.GetAllowImpersonate() diff --git a/acl/grpc/types.go b/acl/grpc/types.go index ce50e2f..fbcbb91 100644 --- a/acl/grpc/types.go +++ b/acl/grpc/types.go @@ -1,6 +1,7 @@ package acl import ( + ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" ) @@ -74,6 +75,18 @@ func (m *BearerToken_Body) SetEaclTable(v *EACLTable) { m.EaclTable = v } +func (m *BearerToken_Body) SetAPEOverride(v *BearerToken_Body_APEOverride) { + m.ApeOverride = v +} + +func (m *BearerToken_Body_APEOverride) SetChains(v []*ape.Chain) { + m.Chains = v +} + +func (m *BearerToken_Body_APEOverride) SetTarget(v *ape.ChainTarget) { + m.Target = v +} + // SetOwnerId sets identifier of the bearer token owner. func (m *BearerToken_Body) SetOwnerId(v *refs.OwnerID) { m.OwnerId = v diff --git a/acl/grpc/types.pb.go b/acl/grpc/types.pb.go index 1b57b1a..aec449c 100644 --- a/acl/grpc/types.pb.go +++ b/acl/grpc/types.pb.go @@ -7,6 +7,7 @@ package acl import ( + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -707,6 +708,8 @@ type BearerToken_Body struct { // container. If it contains `container_id` field, bearer token is only // valid for this specific container. Otherwise, any container of the same // owner is allowed. + // + // Deprecated: eACL tables are no longer relevant - `APEOverrides` should be used instead. EaclTable *EACLTable `protobuf:"bytes,1,opt,name=eacl_table,json=eaclTable,proto3" json:"eacl_table,omitempty"` // `OwnerID` defines to whom the token was issued. It must match the request // originator's `OwnerID`. If empty, any token bearer will be accepted. @@ -716,6 +719,8 @@ type BearerToken_Body struct { // AllowImpersonate flag to consider token signer as request owner. // If this field is true extended ACL table in token body isn't processed. AllowImpersonate bool `protobuf:"varint,4,opt,name=allow_impersonate,json=allowImpersonate,proto3" json:"allow_impersonate,omitempty"` + // APE override for the target. + ApeOverride *BearerToken_Body_APEOverride `protobuf:"bytes,5,opt,name=ape_override,json=apeOverride,proto3" json:"ape_override,omitempty"` } func (x *BearerToken_Body) Reset() { @@ -778,6 +783,13 @@ func (x *BearerToken_Body) GetAllowImpersonate() bool { return false } +func (x *BearerToken_Body) GetApeOverride() *BearerToken_Body_APEOverride { + if x != nil { + return x.ApeOverride + } + return nil +} + // Lifetime parameters of the token. Field names taken from // [rfc7519](https://tools.ietf.org/html/rfc7519). type BearerToken_Body_TokenLifetime struct { @@ -846,113 +858,189 @@ func (x *BearerToken_Body_TokenLifetime) GetIat() uint64 { return 0 } +// APEOverride is the list of APE chains defined for a target. +// These chains are meant to serve as overrides to the already defined (or even undefined) +// APE chains for the target (see contract `Policy`). +// +// The server-side processing of the bearer token with set APE overrides must verify if a client is permitted +// to override chains for the target, preventing unauthorized access through the APE mechanism. +type BearerToken_Body_APEOverride struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Target for which chains are applied. + Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + // The list of APE chains. + Chains []*grpc1.Chain `protobuf:"bytes,2,rep,name=chains,proto3" json:"chains,omitempty"` +} + +func (x *BearerToken_Body_APEOverride) Reset() { + *x = BearerToken_Body_APEOverride{} + if protoimpl.UnsafeEnabled { + mi := &file_acl_grpc_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BearerToken_Body_APEOverride) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BearerToken_Body_APEOverride) ProtoMessage() {} + +func (x *BearerToken_Body_APEOverride) ProtoReflect() protoreflect.Message { + mi := &file_acl_grpc_types_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BearerToken_Body_APEOverride.ProtoReflect.Descriptor instead. +func (*BearerToken_Body_APEOverride) Descriptor() ([]byte, []int) { + return file_acl_grpc_types_proto_rawDescGZIP(), []int{2, 0, 1} +} + +func (x *BearerToken_Body_APEOverride) GetTarget() *grpc1.ChainTarget { + if x != nil { + return x.Target + } + return nil +} + +func (x *BearerToken_Body_APEOverride) GetChains() []*grpc1.Chain { + if x != nil { + return x.Chains + } + return nil +} + var File_acl_grpc_types_proto protoreflect.FileDescriptor var file_acl_grpc_types_proto_rawDesc = []byte{ 0x0a, 0x14, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x03, 0x0a, - 0x0a, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x61, 0x63, 0x6c, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x3a, - 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, - 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x1a, 0xa5, 0x01, 0x0a, 0x06, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x1a, 0x45, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x04, - 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, - 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0c, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x09, 0x45, 0x41, - 0x43, 0x4c, 0x54, 0x61, 0x62, 0x6c, 0x65, 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, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, - 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x33, 0x0a, 0x07, 0x72, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, - 0xb0, 0x03, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x33, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, - 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0xb2, 0x02, - 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x0a, 0x65, 0x61, 0x63, 0x6c, 0x5f, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x09, 0x65, 0x61, 0x63, 0x6c, 0x54, 0x61, 0x62, 0x6c, 0x65, 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, 0x49, 0x0a, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, - 0x74, 0x69, 0x6d, 0x65, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2b, - 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x6d, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, - 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, - 0x49, 0x6d, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x1a, 0x45, 0x0a, 0x0d, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, - 0x0a, 0x03, 0x6e, 0x62, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6e, 0x62, 0x66, - 0x12, 0x10, 0x0a, 0x03, 0x69, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x69, - 0x61, 0x74, 0x2a, 0x3e, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, - 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x59, - 0x53, 0x54, 0x45, 0x4d, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x53, - 0x10, 0x03, 0x2a, 0x4f, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, - 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, - 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, - 0x4c, 0x10, 0x02, 0x2a, 0x7a, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x47, - 0x45, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x07, - 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, - 0x45, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x10, 0x05, 0x12, - 0x0c, 0x0a, 0x08, 0x47, 0x45, 0x54, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x06, 0x12, 0x10, 0x0a, - 0x0c, 0x47, 0x45, 0x54, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, 0x10, 0x07, 0x2a, - 0x35, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, - 0x44, 0x45, 0x4e, 0x59, 0x10, 0x02, 0x2a, 0x4a, 0x0a, 0x0a, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, - 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x42, 0x4a, - 0x45, 0x43, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, - 0x10, 0x03, 0x42, 0x58, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, - 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, - 0x63, 0x6c, 0xaa, 0x02, 0x17, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x6c, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x61, 0x70, + 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xda, 0x03, 0x0a, 0x0a, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x12, 0x36, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x06, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, + 0x1a, 0xa5, 0x01, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0b, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x45, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x12, 0x27, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x13, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, + 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, + 0xb3, 0x01, 0x0a, 0x09, 0x45, 0x41, 0x43, 0x4c, 0x54, 0x61, 0x62, 0x6c, 0x65, 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, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, + 0x12, 0x33, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, + 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0xf3, 0x04, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x33, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, + 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x1a, 0xf5, 0x03, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x0a, + 0x65, 0x61, 0x63, 0x6c, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, + 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x09, 0x65, 0x61, 0x63, 0x6c, + 0x54, 0x61, 0x62, 0x6c, 0x65, 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, 0x49, 0x0a, 0x08, 0x6c, 0x69, 0x66, + 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, + 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, + 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x6d, + 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x49, 0x6d, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x74, + 0x65, 0x12, 0x4e, 0x0a, 0x0c, 0x61, 0x70, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x41, 0x50, 0x45, 0x4f, 0x76, 0x65, 0x72, + 0x72, 0x69, 0x64, 0x65, 0x52, 0x0b, 0x61, 0x70, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, + 0x65, 0x1a, 0x45, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, + 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x62, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x03, 0x6e, 0x62, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x61, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x03, 0x69, 0x61, 0x74, 0x1a, 0x71, 0x0a, 0x0b, 0x41, 0x50, 0x45, 0x4f, + 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2d, 0x0a, 0x06, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x2e, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x52, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2a, 0x3e, 0x0a, 0x04, 0x52, + 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, + 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x02, 0x12, + 0x0a, 0x0a, 0x06, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x53, 0x10, 0x03, 0x2a, 0x4f, 0x0a, 0x09, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, + 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, + 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, + 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x2a, 0x7a, 0x0a, 0x09, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, + 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, + 0x04, 0x48, 0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x03, + 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, + 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x47, 0x45, 0x54, 0x52, + 0x41, 0x4e, 0x47, 0x45, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x45, 0x54, 0x52, 0x41, 0x4e, + 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, 0x10, 0x07, 0x2a, 0x35, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, + 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x4e, 0x59, 0x10, 0x02, 0x2a, + 0x4a, 0x0a, 0x0a, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, + 0x12, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, + 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, 0x12, 0x0b, + 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x03, 0x42, 0x58, 0x5a, 0x3c, 0x67, + 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, + 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, + 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, + 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x6c, 0xaa, 0x02, 0x17, 0x4e, 0x65, + 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, + 0x49, 0x2e, 0x41, 0x63, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -968,7 +1056,7 @@ func file_acl_grpc_types_proto_rawDescGZIP() []byte { } var file_acl_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_acl_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_acl_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_acl_grpc_types_proto_goTypes = []interface{}{ (Role)(0), // 0: neo.fs.v2.acl.Role (MatchType)(0), // 1: neo.fs.v2.acl.MatchType @@ -982,32 +1070,38 @@ var file_acl_grpc_types_proto_goTypes = []interface{}{ (*EACLRecord_Target)(nil), // 9: neo.fs.v2.acl.EACLRecord.Target (*BearerToken_Body)(nil), // 10: neo.fs.v2.acl.BearerToken.Body (*BearerToken_Body_TokenLifetime)(nil), // 11: neo.fs.v2.acl.BearerToken.Body.TokenLifetime - (*grpc.Version)(nil), // 12: neo.fs.v2.refs.Version - (*grpc.ContainerID)(nil), // 13: neo.fs.v2.refs.ContainerID - (*grpc.Signature)(nil), // 14: neo.fs.v2.refs.Signature - (*grpc.OwnerID)(nil), // 15: neo.fs.v2.refs.OwnerID + (*BearerToken_Body_APEOverride)(nil), // 12: neo.fs.v2.acl.BearerToken.Body.APEOverride + (*grpc.Version)(nil), // 13: neo.fs.v2.refs.Version + (*grpc.ContainerID)(nil), // 14: neo.fs.v2.refs.ContainerID + (*grpc.Signature)(nil), // 15: neo.fs.v2.refs.Signature + (*grpc.OwnerID)(nil), // 16: neo.fs.v2.refs.OwnerID + (*grpc1.ChainTarget)(nil), // 17: frostfs.v2.ape.ChainTarget + (*grpc1.Chain)(nil), // 18: frostfs.v2.ape.Chain } var file_acl_grpc_types_proto_depIdxs = []int32{ 2, // 0: neo.fs.v2.acl.EACLRecord.operation:type_name -> neo.fs.v2.acl.Operation 3, // 1: neo.fs.v2.acl.EACLRecord.action:type_name -> neo.fs.v2.acl.Action 8, // 2: neo.fs.v2.acl.EACLRecord.filters:type_name -> neo.fs.v2.acl.EACLRecord.Filter 9, // 3: neo.fs.v2.acl.EACLRecord.targets:type_name -> neo.fs.v2.acl.EACLRecord.Target - 12, // 4: neo.fs.v2.acl.EACLTable.version:type_name -> neo.fs.v2.refs.Version - 13, // 5: neo.fs.v2.acl.EACLTable.container_id:type_name -> neo.fs.v2.refs.ContainerID + 13, // 4: neo.fs.v2.acl.EACLTable.version:type_name -> neo.fs.v2.refs.Version + 14, // 5: neo.fs.v2.acl.EACLTable.container_id:type_name -> neo.fs.v2.refs.ContainerID 5, // 6: neo.fs.v2.acl.EACLTable.records:type_name -> neo.fs.v2.acl.EACLRecord 10, // 7: neo.fs.v2.acl.BearerToken.body:type_name -> neo.fs.v2.acl.BearerToken.Body - 14, // 8: neo.fs.v2.acl.BearerToken.signature:type_name -> neo.fs.v2.refs.Signature + 15, // 8: neo.fs.v2.acl.BearerToken.signature:type_name -> neo.fs.v2.refs.Signature 4, // 9: neo.fs.v2.acl.EACLRecord.Filter.header_type:type_name -> neo.fs.v2.acl.HeaderType 1, // 10: neo.fs.v2.acl.EACLRecord.Filter.match_type:type_name -> neo.fs.v2.acl.MatchType 0, // 11: neo.fs.v2.acl.EACLRecord.Target.role:type_name -> neo.fs.v2.acl.Role 6, // 12: neo.fs.v2.acl.BearerToken.Body.eacl_table:type_name -> neo.fs.v2.acl.EACLTable - 15, // 13: neo.fs.v2.acl.BearerToken.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 16, // 13: neo.fs.v2.acl.BearerToken.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID 11, // 14: neo.fs.v2.acl.BearerToken.Body.lifetime:type_name -> neo.fs.v2.acl.BearerToken.Body.TokenLifetime - 15, // [15:15] is the sub-list for method output_type - 15, // [15:15] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name + 12, // 15: neo.fs.v2.acl.BearerToken.Body.ape_override:type_name -> neo.fs.v2.acl.BearerToken.Body.APEOverride + 17, // 16: neo.fs.v2.acl.BearerToken.Body.APEOverride.target:type_name -> frostfs.v2.ape.ChainTarget + 18, // 17: neo.fs.v2.acl.BearerToken.Body.APEOverride.chains:type_name -> frostfs.v2.ape.Chain + 18, // [18:18] is the sub-list for method output_type + 18, // [18:18] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_acl_grpc_types_proto_init() } @@ -1100,6 +1194,18 @@ func file_acl_grpc_types_proto_init() { return nil } } + file_acl_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BearerToken_Body_APEOverride); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1107,7 +1213,7 @@ func file_acl_grpc_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_acl_grpc_types_proto_rawDesc, NumEnums: 5, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/acl/json.go b/acl/json.go index 0e2078b..9046555 100644 --- a/acl/json.go +++ b/acl/json.go @@ -21,6 +21,14 @@ func (t *Target) UnmarshalJSON(data []byte) error { return message.UnmarshalJSON(t, data, new(acl.EACLRecord_Target)) } +func (a *APEOverride) MarshalJSON() ([]byte, error) { + return message.MarshalJSON(a) +} + +func (a *APEOverride) UnmarshalJSON(data []byte) error { + return message.UnmarshalJSON(a, data, new(acl.BearerToken_Body_APEOverride)) +} + func (r *Record) MarshalJSON() ([]byte, error) { return message.MarshalJSON(r) } diff --git a/acl/marshal.go b/acl/marshal.go index cd6c6dd..2e59304 100644 --- a/acl/marshal.go +++ b/acl/marshal.go @@ -28,10 +28,14 @@ const ( lifetimeNotValidBeforeField = 2 lifetimeIssuedAtField = 3 - bearerTokenBodyACLField = 1 - bearerTokenBodyOwnerField = 2 - bearerTokenBodyLifetimeField = 3 - bearerTokenBodyImpersonate = 4 + tokenAPEChainsTargetField = 1 + tokenAPEChainsChainsField = 2 + + bearerTokenBodyACLField = 1 + bearerTokenBodyOwnerField = 2 + bearerTokenBodyLifetimeField = 3 + bearerTokenBodyImpersonate = 4 + bearerTokenTokenAPEChainsField = 5 bearerTokenBodyField = 1 bearerTokenSignatureField = 2 @@ -239,6 +243,42 @@ func (l *TokenLifetime) Unmarshal(data []byte) error { return message.Unmarshal(l, data, new(acl.BearerToken_Body_TokenLifetime)) } +func (c *APEOverride) StableMarshal(buf []byte) []byte { + if c == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, c.StableSize()) + } + + var offset int + + offset += protoutil.NestedStructureMarshal(tokenAPEChainsTargetField, buf[offset:], c.target) + for i := range c.chains { + offset += protoutil.NestedStructureMarshal(tokenAPEChainsChainsField, buf[offset:], c.chains[i]) + } + + return buf +} + +func (c *APEOverride) StableSize() (size int) { + if c == nil { + return 0 + } + + size += protoutil.NestedStructureSize(tokenAPEChainsTargetField, c.target) + for i := range c.chains { + size += protoutil.NestedStructureSize(tokenAPEChainsChainsField, c.chains[i]) + } + + return size +} + +func (c *APEOverride) Unmarshal(data []byte) error { + return message.Unmarshal(c, data, new(acl.BearerToken_Body_APEOverride)) +} + func (bt *BearerTokenBody) StableMarshal(buf []byte) []byte { if bt == nil { return []byte{} @@ -253,7 +293,8 @@ func (bt *BearerTokenBody) StableMarshal(buf []byte) []byte { offset += protoutil.NestedStructureMarshal(bearerTokenBodyACLField, buf[offset:], bt.eacl) offset += protoutil.NestedStructureMarshal(bearerTokenBodyOwnerField, buf[offset:], bt.ownerID) offset += protoutil.NestedStructureMarshal(bearerTokenBodyLifetimeField, buf[offset:], bt.lifetime) - protoutil.BoolMarshal(bearerTokenBodyImpersonate, buf[offset:], bt.impersonate) + offset += protoutil.BoolMarshal(bearerTokenBodyImpersonate, buf[offset:], bt.impersonate) + protoutil.NestedStructureMarshal(bearerTokenTokenAPEChainsField, buf[offset:], bt.apeOverride) return buf } @@ -267,6 +308,7 @@ func (bt *BearerTokenBody) StableSize() (size int) { size += protoutil.NestedStructureSize(bearerTokenBodyOwnerField, bt.ownerID) size += protoutil.NestedStructureSize(bearerTokenBodyLifetimeField, bt.lifetime) size += protoutil.BoolSize(bearerTokenBodyImpersonate, bt.impersonate) + size += protoutil.NestedStructureSize(bearerTokenTokenAPEChainsField, bt.apeOverride) return size } diff --git a/acl/test/generate.go b/acl/test/generate.go index 3151c52..30a960a 100644 --- a/acl/test/generate.go +++ b/acl/test/generate.go @@ -2,6 +2,7 @@ package acltest import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" + apetest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/test" accountingtest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" ) @@ -22,8 +23,20 @@ func GenerateBearerTokenBody(empty bool) *acl.BearerTokenBody { if !empty { m.SetOwnerID(accountingtest.GenerateOwnerID(false)) - m.SetEACL(GenerateTable(false)) m.SetLifetime(GenerateTokenLifetime(false)) + m.SetAPEOverride(GenerateAPEOverride(empty)) + } + + return m +} + +func GenerateAPEOverride(empty bool) *acl.APEOverride { + var m *acl.APEOverride + + if !empty { + m = new(acl.APEOverride) + m.SetTarget(apetest.GenerateChainTarget(empty)) + m.SetChains(apetest.GenerateRawChains(false, 3)) } return m diff --git a/acl/types.go b/acl/types.go index 1524e7b..b42528b 100644 --- a/acl/types.go +++ b/acl/types.go @@ -1,6 +1,9 @@ package acl -import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" +import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" +) // HeaderFilter is a unified structure of FilterInfo // message from proto definition. @@ -46,6 +49,12 @@ type TokenLifetime struct { exp, nbf, iat uint64 } +type APEOverride struct { + target *ape.ChainTarget + + chains []*ape.Chain +} + type BearerTokenBody struct { eacl *Table @@ -53,6 +62,8 @@ type BearerTokenBody struct { lifetime *TokenLifetime + apeOverride *APEOverride + impersonate bool } @@ -318,6 +329,34 @@ func (bt *BearerTokenBody) SetEACL(v *Table) { bt.eacl = v } +func (t *APEOverride) GetTarget() *ape.ChainTarget { + return t.target +} + +func (t *APEOverride) GetChains() []*ape.Chain { + return t.chains +} + +func (t *APEOverride) SetTarget(v *ape.ChainTarget) { + t.target = v +} + +func (t *APEOverride) SetChains(v []*ape.Chain) { + t.chains = v +} + +func (bt *BearerTokenBody) GetAPEOverride() *APEOverride { + if bt != nil { + return bt.apeOverride + } + + return nil +} + +func (bt *BearerTokenBody) SetAPEOverride(v *APEOverride) { + bt.apeOverride = v +} + func (bt *BearerTokenBody) GetOwnerID() *refs.OwnerID { if bt != nil { return bt.ownerID From 2f6d3209e1d3087b480f85a252ea5c9970e68e8e Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 27 May 2024 12:13:49 +0300 Subject: [PATCH 103/169] [#84] object: Regenerate EC-header type Signed-off-by: Airat Arifullin --- object/convert.go | 5 ++ object/grpc/types.pb.go | 129 ++++++++++++++++++++++------------------ object/marshal.go | 9 ++- object/test/generate.go | 1 + object/types.go | 1 + 5 files changed, 87 insertions(+), 58 deletions(-) diff --git a/object/convert.go b/object/convert.go index 99047dc..6e8ecff 100644 --- a/object/convert.go +++ b/object/convert.go @@ -271,6 +271,7 @@ func (h *ECHeader) ToGRPCMessage() grpc.Message { 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 @@ -318,6 +319,10 @@ func (h *ECHeader) FromGRPCMessage(m grpc.Message) error { } } + if h.ParentAttributes, err = AttributesFromGRPC(v.GetParentAttributes()); err != nil { + return err + } + h.Index = v.GetIndex() h.Total = v.GetTotal() h.Header = v.GetHeader() diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 3cb44a3..16736e9 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -831,6 +831,8 @@ type Header_EC struct { // if an object ID of its parent is presented. The field allows to determine how EC-chunk is placed // in Split hierarchy. ParentSplitParentId *grpc.ObjectID `protobuf:"bytes,7,opt,name=parent_split_parent_id,json=parentSplitParentID,proto3" json:"parent_split_parent_id,omitempty"` + // EC parent's attributes. + ParentAttributes []*Header_Attribute `protobuf:"bytes,8,rep,name=parent_attributes,json=parentAttributes,proto3" json:"parent_attributes,omitempty"` } func (x *Header_EC) Reset() { @@ -914,6 +916,13 @@ func (x *Header_EC) GetParentSplitParentId() *grpc.ObjectID { return nil } +func (x *Header_EC) GetParentAttributes() []*Header_Attribute { + if x != nil { + return x.ParentAttributes + } + return nil +} + type ECInfo_Chunk struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1013,7 +1022,7 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x52, 0x0f, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x48, 0x61, - 0x73, 0x68, 0x22, 0xc1, 0x0a, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, + 0x73, 0x68, 0x22, 0x92, 0x0b, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 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, @@ -1079,7 +1088,7 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x1a, 0x96, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x1a, 0xe7, 0x02, 0x0a, 0x02, 0x45, 0x43, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, @@ -1097,56 +1106,61 @@ var file_object_grpc_types_proto_rawDesc = []byte{ 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x22, 0xc4, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x72, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x4f, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0xc4, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, + 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8b, + 0x01, 0x0a, 0x09, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, + 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, + 0x70, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, + 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x9f, 0x01, 0x0a, + 0x06, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, + 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, + 0x6f, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x1a, + 0x5d, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8b, 0x01, - 0x0a, 0x09, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x73, - 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, - 0x70, 0x6c, 0x69, 0x74, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, - 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x49, 0x44, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, 0x0a, - 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x9f, 0x01, 0x0a, 0x06, - 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, - 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x1a, 0x5d, - 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2a, 0x32, 0x0a, - 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, - 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, 0x42, - 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, 0x10, - 0x03, 0x2a, 0x73, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, - 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, - 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, - 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, - 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, - 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, 0x52, - 0x45, 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, - 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, - 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, - 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2a, 0x32, + 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, + 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, + 0x42, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, + 0x10, 0x03, 0x2a, 0x73, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, + 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, + 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, + 0x4c, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, + 0x4e, 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, + 0x52, 0x45, 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, + 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, + 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, + 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1212,12 +1226,13 @@ var file_object_grpc_types_proto_depIdxs = []int32{ 16, // 25: neo.fs.v2.object.Header.Split.children:type_name -> neo.fs.v2.refs.ObjectID 16, // 26: neo.fs.v2.object.Header.EC.parent:type_name -> neo.fs.v2.refs.ObjectID 16, // 27: neo.fs.v2.object.Header.EC.parent_split_parent_id:type_name -> neo.fs.v2.refs.ObjectID - 16, // 28: neo.fs.v2.object.ECInfo.Chunk.id:type_name -> neo.fs.v2.refs.ObjectID - 29, // [29:29] is the sub-list for method output_type - 29, // [29:29] is the sub-list for method input_type - 29, // [29:29] is the sub-list for extension type_name - 29, // [29:29] is the sub-list for extension extendee - 0, // [0:29] is the sub-list for field type_name + 7, // 28: neo.fs.v2.object.Header.EC.parent_attributes:type_name -> neo.fs.v2.object.Header.Attribute + 16, // 29: neo.fs.v2.object.ECInfo.Chunk.id:type_name -> neo.fs.v2.refs.ObjectID + 30, // [30:30] is the sub-list for method output_type + 30, // [30:30] is the sub-list for method input_type + 30, // [30:30] is the sub-list for extension type_name + 30, // [30:30] is the sub-list for extension extendee + 0, // [0:30] is the sub-list for field type_name } func init() { file_object_grpc_types_proto_init() } diff --git a/object/marshal.go b/object/marshal.go index bf8fcb9..f96b098 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -33,6 +33,7 @@ const ( ecHdrHeaderField = 5 ecHdrParentSplitID = 6 ecHdrParentSplitParentID = 7 + ecHdrParentAttributes = 8 hdrVersionField = 1 hdrContainerIDField = 2 @@ -264,7 +265,10 @@ func (h *ECHeader) StableMarshal(buf []byte) []byte { offset += proto.UInt32Marshal(ecHdrHeaderLengthField, buf[offset:], h.HeaderLength) offset += proto.BytesMarshal(ecHdrHeaderField, buf[offset:], h.Header) offset += proto.BytesMarshal(ecHdrParentSplitID, buf[offset:], h.ParentSplitID) - proto.NestedStructureMarshal(ecHdrParentSplitParentID, buf[offset:], h.ParentSplitParentID) + offset += proto.NestedStructureMarshal(ecHdrParentSplitParentID, buf[offset:], h.ParentSplitParentID) + for i := range h.ParentAttributes { + offset += proto.NestedStructureMarshal(ecHdrParentAttributes, buf[offset:], &h.ParentAttributes[i]) + } return buf } @@ -280,6 +284,9 @@ func (h *ECHeader) StableSize() (size int) { size += proto.BytesSize(ecHdrHeaderField, h.Header) size += proto.BytesSize(ecHdrParentSplitID, h.ParentSplitID) size += proto.NestedStructureSize(ecHdrParentSplitParentID, h.ParentSplitParentID) + for i := range h.ParentAttributes { + size += proto.NestedStructureSize(ecHdrParentAttributes, &h.ParentAttributes[i]) + } return size } diff --git a/object/test/generate.go b/object/test/generate.go index 95c76e5..b1931fc 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -93,6 +93,7 @@ func GenerateECHeader(empty bool) *object.ECHeader { ech.Parent = refstest.GenerateObjectID(empty) ech.ParentSplitID = []byte{1, 2, 3} ech.ParentSplitParentID = refstest.GenerateObjectID(empty) + ech.ParentAttributes = GenerateAttributes(empty) ech.Index = 0 ech.Total = 2 ech.Header = []byte("chunk of ec-encoded parent header") diff --git a/object/types.go b/object/types.go index 7916b1e..43caf80 100644 --- a/object/types.go +++ b/object/types.go @@ -43,6 +43,7 @@ type ECHeader struct { Parent *refs.ObjectID ParentSplitID []byte ParentSplitParentID *refs.ObjectID + ParentAttributes []Attribute Index uint32 Total uint32 Header []byte From dafc9e5476babcb0026b702161987114c25e94c3 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 24 Jun 2024 11:53:26 +0300 Subject: [PATCH 104/169] [#86] status: Regenerate common status * INVALID_ARGUMENT is a new common status constant. Signed-off-by: Airat Arifullin --- status/grpc/types.pb.go | 76 ++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/status/grpc/types.pb.go b/status/grpc/types.pb.go index 64a0835..31f6373 100644 --- a/status/grpc/types.pb.go +++ b/status/grpc/types.pb.go @@ -149,6 +149,9 @@ const ( 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. @@ -158,12 +161,14 @@ var ( 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, } ) @@ -590,41 +595,42 @@ var file_status_grpc_types_proto_rawDesc = []byte{ 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, 0x6f, 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, 0x2a, 0x88, 0x01, 0x0a, 0x06, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, - 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x42, 0x4a, 0x45, 0x43, - 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, - 0x06, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x4c, 0x4f, 0x43, - 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x4f, 0x42, - 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, - 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, - 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, - 0x47, 0x45, 0x10, 0x05, 0x2a, 0x55, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, - 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x41, - 0x43, 0x4c, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x1b, - 0x0a, 0x17, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, - 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x31, 0x0a, 0x07, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, - 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, - 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x2b, - 0x0a, 0x0a, 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, - 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, - 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x42, 0x61, 0x5a, 0x42, 0x67, - 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, - 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, - 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x2a, 0x85, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, + 0x4e, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x57, 0x52, 0x4f, 0x4e, 0x47, 0x5f, 0x4d, + 0x41, 0x47, 0x49, 0x43, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1f, 0x0a, + 0x1b, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x02, 0x12, 0x1a, + 0x0a, 0x16, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x4d, 0x41, 0x49, + 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4e, + 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x04, + 0x2a, 0x88, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x41, + 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, + 0x0a, 0x10, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, + 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, + 0x12, 0x1b, 0x0a, 0x17, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x47, + 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x1a, 0x0a, + 0x16, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, + 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, 0x54, + 0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x2a, 0x55, 0x0a, 0x09, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x54, + 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, + 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x41, 0x43, 0x4c, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, + 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, + 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, + 0x10, 0x02, 0x2a, 0x31, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, + 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, + 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49, + 0x52, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x2b, 0x0a, 0x0a, 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, + 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, + 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, + 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 3f92d7bfb05805216262e720651ec3bb40e532b5 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 Jul 2024 17:36:40 +0300 Subject: [PATCH 105/169] [#90] proto/test: Fix proto file formatting Signed-off-by: Evgenii Stratonikov --- util/proto/test/test.proto | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/util/proto/test/test.proto b/util/proto/test/test.proto index 65e350f..aa980e9 100644 --- a/util/proto/test/test.proto +++ b/util/proto/test/test.proto @@ -5,30 +5,30 @@ package test; option go_package = "util/proto/test"; message Primitives { - bytes field_a = 1; - string field_b = 2; - bool field_c = 200; - int32 field_d = 201; - uint32 field_e = 202; - int64 field_f = 203; - uint64 field_g = 204; - fixed64 field_i = 205; - double field_j = 206; - fixed32 field_k = 207; + bytes field_a = 1; + string field_b = 2; + bool field_c = 200; + int32 field_d = 201; + uint32 field_e = 202; + int64 field_f = 203; + uint64 field_g = 204; + fixed64 field_i = 205; + double field_j = 206; + fixed32 field_k = 207; - enum SomeEnum { - UNKNOWN = 0; - POSITIVE = 1; - NEGATIVE = -1; - } - SomeEnum field_h = 300; + enum SomeEnum { + UNKNOWN = 0; + POSITIVE = 1; + NEGATIVE = -1; + } + SomeEnum field_h = 300; } message RepPrimitives { - repeated bytes field_a = 1; - repeated string field_b = 2; - repeated int32 field_c = 3; - repeated uint32 field_d = 4; - repeated int64 field_e = 5; - repeated uint64 field_f = 6; + repeated bytes field_a = 1; + repeated string field_b = 2; + repeated int32 field_c = 3; + repeated uint32 field_d = 4; + repeated int64 field_e = 5; + repeated uint64 field_f = 6; } From 610c450a655e812a81ee57ccc2c1f0751b273a2f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 Jul 2024 17:45:29 +0300 Subject: [PATCH 106/169] [#90] proto/test: Fix go vet warnings Signed-off-by: Evgenii Stratonikov --- util/proto/marshal_test.go | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index 7119c8f..f23641d 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -439,7 +439,7 @@ func TestFixed32Marshal(t *testing.T) { }) } -func testMarshal(t *testing.T, c stablePrimitives, tr test.Primitives, wrongField bool) *test.Primitives { +func testMarshal(t *testing.T, c stablePrimitives, tr *test.Primitives, wrongField bool) *test.Primitives { var ( wire []byte err error @@ -447,7 +447,7 @@ func testMarshal(t *testing.T, c stablePrimitives, tr test.Primitives, wrongFiel wire, err = c.stableMarshal(nil, wrongField) require.NoError(t, err) - wireGen, err := goproto.Marshal(&tr) + wireGen, err := goproto.Marshal(tr) require.NoError(t, err) if !wrongField { @@ -470,7 +470,7 @@ func testBytesMarshal(t *testing.T, data []byte, wrongField bool) { transport = test.Primitives{FieldA: data} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.Len(t, result.FieldA, len(data)) @@ -488,7 +488,7 @@ func testStringMarshal(t *testing.T, s string, wrongField bool) { transport = test.Primitives{FieldB: s} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.Len(t, result.FieldB, len(s)) @@ -506,7 +506,7 @@ func testBoolMarshal(t *testing.T, b bool, wrongField bool) { transport = test.Primitives{FieldC: b} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.Equal(t, b, result.FieldC) @@ -521,7 +521,7 @@ func testInt32Marshal(t *testing.T, n int32, wrongField bool) { transport = test.Primitives{FieldD: n} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.Equal(t, n, result.FieldD) @@ -536,7 +536,7 @@ func testUInt32Marshal(t *testing.T, n uint32, wrongField bool) { transport = test.Primitives{FieldE: n} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.Equal(t, n, result.FieldE) @@ -551,7 +551,7 @@ func testInt64Marshal(t *testing.T, n int64, wrongField bool) { transport = test.Primitives{FieldF: n} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.Equal(t, n, result.FieldF) @@ -566,7 +566,7 @@ func testUInt64Marshal(t *testing.T, n uint64, wrongField bool) { transport = test.Primitives{FieldG: n} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.Equal(t, n, result.FieldG) @@ -581,7 +581,7 @@ func testFloat64Marshal(t *testing.T, n float64, wrongField bool) { transport = test.Primitives{FieldJ: n} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.Equal(t, n, result.FieldJ) @@ -596,7 +596,7 @@ func testEnumMarshal(t *testing.T, e SomeEnum, wrongField bool) { transport = test.Primitives{FieldH: test.Primitives_SomeEnum(e)} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.EqualValues(t, custom.FieldH, result.FieldH) @@ -605,7 +605,7 @@ func testEnumMarshal(t *testing.T, e SomeEnum, wrongField bool) { } } -func testRepMarshal(t *testing.T, c stableRepPrimitives, tr test.RepPrimitives, wrongField bool) *test.RepPrimitives { +func testRepMarshal(t *testing.T, c stableRepPrimitives, tr *test.RepPrimitives, wrongField bool) *test.RepPrimitives { var ( wire []byte err error @@ -613,7 +613,7 @@ func testRepMarshal(t *testing.T, c stableRepPrimitives, tr test.RepPrimitives, wire, err = c.stableMarshal(nil, wrongField) require.NoError(t, err) - wireGen, err := goproto.Marshal(&tr) + wireGen, err := goproto.Marshal(tr) require.NoError(t, err) if !wrongField { @@ -636,7 +636,7 @@ func testRepeatedBytesMarshal(t *testing.T, data [][]byte, wrongField bool) { transport = test.RepPrimitives{FieldA: data} ) - result := testRepMarshal(t, custom, transport, wrongField) + result := testRepMarshal(t, custom, &transport, wrongField) if !wrongField { require.Len(t, result.FieldA, len(data)) @@ -654,7 +654,7 @@ func testRepeatedStringMarshal(t *testing.T, s []string, wrongField bool) { transport = test.RepPrimitives{FieldB: s} ) - result := testRepMarshal(t, custom, transport, wrongField) + result := testRepMarshal(t, custom, &transport, wrongField) if !wrongField { require.Len(t, result.FieldB, len(s)) @@ -672,7 +672,7 @@ func testRepeatedInt32Marshal(t *testing.T, n []int32, wrongField bool) { transport = test.RepPrimitives{FieldC: n} ) - result := testRepMarshal(t, custom, transport, wrongField) + result := testRepMarshal(t, custom, &transport, wrongField) if !wrongField { require.Len(t, result.FieldC, len(n)) @@ -690,7 +690,7 @@ func testRepeatedUInt32Marshal(t *testing.T, n []uint32, wrongField bool) { transport = test.RepPrimitives{FieldD: n} ) - result := testRepMarshal(t, custom, transport, wrongField) + result := testRepMarshal(t, custom, &transport, wrongField) if !wrongField { require.Len(t, result.FieldD, len(n)) @@ -708,7 +708,7 @@ func testRepeatedInt64Marshal(t *testing.T, n []int64, wrongField bool) { transport = test.RepPrimitives{FieldE: n} ) - result := testRepMarshal(t, custom, transport, wrongField) + result := testRepMarshal(t, custom, &transport, wrongField) if !wrongField { require.Len(t, result.FieldE, len(n)) @@ -726,7 +726,7 @@ func testRepeatedUInt64Marshal(t *testing.T, n []uint64, wrongField bool) { transport = test.RepPrimitives{FieldF: n} ) - result := testRepMarshal(t, custom, transport, wrongField) + result := testRepMarshal(t, custom, &transport, wrongField) if !wrongField { require.Len(t, result.FieldF, len(n)) @@ -744,7 +744,7 @@ func testFixed64Marshal(t *testing.T, n uint64, wrongField bool) { transport = test.Primitives{FieldI: n} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.Equal(t, n, result.FieldI) @@ -759,7 +759,7 @@ func testFixed32Marshal(t *testing.T, n uint32, wrongField bool) { transport = test.Primitives{FieldK: n} ) - result := testMarshal(t, custom, transport, wrongField) + result := testMarshal(t, custom, &transport, wrongField) if !wrongField { require.Equal(t, n, result.FieldK) From 3639563d80684a158189e10a0522555001073240 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 Jul 2024 17:46:06 +0300 Subject: [PATCH 107/169] [#90] apemanager: Run gofumpt Signed-off-by: Evgenii Stratonikov --- apemanager/types.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apemanager/types.go b/apemanager/types.go index 6896bf1..21edf85 100644 --- a/apemanager/types.go +++ b/apemanager/types.go @@ -109,8 +109,7 @@ type RemoveChainResponse struct { session.ResponseHeaders } -type RemoveChainResponseBody struct { -} +type RemoveChainResponseBody struct{} func (r *RemoveChainResponse) SetBody(body *RemoveChainResponseBody) { r.body = body From f517e3949164d072b456c8f561b9c67012114a69 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 15 Jul 2024 11:16:29 +0300 Subject: [PATCH 108/169] [#91] protogen: Support unpacked repeated uint64 fields Signed-off-by: Evgenii Stratonikov --- util/proto/marshal_test.go | 59 +++++++++++++++++++++++++++++++++++++- util/proto/test/test.pb.go | 32 ++++++++++++++------- util/proto/test/test.proto | 1 + util/protogen/main.go | 38 ++++++++++++++++++++---- 4 files changed, 113 insertions(+), 17 deletions(-) diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index f23641d..c2a0f8e 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -1,12 +1,14 @@ package proto_test import ( + "encoding/binary" "math" "testing" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/encoding/protowire" goproto "google.golang.org/protobuf/proto" ) @@ -33,6 +35,8 @@ type stableRepPrimitives struct { FieldD []uint32 FieldE []int64 FieldF []uint64 + + FieldFu []uint64 } const ( @@ -185,6 +189,20 @@ func (s *stableRepPrimitives) stableMarshal(buf []byte, wrongField bool) ([]byte } i += proto.RepeatedUInt64Marshal(fieldNum, buf, s.FieldF) + fieldNum = 7 + if wrongField { + fieldNum++ + } + for j := range s.FieldFu { + { + prefix := protowire.EncodeTag( + protowire.Number(fieldNum), + protowire.VarintType) + i += binary.PutUvarint(buf[i:], uint64(prefix)) + i += binary.PutUvarint(buf[i:], s.FieldFu[j]) + } + } + return buf, nil } @@ -196,7 +214,12 @@ func (s *stableRepPrimitives) stableSize() int { f5, _ := proto.RepeatedInt64Size(5, s.FieldE) f6, _ := proto.RepeatedUInt64Size(6, s.FieldF) - return f1 + f2 + f3 + f4 + f5 + f6 + var f7 int + for i := range s.FieldFu { + f7 += protowire.SizeGroup(protowire.Number(7), protowire.SizeVarint(s.FieldFu[i])) + } + + return f1 + f2 + f3 + f4 + f5 + f6 + f7 } func TestBytesMarshal(t *testing.T) { @@ -404,6 +427,22 @@ func TestRepeatedUInt64Marshal(t *testing.T) { }) } +func TestRepeatedUInt64MarshalUnpacked(t *testing.T) { + t.Run("not empty", func(t *testing.T) { + data := []uint64{0, 1, 2, 3, 4, 5} + testRepeatedUInt64MarshalUnpacked(t, data, false) + testRepeatedUInt64MarshalUnpacked(t, data, true) + }) + + t.Run("empty", func(t *testing.T) { + testRepeatedUInt64MarshalUnpacked(t, []uint64{}, false) + }) + + t.Run("nil", func(t *testing.T) { + testRepeatedUInt64MarshalUnpacked(t, nil, false) + }) +} + func TestFixed64Marshal(t *testing.T) { t.Run("zero", func(t *testing.T) { testFixed64Marshal(t, 0, false) @@ -738,6 +777,24 @@ func testRepeatedUInt64Marshal(t *testing.T, n []uint64, wrongField bool) { } } +func testRepeatedUInt64MarshalUnpacked(t *testing.T, n []uint64, wrongField bool) { + var ( + custom = stableRepPrimitives{FieldFu: n} + transport = test.RepPrimitives{FieldFu: n} + ) + + result := testRepMarshal(t, custom, &transport, wrongField) + + if !wrongField { + require.Len(t, result.FieldFu, len(n)) + if len(n) > 0 { + require.Equal(t, n, result.FieldFu) + } + } else { + require.Len(t, result.FieldFu, 0) + } +} + func testFixed64Marshal(t *testing.T, n uint64, wrongField bool) { var ( custom = stablePrimitives{FieldI: n} diff --git a/util/proto/test/test.pb.go b/util/proto/test/test.pb.go index 0b9f43d..57f7fb0 100644 --- a/util/proto/test/test.pb.go +++ b/util/proto/test/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: util/proto/test/test.proto package test @@ -201,12 +201,13 @@ type RepPrimitives struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FieldA [][]byte `protobuf:"bytes,1,rep,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"` - FieldB []string `protobuf:"bytes,2,rep,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"` - FieldC []int32 `protobuf:"varint,3,rep,packed,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"` - FieldD []uint32 `protobuf:"varint,4,rep,packed,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"` - FieldE []int64 `protobuf:"varint,5,rep,packed,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"` - FieldF []uint64 `protobuf:"varint,6,rep,packed,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"` + FieldA [][]byte `protobuf:"bytes,1,rep,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"` + FieldB []string `protobuf:"bytes,2,rep,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"` + FieldC []int32 `protobuf:"varint,3,rep,packed,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"` + FieldD []uint32 `protobuf:"varint,4,rep,packed,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"` + FieldE []int64 `protobuf:"varint,5,rep,packed,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"` + FieldF []uint64 `protobuf:"varint,6,rep,packed,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"` + FieldFu []uint64 `protobuf:"varint,7,rep,name=field_fu,json=fieldFu,proto3" json:"field_fu,omitempty"` } func (x *RepPrimitives) Reset() { @@ -283,6 +284,13 @@ func (x *RepPrimitives) GetFieldF() []uint64 { return nil } +func (x *RepPrimitives) GetFieldFu() []uint64 { + if x != nil { + return x.FieldFu + } + return nil +} + var File_util_proto_test_test_proto protoreflect.FileDescriptor var file_util_proto_test_test_proto_rawDesc = []byte{ @@ -312,7 +320,7 @@ var file_util_proto_test_test_proto_rawDesc = []byte{ 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x08, 0x4e, 0x45, 0x47, 0x41, 0x54, 0x49, 0x56, 0x45, 0x10, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x22, 0xa5, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x50, 0x72, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x22, 0xc4, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x18, 0x02, 0x20, 0x03, @@ -322,9 +330,11 @@ var file_util_proto_test_test_proto_rawDesc = []byte{ 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x42, 0x11, - 0x5a, 0x0f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x12, 0x1d, + 0x0a, 0x08, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, 0x75, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, + 0x42, 0x02, 0x10, 0x00, 0x52, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x75, 0x42, 0x11, 0x5a, + 0x0f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/util/proto/test/test.proto b/util/proto/test/test.proto index aa980e9..14f6ac2 100644 --- a/util/proto/test/test.proto +++ b/util/proto/test/test.proto @@ -31,4 +31,5 @@ message RepPrimitives { repeated uint32 field_d = 4; repeated int64 field_e = 5; repeated uint64 field_f = 6; + repeated uint64 field_fu = 7 [ packed = false ]; } diff --git a/util/protogen/main.go b/util/protogen/main.go index a295a28..85c6ded 100644 --- a/util/protogen/main.go +++ b/util/protogen/main.go @@ -8,6 +8,11 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" ) +var ( + protowirePackage = protogen.GoImportPath("google.golang.org/protobuf/encoding/protowire") + binaryPackage = protogen.GoImportPath("encoding/binary") +) + func main() { protogen.Options{}.Run(func(gen *protogen.Plugin) error { for _, f := range gen.Files { @@ -62,7 +67,7 @@ func emitMessage(g *protogen.GeneratedFile, msg *protogen.Message) { g.P("if x == nil { return 0 }") if len(fs) != 0 { for _, f := range fs { - if f.Desc.IsList() && marshalers[f.Desc.Kind()].RepeatedDouble { + if f.Desc.IsList() && marshalers[f.Desc.Kind()].RepeatedDouble && !(f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()) { g.P("var n int") break } @@ -140,9 +145,19 @@ func emitFieldSize(g *protogen.GeneratedFile, f *protogen.Field) { } switch { - case f.Desc.IsList() && f.Desc.Kind() == protoreflect.MessageKind: + case f.Desc.IsList() && (f.Desc.Kind() == protoreflect.MessageKind || f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()): g.P("for i := range ", name, "{") - g.P("size += proto.NestedStructureSize(", f.Desc.Number(), ", ", name, "[i])") + if f.Desc.Kind() == protoreflect.MessageKind { + g.P("size += proto.NestedStructureSize(", f.Desc.Number(), ", ", name, "[i])") + } else { + if f.Desc.Kind() != protoreflect.Uint64Kind { + panic("only uint64 unpacked primitive is supported") + } + + g.P("size += ", protowirePackage.Ident("SizeGroup"), "(", + protowirePackage.Ident("Number"), "(", f.Desc.Number(), "), ", + protowirePackage.Ident("SizeVarint"), "(", name, "[i]))") + } g.P("}") case f.Desc.IsList(): if m.RepeatedDouble { @@ -177,9 +192,22 @@ func emitFieldMarshal(g *protogen.GeneratedFile, f *protogen.Field) { prefix = "Repeated" + m.Prefix } switch { - case f.Desc.IsList() && f.Desc.Kind() == protoreflect.MessageKind: + case f.Desc.IsList() && (f.Desc.Kind() == protoreflect.MessageKind || f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()): g.P("for i := range ", name, "{") - g.P("offset += proto.NestedStructureMarshal(", f.Desc.Number(), ", buf[offset:], ", name, "[i])") + if f.Desc.Kind() == protoreflect.MessageKind { + g.P("offset += proto.NestedStructureMarshal(", f.Desc.Number(), ", buf[offset:], ", name, "[i])") + } else { + if f.Desc.Kind() != protoreflect.Uint64Kind { + panic("only uint64 unpacked primitive is supported") + } + g.P("{") + g.P("prefix := ", protowirePackage.Ident("EncodeTag"), "(", + protowirePackage.Ident("Number"), "(", f.Desc.Number(), "), ", + protowirePackage.Ident("VarintType"), ")") + g.P("offset += ", binaryPackage.Ident("PutUvarint"), "(buf[offset:], uint64(prefix))") + g.P("offset += ", binaryPackage.Ident("PutUvarint"), "(buf[offset:], ", name, "[i])") + g.P("}") + } g.P("}") case f.Desc.IsList(): g.P("offset += proto.Repeated", m.Prefix, "Marshal(", f.Desc.Number(), ", buf[offset:], ", name, ")") From 3dfa2f4fd65ed386611f06e31d16f5f755e963bc Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 26 Jul 2024 10:15:06 +0300 Subject: [PATCH 109/169] [#95] *: Regenerate proto files Remove SetExtendedEACL and AnnounceUsedSpace methods from the container package. Signed-off-by: Evgenii Stratonikov --- accounting/grpc/service.pb.go | 2 +- accounting/grpc/service_grpc.pb.go | 2 +- accounting/grpc/types.pb.go | 2 +- acl/grpc/types.pb.go | 14 +- ape/grpc/types.pb.go | 2 +- apemanager/grpc/service.pb.go | 2 +- apemanager/grpc/service_grpc.pb.go | 2 +- container/convert.go | 340 -------- container/grpc/service.go | 90 --- container/grpc/service.pb.go | 1164 +++++----------------------- container/grpc/service_grpc.pb.go | 118 +-- container/grpc/types.pb.go | 2 +- container/marshal.go | 133 ---- container/message_test.go | 7 - container/test/generate.go | 111 --- container/types.go | 168 ---- lock/grpc/types.pb.go | 2 +- netmap/grpc/service.pb.go | 2 +- netmap/grpc/service_grpc.pb.go | 2 +- netmap/grpc/types.pb.go | 2 +- object/grpc/service.pb.go | 6 +- object/grpc/service_grpc.pb.go | 2 +- object/grpc/types.pb.go | 13 +- refs/grpc/types.pb.go | 2 +- rpc/container.go | 33 - session/grpc/service.pb.go | 2 +- session/grpc/service_grpc.pb.go | 2 +- session/grpc/types.pb.go | 2 +- signature/body.go | 8 - status/grpc/types.pb.go | 5 +- tombstone/grpc/types.pb.go | 2 +- 31 files changed, 238 insertions(+), 2006 deletions(-) diff --git a/accounting/grpc/service.pb.go b/accounting/grpc/service.pb.go index fe193cd..b66bb7a 100644 --- a/accounting/grpc/service.pb.go +++ b/accounting/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: accounting/grpc/service.proto package accounting diff --git a/accounting/grpc/service_grpc.pb.go b/accounting/grpc/service_grpc.pb.go index cd1b2e9..63207fe 100644 --- a/accounting/grpc/service_grpc.pb.go +++ b/accounting/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.3 +// - protoc v5.27.2 // source: accounting/grpc/service.proto package accounting diff --git a/accounting/grpc/types.pb.go b/accounting/grpc/types.pb.go index 592aa8b..8be14bc 100644 --- a/accounting/grpc/types.pb.go +++ b/accounting/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: accounting/grpc/types.proto package accounting diff --git a/acl/grpc/types.pb.go b/acl/grpc/types.pb.go index aec449c..39ab1e1 100644 --- a/acl/grpc/types.pb.go +++ b/acl/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: acl/grpc/types.proto package acl @@ -709,7 +709,8 @@ type BearerToken_Body struct { // valid for this specific container. Otherwise, any container of the same // owner is allowed. // - // Deprecated: eACL tables are no longer relevant - `APEOverrides` should be used instead. + // Deprecated: eACL tables are no longer relevant - `APEOverrides` should be + // used instead. EaclTable *EACLTable `protobuf:"bytes,1,opt,name=eacl_table,json=eaclTable,proto3" json:"eacl_table,omitempty"` // `OwnerID` defines to whom the token was issued. It must match the request // originator's `OwnerID`. If empty, any token bearer will be accepted. @@ -859,11 +860,12 @@ func (x *BearerToken_Body_TokenLifetime) GetIat() uint64 { } // APEOverride is the list of APE chains defined for a target. -// These chains are meant to serve as overrides to the already defined (or even undefined) -// APE chains for the target (see contract `Policy`). +// These chains are meant to serve as overrides to the already defined (or +// even undefined) APE chains for the target (see contract `Policy`). // -// The server-side processing of the bearer token with set APE overrides must verify if a client is permitted -// to override chains for the target, preventing unauthorized access through the APE mechanism. +// The server-side processing of the bearer token with set APE overrides +// must verify if a client is permitted to override chains for the target, +// preventing unauthorized access through the APE mechanism. type BearerToken_Body_APEOverride struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/ape/grpc/types.pb.go b/ape/grpc/types.pb.go index 1da2110..ee8e0a7 100644 --- a/ape/grpc/types.pb.go +++ b/ape/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: ape/grpc/types.proto package ape diff --git a/apemanager/grpc/service.pb.go b/apemanager/grpc/service.pb.go index 7757aad..3baf193 100644 --- a/apemanager/grpc/service.pb.go +++ b/apemanager/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: apemanager/grpc/service.proto package apemanager diff --git a/apemanager/grpc/service_grpc.pb.go b/apemanager/grpc/service_grpc.pb.go index 484fec5..4781427 100644 --- a/apemanager/grpc/service_grpc.pb.go +++ b/apemanager/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.3 +// - protoc v5.27.2 // source: apemanager/grpc/service.proto package apemanager diff --git a/container/convert.go b/container/convert.go index 0753755..c5f9cd7 100644 --- a/container/convert.go +++ b/container/convert.go @@ -767,151 +767,6 @@ func (r *ListResponse) FromGRPCMessage(m grpc.Message) error { return r.ResponseHeaders.FromMessage(v) } -func (r *SetExtendedACLRequestBody) ToGRPCMessage() grpc.Message { - var m *container.SetExtendedACLRequest_Body - - if r != nil { - m = new(container.SetExtendedACLRequest_Body) - - m.SetEacl(r.eacl.ToGRPCMessage().(*aclGRPC.EACLTable)) - m.SetSignature(toSignatureRFC6979(r.sig)) - } - - return m -} - -func (r *SetExtendedACLRequestBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.SetExtendedACLRequest_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - eacl := v.GetEacl() - if eacl == nil { - r.eacl = nil - } else { - if r.eacl == nil { - r.eacl = new(acl.Table) - } - - err = r.eacl.FromGRPCMessage(eacl) - if err != nil { - return err - } - } - - sig := v.GetSignature() - if sig == nil { - r.sig = nil - } else { - if r.sig == nil { - r.sig = new(refs.Signature) - } - - r.sig.SetKey(sig.GetKey()) - r.sig.SetSign(sig.GetSign()) - } - - return err -} - -func (r *SetExtendedACLRequest) ToGRPCMessage() grpc.Message { - var m *container.SetExtendedACLRequest - - if r != nil { - m = new(container.SetExtendedACLRequest) - - m.SetBody(r.body.ToGRPCMessage().(*container.SetExtendedACLRequest_Body)) - r.RequestHeaders.ToMessage(m) - } - - return m -} - -func (r *SetExtendedACLRequest) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.SetExtendedACLRequest) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - body := v.GetBody() - if body == nil { - r.body = nil - } else { - if r.body == nil { - r.body = new(SetExtendedACLRequestBody) - } - - err = r.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - return r.RequestHeaders.FromMessage(v) -} - -func (r *SetExtendedACLResponseBody) ToGRPCMessage() grpc.Message { - var m *container.SetExtendedACLResponse_Body - - if r != nil { - m = new(container.SetExtendedACLResponse_Body) - } - - return m -} - -func (r *SetExtendedACLResponseBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.SetExtendedACLResponse_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - return nil -} - -func (r *SetExtendedACLResponse) ToGRPCMessage() grpc.Message { - var m *container.SetExtendedACLResponse - - if r != nil { - m = new(container.SetExtendedACLResponse) - - m.SetBody(r.body.ToGRPCMessage().(*container.SetExtendedACLResponse_Body)) - r.ResponseHeaders.ToMessage(m) - } - - return m -} - -func (r *SetExtendedACLResponse) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.SetExtendedACLResponse) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - body := v.GetBody() - if body == nil { - r.body = nil - } else { - if r.body == nil { - r.body = new(SetExtendedACLResponseBody) - } - - err = r.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - return r.ResponseHeaders.FromMessage(v) -} - func (r *GetExtendedACLRequestBody) ToGRPCMessage() grpc.Message { var m *container.GetExtendedACLRequest_Body @@ -1083,198 +938,3 @@ func (r *GetExtendedACLResponse) FromGRPCMessage(m grpc.Message) error { return r.ResponseHeaders.FromMessage(v) } - -func (a *UsedSpaceAnnouncement) ToGRPCMessage() grpc.Message { - var m *container.AnnounceUsedSpaceRequest_Body_Announcement - - if a != nil { - m = new(container.AnnounceUsedSpaceRequest_Body_Announcement) - - m.SetContainerId(a.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) - m.SetEpoch(a.epoch) - m.SetUsedSpace(a.usedSpace) - } - - return m -} - -func (a *UsedSpaceAnnouncement) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.AnnounceUsedSpaceRequest_Body_Announcement) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - cid := v.GetContainerId() - if cid == nil { - a.cid = nil - } else { - if a.cid == nil { - a.cid = new(refs.ContainerID) - } - - err = a.cid.FromGRPCMessage(cid) - if err != nil { - return err - } - } - - a.epoch = v.GetEpoch() - a.usedSpace = v.GetUsedSpace() - - return nil -} - -func UsedSpaceAnnouncementsToGRPCMessage( - ids []UsedSpaceAnnouncement, -) (res []*container.AnnounceUsedSpaceRequest_Body_Announcement) { - if ids != nil { - res = make([]*container.AnnounceUsedSpaceRequest_Body_Announcement, 0, len(ids)) - - for i := range ids { - res = append(res, ids[i].ToGRPCMessage().(*container.AnnounceUsedSpaceRequest_Body_Announcement)) - } - } - - return -} - -func UsedSpaceAnnouncementssFromGRPCMessage( - asV2 []*container.AnnounceUsedSpaceRequest_Body_Announcement, -) (res []UsedSpaceAnnouncement, err error) { - if asV2 != nil { - res = make([]UsedSpaceAnnouncement, len(asV2)) - - for i := range asV2 { - if asV2[i] != nil { - err = res[i].FromGRPCMessage(asV2[i]) - if err != nil { - return - } - } - } - } - - return -} - -func (r *AnnounceUsedSpaceRequestBody) ToGRPCMessage() grpc.Message { - var m *container.AnnounceUsedSpaceRequest_Body - - if r != nil { - m = new(container.AnnounceUsedSpaceRequest_Body) - - m.SetAnnouncements(UsedSpaceAnnouncementsToGRPCMessage(r.announcements)) - } - - return m -} - -func (r *AnnounceUsedSpaceRequestBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.AnnounceUsedSpaceRequest_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - r.announcements, err = UsedSpaceAnnouncementssFromGRPCMessage(v.GetAnnouncements()) - - return err -} - -func (r *AnnounceUsedSpaceRequest) ToGRPCMessage() grpc.Message { - var m *container.AnnounceUsedSpaceRequest - - if r != nil { - m = new(container.AnnounceUsedSpaceRequest) - - m.SetBody(r.body.ToGRPCMessage().(*container.AnnounceUsedSpaceRequest_Body)) - r.RequestHeaders.ToMessage(m) - } - - return m -} - -func (r *AnnounceUsedSpaceRequest) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.AnnounceUsedSpaceRequest) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - body := v.GetBody() - if body == nil { - r.body = nil - } else { - if r.body == nil { - r.body = new(AnnounceUsedSpaceRequestBody) - } - - err = r.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - return r.RequestHeaders.FromMessage(v) -} - -func (r *AnnounceUsedSpaceResponseBody) ToGRPCMessage() grpc.Message { - var m *container.AnnounceUsedSpaceResponse_Body - - if r != nil { - m = new(container.AnnounceUsedSpaceResponse_Body) - } - - return m -} - -func (r *AnnounceUsedSpaceResponseBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.AnnounceUsedSpaceResponse_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - return nil -} - -func (r *AnnounceUsedSpaceResponse) ToGRPCMessage() grpc.Message { - var m *container.AnnounceUsedSpaceResponse - - if r != nil { - m = new(container.AnnounceUsedSpaceResponse) - - m.SetBody(r.body.ToGRPCMessage().(*container.AnnounceUsedSpaceResponse_Body)) - r.ResponseHeaders.ToMessage(m) - } - - return m -} - -func (r *AnnounceUsedSpaceResponse) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.AnnounceUsedSpaceResponse) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - body := v.GetBody() - if body == nil { - r.body = nil - } else { - if r.body == nil { - r.body = new(AnnounceUsedSpaceResponseBody) - } - - err = r.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - return r.ResponseHeaders.FromMessage(v) -} diff --git a/container/grpc/service.go b/container/grpc/service.go index 050cf0b..d19add1 100644 --- a/container/grpc/service.go +++ b/container/grpc/service.go @@ -182,46 +182,6 @@ func (m *ListResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { m.VerifyHeader = v } -// SetEacl sets eACL table structure. -func (m *SetExtendedACLRequest_Body) SetEacl(v *acl.EACLTable) { - m.Eacl = v -} - -// SetSignature sets signature of the eACL table structure. -func (m *SetExtendedACLRequest_Body) SetSignature(v *refs.SignatureRFC6979) { - m.Signature = v -} - -// SetBody sets body of the request. -func (m *SetExtendedACLRequest) SetBody(v *SetExtendedACLRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *SetExtendedACLRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *SetExtendedACLRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetBody sets body of the response. -func (m *SetExtendedACLResponse) SetBody(v *SetExtendedACLResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *SetExtendedACLResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *SetExtendedACLResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - // SetContainerId sets identifier of the container. func (m *GetExtendedACLRequest_Body) SetContainerId(v *refs.ContainerID) { m.ContainerId = v @@ -272,53 +232,3 @@ func (m *GetExtendedACLResponse) SetMetaHeader(v *session.ResponseMetaHeader) { func (m *GetExtendedACLResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { m.VerifyHeader = v } - -// SetEpoch sets epoch of the size estimation. -func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetEpoch(v uint64) { - m.Epoch = v -} - -// SetContainerId sets identifier of the container. -func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetContainerId(v *refs.ContainerID) { - m.ContainerId = v -} - -// SetUsedSpace sets used space value of the container. -func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetUsedSpace(v uint64) { - m.UsedSpace = v -} - -// SetAnnouncements sets list of announcement for shared containers between nodes. -func (m *AnnounceUsedSpaceRequest_Body) SetAnnouncements(v []*AnnounceUsedSpaceRequest_Body_Announcement) { - m.Announcements = v -} - -// SetBody sets body of the request. -func (m *AnnounceUsedSpaceRequest) SetBody(v *AnnounceUsedSpaceRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *AnnounceUsedSpaceRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *AnnounceUsedSpaceRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetBody sets body of the response. -func (m *AnnounceUsedSpaceResponse) SetBody(v *AnnounceUsedSpaceResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *AnnounceUsedSpaceResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *AnnounceUsedSpaceResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} diff --git a/container/grpc/service.pb.go b/container/grpc/service.pb.go index 672e29f..3bf1e14 100644 --- a/container/grpc/service.pb.go +++ b/container/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: container/grpc/service.proto package container @@ -584,146 +584,6 @@ func (x *ListResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { return nil } -// Set Extended ACL -type SetExtendedACLRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of set extended acl request message. - Body *SetExtendedACLRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *SetExtendedACLRequest) Reset() { - *x = SetExtendedACLRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetExtendedACLRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetExtendedACLRequest) ProtoMessage() {} - -func (x *SetExtendedACLRequest) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetExtendedACLRequest.ProtoReflect.Descriptor instead. -func (*SetExtendedACLRequest) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{8} -} - -func (x *SetExtendedACLRequest) GetBody() *SetExtendedACLRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *SetExtendedACLRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *SetExtendedACLRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Set Extended ACL -type SetExtendedACLResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of set extended acl response message. - Body *SetExtendedACLResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *SetExtendedACLResponse) Reset() { - *x = SetExtendedACLResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetExtendedACLResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetExtendedACLResponse) ProtoMessage() {} - -func (x *SetExtendedACLResponse) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetExtendedACLResponse.ProtoReflect.Descriptor instead. -func (*SetExtendedACLResponse) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{9} -} - -func (x *SetExtendedACLResponse) GetBody() *SetExtendedACLResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *SetExtendedACLResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *SetExtendedACLResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - // Get Extended ACL type GetExtendedACLRequest struct { state protoimpl.MessageState @@ -744,7 +604,7 @@ type GetExtendedACLRequest struct { func (x *GetExtendedACLRequest) Reset() { *x = GetExtendedACLRequest{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[10] + mi := &file_container_grpc_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -757,7 +617,7 @@ func (x *GetExtendedACLRequest) String() string { func (*GetExtendedACLRequest) ProtoMessage() {} func (x *GetExtendedACLRequest) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[10] + mi := &file_container_grpc_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -770,7 +630,7 @@ func (x *GetExtendedACLRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetExtendedACLRequest.ProtoReflect.Descriptor instead. func (*GetExtendedACLRequest) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{10} + return file_container_grpc_service_proto_rawDescGZIP(), []int{8} } func (x *GetExtendedACLRequest) GetBody() *GetExtendedACLRequest_Body { @@ -814,7 +674,7 @@ type GetExtendedACLResponse struct { func (x *GetExtendedACLResponse) Reset() { *x = GetExtendedACLResponse{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[11] + mi := &file_container_grpc_service_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -827,7 +687,7 @@ func (x *GetExtendedACLResponse) String() string { func (*GetExtendedACLResponse) ProtoMessage() {} func (x *GetExtendedACLResponse) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[11] + mi := &file_container_grpc_service_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -840,7 +700,7 @@ func (x *GetExtendedACLResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetExtendedACLResponse.ProtoReflect.Descriptor instead. func (*GetExtendedACLResponse) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{11} + return file_container_grpc_service_proto_rawDescGZIP(), []int{9} } func (x *GetExtendedACLResponse) GetBody() *GetExtendedACLResponse_Body { @@ -864,146 +724,6 @@ func (x *GetExtendedACLResponse) GetVerifyHeader() *grpc.ResponseVerificationHea return nil } -// Announce container used space -type AnnounceUsedSpaceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of announce used space request message. - Body *AnnounceUsedSpaceRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *AnnounceUsedSpaceRequest) Reset() { - *x = AnnounceUsedSpaceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceUsedSpaceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceUsedSpaceRequest) ProtoMessage() {} - -func (x *AnnounceUsedSpaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceUsedSpaceRequest.ProtoReflect.Descriptor instead. -func (*AnnounceUsedSpaceRequest) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{12} -} - -func (x *AnnounceUsedSpaceRequest) GetBody() *AnnounceUsedSpaceRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *AnnounceUsedSpaceRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *AnnounceUsedSpaceRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Announce container used space -type AnnounceUsedSpaceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of announce used space response message. - Body *AnnounceUsedSpaceResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *AnnounceUsedSpaceResponse) Reset() { - *x = AnnounceUsedSpaceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceUsedSpaceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceUsedSpaceResponse) ProtoMessage() {} - -func (x *AnnounceUsedSpaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceUsedSpaceResponse.ProtoReflect.Descriptor instead. -func (*AnnounceUsedSpaceResponse) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{13} -} - -func (x *AnnounceUsedSpaceResponse) GetBody() *AnnounceUsedSpaceResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *AnnounceUsedSpaceResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *AnnounceUsedSpaceResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - // Container creation request has container structure's signature as a // separate field. It's not stored in sidechain, just verified on container // creation by `Container` smart contract. `ContainerID` is a SHA256 hash of @@ -1023,7 +743,7 @@ type PutRequest_Body struct { func (x *PutRequest_Body) Reset() { *x = PutRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[14] + mi := &file_container_grpc_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1036,7 +756,7 @@ func (x *PutRequest_Body) String() string { func (*PutRequest_Body) ProtoMessage() {} func (x *PutRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[14] + mi := &file_container_grpc_service_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1082,7 +802,7 @@ type PutResponse_Body struct { func (x *PutResponse_Body) Reset() { *x = PutResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[15] + mi := &file_container_grpc_service_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1095,7 +815,7 @@ func (x *PutResponse_Body) String() string { func (*PutResponse_Body) ProtoMessage() {} func (x *PutResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[15] + mi := &file_container_grpc_service_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1136,7 +856,7 @@ type DeleteRequest_Body struct { func (x *DeleteRequest_Body) Reset() { *x = DeleteRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[16] + mi := &file_container_grpc_service_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1149,7 +869,7 @@ func (x *DeleteRequest_Body) String() string { func (*DeleteRequest_Body) ProtoMessage() {} func (x *DeleteRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[16] + mi := &file_container_grpc_service_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1190,7 +910,7 @@ type DeleteResponse_Body struct { func (x *DeleteResponse_Body) Reset() { *x = DeleteResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[17] + mi := &file_container_grpc_service_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1203,7 +923,7 @@ func (x *DeleteResponse_Body) String() string { func (*DeleteResponse_Body) ProtoMessage() {} func (x *DeleteResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[17] + mi := &file_container_grpc_service_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1232,7 +952,7 @@ type GetRequest_Body struct { func (x *GetRequest_Body) Reset() { *x = GetRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[18] + mi := &file_container_grpc_service_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1245,7 +965,7 @@ func (x *GetRequest_Body) String() string { func (*GetRequest_Body) ProtoMessage() {} func (x *GetRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[18] + mi := &file_container_grpc_service_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1286,7 +1006,7 @@ type GetResponse_Body struct { func (x *GetResponse_Body) Reset() { *x = GetResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[19] + mi := &file_container_grpc_service_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1299,7 +1019,7 @@ func (x *GetResponse_Body) String() string { func (*GetResponse_Body) ProtoMessage() {} func (x *GetResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[19] + mi := &file_container_grpc_service_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1349,7 +1069,7 @@ type ListRequest_Body struct { func (x *ListRequest_Body) Reset() { *x = ListRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[20] + mi := &file_container_grpc_service_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1362,7 +1082,7 @@ func (x *ListRequest_Body) String() string { func (*ListRequest_Body) ProtoMessage() {} func (x *ListRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[20] + mi := &file_container_grpc_service_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1398,7 +1118,7 @@ type ListResponse_Body struct { func (x *ListResponse_Body) Reset() { *x = ListResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[21] + mi := &file_container_grpc_service_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1411,7 +1131,7 @@ func (x *ListResponse_Body) String() string { func (*ListResponse_Body) ProtoMessage() {} func (x *ListResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[21] + mi := &file_container_grpc_service_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1434,106 +1154,6 @@ func (x *ListResponse_Body) GetContainerIds() []*grpc1.ContainerID { return nil } -// Set Extended ACL request body does not have separate `ContainerID` -// reference. It will be taken from `EACLTable.container_id` field. -type SetExtendedACLRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Extended ACL table to set for the container - Eacl *grpc2.EACLTable `protobuf:"bytes,1,opt,name=eacl,proto3" json:"eacl,omitempty"` - // Signature of stable-marshalled Extended ACL table according to RFC-6979. - Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *SetExtendedACLRequest_Body) Reset() { - *x = SetExtendedACLRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetExtendedACLRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetExtendedACLRequest_Body) ProtoMessage() {} - -func (x *SetExtendedACLRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetExtendedACLRequest_Body.ProtoReflect.Descriptor instead. -func (*SetExtendedACLRequest_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{8, 0} -} - -func (x *SetExtendedACLRequest_Body) GetEacl() *grpc2.EACLTable { - if x != nil { - return x.Eacl - } - return nil -} - -func (x *SetExtendedACLRequest_Body) GetSignature() *grpc1.SignatureRFC6979 { - if x != nil { - return x.Signature - } - return nil -} - -// `SetExtendedACLResponse` has an empty body because the operation is -// asynchronous and the update should be reflected in `Container` smart -// contract's storage after next block is issued in sidechain. -type SetExtendedACLResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SetExtendedACLResponse_Body) Reset() { - *x = SetExtendedACLResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetExtendedACLResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetExtendedACLResponse_Body) ProtoMessage() {} - -func (x *SetExtendedACLResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetExtendedACLResponse_Body.ProtoReflect.Descriptor instead. -func (*SetExtendedACLResponse_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{9, 0} -} - // Get Extended ACL request body type GetExtendedACLRequest_Body struct { state protoimpl.MessageState @@ -1547,7 +1167,7 @@ type GetExtendedACLRequest_Body struct { func (x *GetExtendedACLRequest_Body) Reset() { *x = GetExtendedACLRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[24] + mi := &file_container_grpc_service_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1560,7 +1180,7 @@ func (x *GetExtendedACLRequest_Body) String() string { func (*GetExtendedACLRequest_Body) ProtoMessage() {} func (x *GetExtendedACLRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[24] + mi := &file_container_grpc_service_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1573,7 +1193,7 @@ func (x *GetExtendedACLRequest_Body) ProtoReflect() protoreflect.Message { // Deprecated: Use GetExtendedACLRequest_Body.ProtoReflect.Descriptor instead. func (*GetExtendedACLRequest_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{10, 0} + return file_container_grpc_service_proto_rawDescGZIP(), []int{8, 0} } func (x *GetExtendedACLRequest_Body) GetContainerId() *grpc1.ContainerID { @@ -1602,7 +1222,7 @@ type GetExtendedACLResponse_Body struct { func (x *GetExtendedACLResponse_Body) Reset() { *x = GetExtendedACLResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[25] + mi := &file_container_grpc_service_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1615,7 +1235,7 @@ func (x *GetExtendedACLResponse_Body) String() string { func (*GetExtendedACLResponse_Body) ProtoMessage() {} func (x *GetExtendedACLResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[25] + mi := &file_container_grpc_service_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1628,7 +1248,7 @@ func (x *GetExtendedACLResponse_Body) ProtoReflect() protoreflect.Message { // Deprecated: Use GetExtendedACLResponse_Body.ProtoReflect.Descriptor instead. func (*GetExtendedACLResponse_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{11, 0} + return file_container_grpc_service_proto_rawDescGZIP(), []int{9, 0} } func (x *GetExtendedACLResponse_Body) GetEacl() *grpc2.EACLTable { @@ -1652,164 +1272,6 @@ func (x *GetExtendedACLResponse_Body) GetSessionToken() *grpc.SessionToken { return nil } -// Container used space announcement body. -type AnnounceUsedSpaceRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of announcements. If nodes share several containers, - // announcements are transferred in a batch. - Announcements []*AnnounceUsedSpaceRequest_Body_Announcement `protobuf:"bytes,1,rep,name=announcements,proto3" json:"announcements,omitempty"` -} - -func (x *AnnounceUsedSpaceRequest_Body) Reset() { - *x = AnnounceUsedSpaceRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceUsedSpaceRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceUsedSpaceRequest_Body) ProtoMessage() {} - -func (x *AnnounceUsedSpaceRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceUsedSpaceRequest_Body.ProtoReflect.Descriptor instead. -func (*AnnounceUsedSpaceRequest_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{12, 0} -} - -func (x *AnnounceUsedSpaceRequest_Body) GetAnnouncements() []*AnnounceUsedSpaceRequest_Body_Announcement { - if x != nil { - return x.Announcements - } - return nil -} - -// Announcement contains used space information for a single container. -type AnnounceUsedSpaceRequest_Body_Announcement struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Epoch number for which the container size estimation was produced. - Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` - // Identifier of the container. - ContainerId *grpc1.ContainerID `protobuf:"bytes,2,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // Used space is a sum of object payload sizes of a specified - // container, stored in the node. It must not include inhumed objects. - UsedSpace uint64 `protobuf:"varint,3,opt,name=used_space,json=usedSpace,proto3" json:"used_space,omitempty"` -} - -func (x *AnnounceUsedSpaceRequest_Body_Announcement) Reset() { - *x = AnnounceUsedSpaceRequest_Body_Announcement{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceUsedSpaceRequest_Body_Announcement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceUsedSpaceRequest_Body_Announcement) ProtoMessage() {} - -func (x *AnnounceUsedSpaceRequest_Body_Announcement) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceUsedSpaceRequest_Body_Announcement.ProtoReflect.Descriptor instead. -func (*AnnounceUsedSpaceRequest_Body_Announcement) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{12, 0, 0} -} - -func (x *AnnounceUsedSpaceRequest_Body_Announcement) GetEpoch() uint64 { - if x != nil { - return x.Epoch - } - return 0 -} - -func (x *AnnounceUsedSpaceRequest_Body_Announcement) GetContainerId() *grpc1.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -func (x *AnnounceUsedSpaceRequest_Body_Announcement) GetUsedSpace() uint64 { - if x != nil { - return x.UsedSpace - } - return 0 -} - -// `AnnounceUsedSpaceResponse` has an empty body because announcements are -// one way communication. -type AnnounceUsedSpaceResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AnnounceUsedSpaceResponse_Body) Reset() { - *x = AnnounceUsedSpaceResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnnounceUsedSpaceResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnnounceUsedSpaceResponse_Body) ProtoMessage() {} - -func (x *AnnounceUsedSpaceResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnnounceUsedSpaceResponse_Body.ProtoReflect.Descriptor instead. -func (*AnnounceUsedSpaceResponse_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{13, 0} -} - var File_container_grpc_service_proto protoreflect.FileDescriptor var file_container_grpc_service_proto_rawDesc = []byte{ @@ -1985,11 +1447,11 @@ var file_container_grpc_service_proto_rawDesc = []byte{ 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0c, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0xec, 0x02, 0x0a, 0x15, 0x53, 0x65, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0xbe, 0x02, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 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, @@ -2001,174 +1463,73 @@ var file_container_grpc_service_proto_rawDesc = []byte{ 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, 0x74, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2c, 0x0a, 0x04, 0x65, 0x61, - 0x63, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x52, 0x04, 0x65, 0x61, 0x63, 0x6c, 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x53, 0x65, 0x74, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x30, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 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, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xbe, 0x02, - 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 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, + 0x65, 0x72, 0x1a, 0x46, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, + 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xb7, 0x03, 0x0a, 0x16, 0x47, + 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 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, 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, + 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, 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, 0x46, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3e, - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, - 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xb7, - 0x03, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, - 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 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, 0xba, 0x01, 0x0a, 0x04, - 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2c, 0x0a, 0x04, 0x65, 0x61, 0x63, 0x6c, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, - 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x04, 0x65, 0x61, - 0x63, 0x6c, 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xf2, 0x03, 0x0a, 0x18, 0x41, 0x6e, 0x6e, - 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, - 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 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, + 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, 0xf3, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, - 0x12, 0x65, 0x0a, 0x0d, 0x61, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x6e, - 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, - 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0d, 0x61, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, - 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x83, 0x01, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, - 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x3e, - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, - 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, - 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x09, 0x75, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x22, 0x88, 0x02, - 0x0a, 0x19, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, - 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, - 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 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, 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x32, 0x90, 0x05, 0x0a, 0x10, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, - 0x03, 0x50, 0x75, 0x74, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x12, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, + 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0xba, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, + 0x12, 0x2c, 0x0a, 0x04, 0x65, 0x61, 0x63, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, + 0x41, 0x43, 0x4c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x04, 0x65, 0x61, 0x63, 0x6c, 0x12, 0x3e, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, + 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, + 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, + 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xb1, 0x03, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x03, 0x50, 0x75, 0x74, + 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x22, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x03, 0x47, 0x65, - 0x74, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1f, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x69, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, - 0x41, 0x43, 0x4c, 0x12, 0x2a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x0e, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x12, 0x2a, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, - 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6e, 0x65, 0x6f, + 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x11, 0x41, 0x6e, 0x6e, 0x6f, 0x75, - 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, - 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6e, 0x65, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, + 0x0e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x12, + 0x2a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, + 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x55, 0x73, 0x65, 0x64, 0x53, 0x70, - 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6a, 0x5a, 0x48, 0x67, - 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, - 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, - 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6a, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x2e, + 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, + 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, + 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2183,129 +1544,100 @@ func file_container_grpc_service_proto_rawDescGZIP() []byte { return file_container_grpc_service_proto_rawDescData } -var file_container_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 29) +var file_container_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_container_grpc_service_proto_goTypes = []interface{}{ - (*PutRequest)(nil), // 0: neo.fs.v2.container.PutRequest - (*PutResponse)(nil), // 1: neo.fs.v2.container.PutResponse - (*DeleteRequest)(nil), // 2: neo.fs.v2.container.DeleteRequest - (*DeleteResponse)(nil), // 3: neo.fs.v2.container.DeleteResponse - (*GetRequest)(nil), // 4: neo.fs.v2.container.GetRequest - (*GetResponse)(nil), // 5: neo.fs.v2.container.GetResponse - (*ListRequest)(nil), // 6: neo.fs.v2.container.ListRequest - (*ListResponse)(nil), // 7: neo.fs.v2.container.ListResponse - (*SetExtendedACLRequest)(nil), // 8: neo.fs.v2.container.SetExtendedACLRequest - (*SetExtendedACLResponse)(nil), // 9: neo.fs.v2.container.SetExtendedACLResponse - (*GetExtendedACLRequest)(nil), // 10: neo.fs.v2.container.GetExtendedACLRequest - (*GetExtendedACLResponse)(nil), // 11: neo.fs.v2.container.GetExtendedACLResponse - (*AnnounceUsedSpaceRequest)(nil), // 12: neo.fs.v2.container.AnnounceUsedSpaceRequest - (*AnnounceUsedSpaceResponse)(nil), // 13: neo.fs.v2.container.AnnounceUsedSpaceResponse - (*PutRequest_Body)(nil), // 14: neo.fs.v2.container.PutRequest.Body - (*PutResponse_Body)(nil), // 15: neo.fs.v2.container.PutResponse.Body - (*DeleteRequest_Body)(nil), // 16: neo.fs.v2.container.DeleteRequest.Body - (*DeleteResponse_Body)(nil), // 17: neo.fs.v2.container.DeleteResponse.Body - (*GetRequest_Body)(nil), // 18: neo.fs.v2.container.GetRequest.Body - (*GetResponse_Body)(nil), // 19: neo.fs.v2.container.GetResponse.Body - (*ListRequest_Body)(nil), // 20: neo.fs.v2.container.ListRequest.Body - (*ListResponse_Body)(nil), // 21: neo.fs.v2.container.ListResponse.Body - (*SetExtendedACLRequest_Body)(nil), // 22: neo.fs.v2.container.SetExtendedACLRequest.Body - (*SetExtendedACLResponse_Body)(nil), // 23: neo.fs.v2.container.SetExtendedACLResponse.Body - (*GetExtendedACLRequest_Body)(nil), // 24: neo.fs.v2.container.GetExtendedACLRequest.Body - (*GetExtendedACLResponse_Body)(nil), // 25: neo.fs.v2.container.GetExtendedACLResponse.Body - (*AnnounceUsedSpaceRequest_Body)(nil), // 26: neo.fs.v2.container.AnnounceUsedSpaceRequest.Body - (*AnnounceUsedSpaceRequest_Body_Announcement)(nil), // 27: neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement - (*AnnounceUsedSpaceResponse_Body)(nil), // 28: neo.fs.v2.container.AnnounceUsedSpaceResponse.Body - (*grpc.RequestMetaHeader)(nil), // 29: neo.fs.v2.session.RequestMetaHeader - (*grpc.RequestVerificationHeader)(nil), // 30: neo.fs.v2.session.RequestVerificationHeader - (*grpc.ResponseMetaHeader)(nil), // 31: neo.fs.v2.session.ResponseMetaHeader - (*grpc.ResponseVerificationHeader)(nil), // 32: neo.fs.v2.session.ResponseVerificationHeader - (*Container)(nil), // 33: neo.fs.v2.container.Container - (*grpc1.SignatureRFC6979)(nil), // 34: neo.fs.v2.refs.SignatureRFC6979 - (*grpc1.ContainerID)(nil), // 35: neo.fs.v2.refs.ContainerID - (*grpc.SessionToken)(nil), // 36: neo.fs.v2.session.SessionToken - (*grpc1.OwnerID)(nil), // 37: neo.fs.v2.refs.OwnerID - (*grpc2.EACLTable)(nil), // 38: neo.fs.v2.acl.EACLTable + (*PutRequest)(nil), // 0: neo.fs.v2.container.PutRequest + (*PutResponse)(nil), // 1: neo.fs.v2.container.PutResponse + (*DeleteRequest)(nil), // 2: neo.fs.v2.container.DeleteRequest + (*DeleteResponse)(nil), // 3: neo.fs.v2.container.DeleteResponse + (*GetRequest)(nil), // 4: neo.fs.v2.container.GetRequest + (*GetResponse)(nil), // 5: neo.fs.v2.container.GetResponse + (*ListRequest)(nil), // 6: neo.fs.v2.container.ListRequest + (*ListResponse)(nil), // 7: neo.fs.v2.container.ListResponse + (*GetExtendedACLRequest)(nil), // 8: neo.fs.v2.container.GetExtendedACLRequest + (*GetExtendedACLResponse)(nil), // 9: neo.fs.v2.container.GetExtendedACLResponse + (*PutRequest_Body)(nil), // 10: neo.fs.v2.container.PutRequest.Body + (*PutResponse_Body)(nil), // 11: neo.fs.v2.container.PutResponse.Body + (*DeleteRequest_Body)(nil), // 12: neo.fs.v2.container.DeleteRequest.Body + (*DeleteResponse_Body)(nil), // 13: neo.fs.v2.container.DeleteResponse.Body + (*GetRequest_Body)(nil), // 14: neo.fs.v2.container.GetRequest.Body + (*GetResponse_Body)(nil), // 15: neo.fs.v2.container.GetResponse.Body + (*ListRequest_Body)(nil), // 16: neo.fs.v2.container.ListRequest.Body + (*ListResponse_Body)(nil), // 17: neo.fs.v2.container.ListResponse.Body + (*GetExtendedACLRequest_Body)(nil), // 18: neo.fs.v2.container.GetExtendedACLRequest.Body + (*GetExtendedACLResponse_Body)(nil), // 19: neo.fs.v2.container.GetExtendedACLResponse.Body + (*grpc.RequestMetaHeader)(nil), // 20: neo.fs.v2.session.RequestMetaHeader + (*grpc.RequestVerificationHeader)(nil), // 21: neo.fs.v2.session.RequestVerificationHeader + (*grpc.ResponseMetaHeader)(nil), // 22: neo.fs.v2.session.ResponseMetaHeader + (*grpc.ResponseVerificationHeader)(nil), // 23: neo.fs.v2.session.ResponseVerificationHeader + (*Container)(nil), // 24: neo.fs.v2.container.Container + (*grpc1.SignatureRFC6979)(nil), // 25: neo.fs.v2.refs.SignatureRFC6979 + (*grpc1.ContainerID)(nil), // 26: neo.fs.v2.refs.ContainerID + (*grpc.SessionToken)(nil), // 27: neo.fs.v2.session.SessionToken + (*grpc1.OwnerID)(nil), // 28: neo.fs.v2.refs.OwnerID + (*grpc2.EACLTable)(nil), // 29: neo.fs.v2.acl.EACLTable } var file_container_grpc_service_proto_depIdxs = []int32{ - 14, // 0: neo.fs.v2.container.PutRequest.body:type_name -> neo.fs.v2.container.PutRequest.Body - 29, // 1: neo.fs.v2.container.PutRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 30, // 2: neo.fs.v2.container.PutRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 15, // 3: neo.fs.v2.container.PutResponse.body:type_name -> neo.fs.v2.container.PutResponse.Body - 31, // 4: neo.fs.v2.container.PutResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 32, // 5: neo.fs.v2.container.PutResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 16, // 6: neo.fs.v2.container.DeleteRequest.body:type_name -> neo.fs.v2.container.DeleteRequest.Body - 29, // 7: neo.fs.v2.container.DeleteRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 30, // 8: neo.fs.v2.container.DeleteRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 17, // 9: neo.fs.v2.container.DeleteResponse.body:type_name -> neo.fs.v2.container.DeleteResponse.Body - 31, // 10: neo.fs.v2.container.DeleteResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 32, // 11: neo.fs.v2.container.DeleteResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 18, // 12: neo.fs.v2.container.GetRequest.body:type_name -> neo.fs.v2.container.GetRequest.Body - 29, // 13: neo.fs.v2.container.GetRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 30, // 14: neo.fs.v2.container.GetRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 19, // 15: neo.fs.v2.container.GetResponse.body:type_name -> neo.fs.v2.container.GetResponse.Body - 31, // 16: neo.fs.v2.container.GetResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 32, // 17: neo.fs.v2.container.GetResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 20, // 18: neo.fs.v2.container.ListRequest.body:type_name -> neo.fs.v2.container.ListRequest.Body - 29, // 19: neo.fs.v2.container.ListRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 30, // 20: neo.fs.v2.container.ListRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 21, // 21: neo.fs.v2.container.ListResponse.body:type_name -> neo.fs.v2.container.ListResponse.Body - 31, // 22: neo.fs.v2.container.ListResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 32, // 23: neo.fs.v2.container.ListResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 22, // 24: neo.fs.v2.container.SetExtendedACLRequest.body:type_name -> neo.fs.v2.container.SetExtendedACLRequest.Body - 29, // 25: neo.fs.v2.container.SetExtendedACLRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 30, // 26: neo.fs.v2.container.SetExtendedACLRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 23, // 27: neo.fs.v2.container.SetExtendedACLResponse.body:type_name -> neo.fs.v2.container.SetExtendedACLResponse.Body - 31, // 28: neo.fs.v2.container.SetExtendedACLResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 32, // 29: neo.fs.v2.container.SetExtendedACLResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 24, // 30: neo.fs.v2.container.GetExtendedACLRequest.body:type_name -> neo.fs.v2.container.GetExtendedACLRequest.Body - 29, // 31: neo.fs.v2.container.GetExtendedACLRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 30, // 32: neo.fs.v2.container.GetExtendedACLRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 25, // 33: neo.fs.v2.container.GetExtendedACLResponse.body:type_name -> neo.fs.v2.container.GetExtendedACLResponse.Body - 31, // 34: neo.fs.v2.container.GetExtendedACLResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 32, // 35: neo.fs.v2.container.GetExtendedACLResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 26, // 36: neo.fs.v2.container.AnnounceUsedSpaceRequest.body:type_name -> neo.fs.v2.container.AnnounceUsedSpaceRequest.Body - 29, // 37: neo.fs.v2.container.AnnounceUsedSpaceRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 30, // 38: neo.fs.v2.container.AnnounceUsedSpaceRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 28, // 39: neo.fs.v2.container.AnnounceUsedSpaceResponse.body:type_name -> neo.fs.v2.container.AnnounceUsedSpaceResponse.Body - 31, // 40: neo.fs.v2.container.AnnounceUsedSpaceResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 32, // 41: neo.fs.v2.container.AnnounceUsedSpaceResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 33, // 42: neo.fs.v2.container.PutRequest.Body.container:type_name -> neo.fs.v2.container.Container - 34, // 43: neo.fs.v2.container.PutRequest.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 - 35, // 44: neo.fs.v2.container.PutResponse.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 35, // 45: neo.fs.v2.container.DeleteRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 34, // 46: neo.fs.v2.container.DeleteRequest.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 - 35, // 47: neo.fs.v2.container.GetRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 33, // 48: neo.fs.v2.container.GetResponse.Body.container:type_name -> neo.fs.v2.container.Container - 34, // 49: neo.fs.v2.container.GetResponse.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 - 36, // 50: neo.fs.v2.container.GetResponse.Body.session_token:type_name -> neo.fs.v2.session.SessionToken - 37, // 51: neo.fs.v2.container.ListRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID - 35, // 52: neo.fs.v2.container.ListResponse.Body.container_ids:type_name -> neo.fs.v2.refs.ContainerID - 38, // 53: neo.fs.v2.container.SetExtendedACLRequest.Body.eacl:type_name -> neo.fs.v2.acl.EACLTable - 34, // 54: neo.fs.v2.container.SetExtendedACLRequest.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 - 35, // 55: neo.fs.v2.container.GetExtendedACLRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 38, // 56: neo.fs.v2.container.GetExtendedACLResponse.Body.eacl:type_name -> neo.fs.v2.acl.EACLTable - 34, // 57: neo.fs.v2.container.GetExtendedACLResponse.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 - 36, // 58: neo.fs.v2.container.GetExtendedACLResponse.Body.session_token:type_name -> neo.fs.v2.session.SessionToken - 27, // 59: neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.announcements:type_name -> neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement - 35, // 60: neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement.container_id:type_name -> neo.fs.v2.refs.ContainerID - 0, // 61: neo.fs.v2.container.ContainerService.Put:input_type -> neo.fs.v2.container.PutRequest - 2, // 62: neo.fs.v2.container.ContainerService.Delete:input_type -> neo.fs.v2.container.DeleteRequest - 4, // 63: neo.fs.v2.container.ContainerService.Get:input_type -> neo.fs.v2.container.GetRequest - 6, // 64: neo.fs.v2.container.ContainerService.List:input_type -> neo.fs.v2.container.ListRequest - 8, // 65: neo.fs.v2.container.ContainerService.SetExtendedACL:input_type -> neo.fs.v2.container.SetExtendedACLRequest - 10, // 66: neo.fs.v2.container.ContainerService.GetExtendedACL:input_type -> neo.fs.v2.container.GetExtendedACLRequest - 12, // 67: neo.fs.v2.container.ContainerService.AnnounceUsedSpace:input_type -> neo.fs.v2.container.AnnounceUsedSpaceRequest - 1, // 68: neo.fs.v2.container.ContainerService.Put:output_type -> neo.fs.v2.container.PutResponse - 3, // 69: neo.fs.v2.container.ContainerService.Delete:output_type -> neo.fs.v2.container.DeleteResponse - 5, // 70: neo.fs.v2.container.ContainerService.Get:output_type -> neo.fs.v2.container.GetResponse - 7, // 71: neo.fs.v2.container.ContainerService.List:output_type -> neo.fs.v2.container.ListResponse - 9, // 72: neo.fs.v2.container.ContainerService.SetExtendedACL:output_type -> neo.fs.v2.container.SetExtendedACLResponse - 11, // 73: neo.fs.v2.container.ContainerService.GetExtendedACL:output_type -> neo.fs.v2.container.GetExtendedACLResponse - 13, // 74: neo.fs.v2.container.ContainerService.AnnounceUsedSpace:output_type -> neo.fs.v2.container.AnnounceUsedSpaceResponse - 68, // [68:75] is the sub-list for method output_type - 61, // [61:68] is the sub-list for method input_type - 61, // [61:61] is the sub-list for extension type_name - 61, // [61:61] is the sub-list for extension extendee - 0, // [0:61] is the sub-list for field type_name + 10, // 0: neo.fs.v2.container.PutRequest.body:type_name -> neo.fs.v2.container.PutRequest.Body + 20, // 1: neo.fs.v2.container.PutRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 21, // 2: neo.fs.v2.container.PutRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 11, // 3: neo.fs.v2.container.PutResponse.body:type_name -> neo.fs.v2.container.PutResponse.Body + 22, // 4: neo.fs.v2.container.PutResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 23, // 5: neo.fs.v2.container.PutResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 12, // 6: neo.fs.v2.container.DeleteRequest.body:type_name -> neo.fs.v2.container.DeleteRequest.Body + 20, // 7: neo.fs.v2.container.DeleteRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 21, // 8: neo.fs.v2.container.DeleteRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 13, // 9: neo.fs.v2.container.DeleteResponse.body:type_name -> neo.fs.v2.container.DeleteResponse.Body + 22, // 10: neo.fs.v2.container.DeleteResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 23, // 11: neo.fs.v2.container.DeleteResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 14, // 12: neo.fs.v2.container.GetRequest.body:type_name -> neo.fs.v2.container.GetRequest.Body + 20, // 13: neo.fs.v2.container.GetRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 21, // 14: neo.fs.v2.container.GetRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 15, // 15: neo.fs.v2.container.GetResponse.body:type_name -> neo.fs.v2.container.GetResponse.Body + 22, // 16: neo.fs.v2.container.GetResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 23, // 17: neo.fs.v2.container.GetResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 16, // 18: neo.fs.v2.container.ListRequest.body:type_name -> neo.fs.v2.container.ListRequest.Body + 20, // 19: neo.fs.v2.container.ListRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 21, // 20: neo.fs.v2.container.ListRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 17, // 21: neo.fs.v2.container.ListResponse.body:type_name -> neo.fs.v2.container.ListResponse.Body + 22, // 22: neo.fs.v2.container.ListResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 23, // 23: neo.fs.v2.container.ListResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 18, // 24: neo.fs.v2.container.GetExtendedACLRequest.body:type_name -> neo.fs.v2.container.GetExtendedACLRequest.Body + 20, // 25: neo.fs.v2.container.GetExtendedACLRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 21, // 26: neo.fs.v2.container.GetExtendedACLRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 19, // 27: neo.fs.v2.container.GetExtendedACLResponse.body:type_name -> neo.fs.v2.container.GetExtendedACLResponse.Body + 22, // 28: neo.fs.v2.container.GetExtendedACLResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 23, // 29: neo.fs.v2.container.GetExtendedACLResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 24, // 30: neo.fs.v2.container.PutRequest.Body.container:type_name -> neo.fs.v2.container.Container + 25, // 31: neo.fs.v2.container.PutRequest.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 + 26, // 32: neo.fs.v2.container.PutResponse.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 26, // 33: neo.fs.v2.container.DeleteRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 25, // 34: neo.fs.v2.container.DeleteRequest.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 + 26, // 35: neo.fs.v2.container.GetRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 24, // 36: neo.fs.v2.container.GetResponse.Body.container:type_name -> neo.fs.v2.container.Container + 25, // 37: neo.fs.v2.container.GetResponse.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 + 27, // 38: neo.fs.v2.container.GetResponse.Body.session_token:type_name -> neo.fs.v2.session.SessionToken + 28, // 39: neo.fs.v2.container.ListRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID + 26, // 40: neo.fs.v2.container.ListResponse.Body.container_ids:type_name -> neo.fs.v2.refs.ContainerID + 26, // 41: neo.fs.v2.container.GetExtendedACLRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 29, // 42: neo.fs.v2.container.GetExtendedACLResponse.Body.eacl:type_name -> neo.fs.v2.acl.EACLTable + 25, // 43: neo.fs.v2.container.GetExtendedACLResponse.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 + 27, // 44: neo.fs.v2.container.GetExtendedACLResponse.Body.session_token:type_name -> neo.fs.v2.session.SessionToken + 0, // 45: neo.fs.v2.container.ContainerService.Put:input_type -> neo.fs.v2.container.PutRequest + 2, // 46: neo.fs.v2.container.ContainerService.Delete:input_type -> neo.fs.v2.container.DeleteRequest + 4, // 47: neo.fs.v2.container.ContainerService.Get:input_type -> neo.fs.v2.container.GetRequest + 6, // 48: neo.fs.v2.container.ContainerService.List:input_type -> neo.fs.v2.container.ListRequest + 8, // 49: neo.fs.v2.container.ContainerService.GetExtendedACL:input_type -> neo.fs.v2.container.GetExtendedACLRequest + 1, // 50: neo.fs.v2.container.ContainerService.Put:output_type -> neo.fs.v2.container.PutResponse + 3, // 51: neo.fs.v2.container.ContainerService.Delete:output_type -> neo.fs.v2.container.DeleteResponse + 5, // 52: neo.fs.v2.container.ContainerService.Get:output_type -> neo.fs.v2.container.GetResponse + 7, // 53: neo.fs.v2.container.ContainerService.List:output_type -> neo.fs.v2.container.ListResponse + 9, // 54: neo.fs.v2.container.ContainerService.GetExtendedACL:output_type -> neo.fs.v2.container.GetExtendedACLResponse + 50, // [50:55] is the sub-list for method output_type + 45, // [45:50] is the sub-list for method input_type + 45, // [45:45] is the sub-list for extension type_name + 45, // [45:45] is the sub-list for extension extendee + 0, // [0:45] is the sub-list for field type_name } func init() { file_container_grpc_service_proto_init() } @@ -2412,30 +1744,6 @@ func file_container_grpc_service_proto_init() { } } file_container_grpc_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetExtendedACLRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetExtendedACLResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetExtendedACLRequest); i { case 0: return &v.state @@ -2447,7 +1755,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetExtendedACLResponse); i { case 0: return &v.state @@ -2459,31 +1767,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceUsedSpaceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceUsedSpaceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PutRequest_Body); i { case 0: return &v.state @@ -2495,7 +1779,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PutResponse_Body); i { case 0: return &v.state @@ -2507,7 +1791,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteRequest_Body); i { case 0: return &v.state @@ -2519,7 +1803,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteResponse_Body); i { case 0: return &v.state @@ -2531,7 +1815,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRequest_Body); i { case 0: return &v.state @@ -2543,7 +1827,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetResponse_Body); i { case 0: return &v.state @@ -2555,7 +1839,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListRequest_Body); i { case 0: return &v.state @@ -2567,7 +1851,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListResponse_Body); i { case 0: return &v.state @@ -2579,31 +1863,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetExtendedACLRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetExtendedACLResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetExtendedACLRequest_Body); i { case 0: return &v.state @@ -2615,7 +1875,7 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_container_grpc_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetExtendedACLResponse_Body); i { case 0: return &v.state @@ -2627,42 +1887,6 @@ func file_container_grpc_service_proto_init() { return nil } } - file_container_grpc_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceUsedSpaceRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceUsedSpaceRequest_Body_Announcement); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnnounceUsedSpaceResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2670,7 +1894,7 @@ func file_container_grpc_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_container_grpc_service_proto_rawDesc, NumEnums: 0, - NumMessages: 29, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, diff --git a/container/grpc/service_grpc.pb.go b/container/grpc/service_grpc.pb.go index 6ae8ade..939a978 100644 --- a/container/grpc/service_grpc.pb.go +++ b/container/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.3 +// - protoc v5.27.2 // source: container/grpc/service.proto package container @@ -19,13 +19,11 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - ContainerService_Put_FullMethodName = "/neo.fs.v2.container.ContainerService/Put" - ContainerService_Delete_FullMethodName = "/neo.fs.v2.container.ContainerService/Delete" - ContainerService_Get_FullMethodName = "/neo.fs.v2.container.ContainerService/Get" - ContainerService_List_FullMethodName = "/neo.fs.v2.container.ContainerService/List" - ContainerService_SetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/SetExtendedACL" - ContainerService_GetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/GetExtendedACL" - ContainerService_AnnounceUsedSpace_FullMethodName = "/neo.fs.v2.container.ContainerService/AnnounceUsedSpace" + ContainerService_Put_FullMethodName = "/neo.fs.v2.container.ContainerService/Put" + ContainerService_Delete_FullMethodName = "/neo.fs.v2.container.ContainerService/Delete" + ContainerService_Get_FullMethodName = "/neo.fs.v2.container.ContainerService/Get" + ContainerService_List_FullMethodName = "/neo.fs.v2.container.ContainerService/List" + ContainerService_GetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/GetExtendedACL" ) // ContainerServiceClient is the client API for ContainerService service. @@ -76,17 +74,6 @@ type ContainerServiceClient interface { // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // container list access denied. List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) - // Invokes 'SetEACL' method of 'Container` smart contract and returns response - // immediately. After one more block in sidechain, changes in an Extended ACL - // are added into smart contract storage. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // set container eACL access denied. - SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // @@ -101,13 +88,6 @@ type ContainerServiceClient interface { // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // access to container eACL is denied. GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) - // Announces the space values used by the container for P2P synchronization. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). - AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) } type containerServiceClient struct { @@ -154,15 +134,6 @@ func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts return out, nil } -func (c *containerServiceClient) SetExtendedACL(ctx context.Context, in *SetExtendedACLRequest, opts ...grpc.CallOption) (*SetExtendedACLResponse, error) { - out := new(SetExtendedACLResponse) - err := c.cc.Invoke(ctx, ContainerService_SetExtendedACL_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *containerServiceClient) GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) { out := new(GetExtendedACLResponse) err := c.cc.Invoke(ctx, ContainerService_GetExtendedACL_FullMethodName, in, out, opts...) @@ -172,15 +143,6 @@ func (c *containerServiceClient) GetExtendedACL(ctx context.Context, in *GetExte return out, nil } -func (c *containerServiceClient) AnnounceUsedSpace(ctx context.Context, in *AnnounceUsedSpaceRequest, opts ...grpc.CallOption) (*AnnounceUsedSpaceResponse, error) { - out := new(AnnounceUsedSpaceResponse) - err := c.cc.Invoke(ctx, ContainerService_AnnounceUsedSpace_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // ContainerServiceServer is the server API for ContainerService service. // All implementations should embed UnimplementedContainerServiceServer // for forward compatibility @@ -229,17 +191,6 @@ type ContainerServiceServer interface { // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // container list access denied. List(context.Context, *ListRequest) (*ListResponse, error) - // Invokes 'SetEACL' method of 'Container` smart contract and returns response - // immediately. After one more block in sidechain, changes in an Extended ACL - // are added into smart contract storage. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // set container eACL access denied. - SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) // Returns Extended ACL table and signature from `Container` smart contract // storage. // @@ -254,13 +205,6 @@ type ContainerServiceServer interface { // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // access to container eACL is denied. GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) - // Announces the space values used by the container for P2P synchronization. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). - AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error) } // UnimplementedContainerServiceServer should be embedded to have forward compatible implementations. @@ -279,15 +223,9 @@ 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) SetExtendedACL(context.Context, *SetExtendedACLRequest) (*SetExtendedACLResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetExtendedACL not implemented") -} func (UnimplementedContainerServiceServer) GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetExtendedACL not implemented") } -func (UnimplementedContainerServiceServer) AnnounceUsedSpace(context.Context, *AnnounceUsedSpaceRequest) (*AnnounceUsedSpaceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AnnounceUsedSpace not implemented") -} // 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 @@ -372,24 +310,6 @@ func _ContainerService_List_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _ContainerService_SetExtendedACL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetExtendedACLRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainerServiceServer).SetExtendedACL(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ContainerService_SetExtendedACL_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainerServiceServer).SetExtendedACL(ctx, req.(*SetExtendedACLRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _ContainerService_GetExtendedACL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetExtendedACLRequest) if err := dec(in); err != nil { @@ -408,24 +328,6 @@ func _ContainerService_GetExtendedACL_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } -func _ContainerService_AnnounceUsedSpace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AnnounceUsedSpaceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainerServiceServer).AnnounceUsedSpace(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ContainerService_AnnounceUsedSpace_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainerServiceServer).AnnounceUsedSpace(ctx, req.(*AnnounceUsedSpaceRequest)) - } - return interceptor(ctx, in, info, handler) -} - // ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -449,18 +351,10 @@ var ContainerService_ServiceDesc = grpc.ServiceDesc{ MethodName: "List", Handler: _ContainerService_List_Handler, }, - { - MethodName: "SetExtendedACL", - Handler: _ContainerService_SetExtendedACL_Handler, - }, { MethodName: "GetExtendedACL", Handler: _ContainerService_GetExtendedACL_Handler, }, - { - MethodName: "AnnounceUsedSpace", - Handler: _ContainerService_AnnounceUsedSpace_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "container/grpc/service.proto", diff --git a/container/grpc/types.pb.go b/container/grpc/types.pb.go index c484a0d..d0e19ec 100644 --- a/container/grpc/types.pb.go +++ b/container/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: container/grpc/types.proto package container diff --git a/container/marshal.go b/container/marshal.go index a7c57aa..ff17150 100644 --- a/container/marshal.go +++ b/container/marshal.go @@ -35,20 +35,11 @@ const ( listRespBodyIDsField = 1 - setEACLReqBodyTableField = 1 - setEACLReqBodySignatureField = 2 - getEACLReqBodyIDField = 1 getEACLRespBodyTableField = 1 getEACLRespBodySignatureField = 2 getEACLRespBodyTokenField = 3 - - usedSpaceAnnounceEpochField = 1 - usedSpaceAnnounceCIDField = 2 - usedSpaceAnnounceUsedSpaceField = 3 - - usedSpaceReqBodyAnnouncementsField = 1 ) func (a *Attribute) StableMarshal(buf []byte) []byte { @@ -359,50 +350,6 @@ func (r *ListResponseBody) Unmarshal(data []byte) error { return message.Unmarshal(r, data, new(container.ListResponse_Body)) } -func (r *SetExtendedACLRequestBody) StableMarshal(buf []byte) []byte { - if r == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, r.StableSize()) - } - - var offset int - - offset += protoutil.NestedStructureMarshal(setEACLReqBodyTableField, buf[offset:], r.eacl) - protoutil.NestedStructureMarshal(setEACLReqBodySignatureField, buf[offset:], r.sig) - - return buf -} - -func (r *SetExtendedACLRequestBody) StableSize() (size int) { - if r == nil { - return 0 - } - - size += protoutil.NestedStructureSize(setEACLReqBodyTableField, r.eacl) - size += protoutil.NestedStructureSize(setEACLReqBodySignatureField, r.sig) - - return size -} - -func (r *SetExtendedACLRequestBody) Unmarshal(data []byte) error { - return message.Unmarshal(r, data, new(container.SetExtendedACLRequest_Body)) -} - -func (r *SetExtendedACLResponseBody) StableMarshal(_ []byte) []byte { - return nil -} - -func (r *SetExtendedACLResponseBody) StableSize() (size int) { - return 0 -} - -func (r *SetExtendedACLResponseBody) Unmarshal([]byte) error { - return nil -} - func (r *GetExtendedACLRequestBody) StableMarshal(buf []byte) []byte { if r == nil { return []byte{} @@ -464,83 +411,3 @@ func (r *GetExtendedACLResponseBody) StableSize() (size int) { func (r *GetExtendedACLResponseBody) Unmarshal(data []byte) error { return message.Unmarshal(r, data, new(container.GetExtendedACLResponse_Body)) } - -func (a *UsedSpaceAnnouncement) StableMarshal(buf []byte) []byte { - if a == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, a.StableSize()) - } - - var offset int - - offset += protoutil.UInt64Marshal(usedSpaceAnnounceEpochField, buf[offset:], a.epoch) - offset += protoutil.NestedStructureMarshal(usedSpaceAnnounceCIDField, buf[offset:], a.cid) - protoutil.UInt64Marshal(usedSpaceAnnounceUsedSpaceField, buf[offset:], a.usedSpace) - - return buf -} - -func (a *UsedSpaceAnnouncement) StableSize() (size int) { - if a == nil { - return 0 - } - - size += protoutil.UInt64Size(usedSpaceAnnounceEpochField, a.epoch) - size += protoutil.NestedStructureSize(usedSpaceAnnounceCIDField, a.cid) - size += protoutil.UInt64Size(usedSpaceAnnounceUsedSpaceField, a.usedSpace) - - return size -} - -func (a *UsedSpaceAnnouncement) Unmarshal(data []byte) error { - return message.Unmarshal(a, data, new(container.AnnounceUsedSpaceRequest_Body_Announcement)) -} - -func (r *AnnounceUsedSpaceRequestBody) StableMarshal(buf []byte) []byte { - if r == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, r.StableSize()) - } - - var offset int - - for i := range r.announcements { - offset += protoutil.NestedStructureMarshal(usedSpaceReqBodyAnnouncementsField, buf[offset:], &r.announcements[i]) - } - - return buf -} - -func (r *AnnounceUsedSpaceRequestBody) StableSize() (size int) { - if r == nil { - return 0 - } - - for i := range r.announcements { - size += protoutil.NestedStructureSize(usedSpaceReqBodyAnnouncementsField, &r.announcements[i]) - } - - return size -} - -func (r *AnnounceUsedSpaceRequestBody) Unmarshal(data []byte) error { - return message.Unmarshal(r, data, new(container.AnnounceUsedSpaceRequest_Body)) -} - -func (r *AnnounceUsedSpaceResponseBody) StableMarshal(_ []byte) []byte { - return nil -} - -func (r *AnnounceUsedSpaceResponseBody) StableSize() (size int) { - return 0 -} - -func (r *AnnounceUsedSpaceResponseBody) Unmarshal([]byte) error { - return nil -} diff --git a/container/message_test.go b/container/message_test.go index 869ccb2..6558e25 100644 --- a/container/message_test.go +++ b/container/message_test.go @@ -28,8 +28,6 @@ func TestMessageConvert(t *testing.T) { func(empty bool) message.Message { return containertest.GenerateListRequest(empty) }, func(empty bool) message.Message { return containertest.GenerateListResponseBody(empty) }, func(empty bool) message.Message { return containertest.GenerateListResponse(empty) }, - func(empty bool) message.Message { return containertest.GenerateSetExtendedACLRequestBody(empty) }, - func(empty bool) message.Message { return containertest.GenerateSetExtendedACLRequest(empty) }, func(empty bool) message.Message { return containertest.GenerateGetRequestBody(empty) }, func(empty bool) message.Message { return containertest.GenerateGetRequest(empty) }, func(empty bool) message.Message { return containertest.GenerateGetResponseBody(empty) }, @@ -38,10 +36,5 @@ func TestMessageConvert(t *testing.T) { func(empty bool) message.Message { return containertest.GenerateGetExtendedACLRequest(empty) }, func(empty bool) message.Message { return containertest.GenerateGetExtendedACLResponseBody(empty) }, func(empty bool) message.Message { return containertest.GenerateGetExtendedACLResponse(empty) }, - func(empty bool) message.Message { return containertest.GenerateUsedSpaceAnnouncement(empty) }, - func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceRequestBody(empty) }, - func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceRequest(empty) }, - func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceResponseBody(empty) }, - func(empty bool) message.Message { return containertest.GenerateAnnounceUsedSpaceResponse(empty) }, ) } diff --git a/container/test/generate.go b/container/test/generate.go index 2b2afdf..b94347b 100644 --- a/container/test/generate.go +++ b/container/test/generate.go @@ -235,50 +235,6 @@ func GenerateListResponse(empty bool) *container.ListResponse { return m } -func GenerateSetExtendedACLRequestBody(empty bool) *container.SetExtendedACLRequestBody { - m := new(container.SetExtendedACLRequestBody) - - if !empty { - m.SetEACL(acltest.GenerateTable(false)) - } - - m.SetSignature(refstest.GenerateSignature(empty)) - - return m -} - -func GenerateSetExtendedACLRequest(empty bool) *container.SetExtendedACLRequest { - m := new(container.SetExtendedACLRequest) - - if !empty { - m.SetBody(GenerateSetExtendedACLRequestBody(false)) - } - - m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) - m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) - - return m -} - -func GenerateSetExtendedACLResponseBody(_ bool) *container.SetExtendedACLResponseBody { - m := new(container.SetExtendedACLResponseBody) - - return m -} - -func GenerateSetExtendedACLResponse(empty bool) *container.SetExtendedACLResponse { - m := new(container.SetExtendedACLResponse) - - if !empty { - m.SetBody(GenerateSetExtendedACLResponseBody(false)) - } - - m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) - m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) - - return m -} - func GenerateGetExtendedACLRequestBody(empty bool) *container.GetExtendedACLRequestBody { m := new(container.GetExtendedACLRequestBody) @@ -327,70 +283,3 @@ func GenerateGetExtendedACLResponse(empty bool) *container.GetExtendedACLRespons return m } - -func GenerateUsedSpaceAnnouncement(empty bool) *container.UsedSpaceAnnouncement { - m := new(container.UsedSpaceAnnouncement) - - if !empty { - m.SetContainerID(refstest.GenerateContainerID(false)) - m.SetEpoch(1) - m.SetUsedSpace(2) - } - - return m -} - -func GenerateUsedSpaceAnnouncements(empty bool) []container.UsedSpaceAnnouncement { - var res []container.UsedSpaceAnnouncement - - if !empty { - res = append(res, - *GenerateUsedSpaceAnnouncement(false), - *GenerateUsedSpaceAnnouncement(false), - ) - } - - return res -} - -func GenerateAnnounceUsedSpaceRequestBody(empty bool) *container.AnnounceUsedSpaceRequestBody { - m := new(container.AnnounceUsedSpaceRequestBody) - - if !empty { - m.SetAnnouncements(GenerateUsedSpaceAnnouncements(false)) - } - - return m -} - -func GenerateAnnounceUsedSpaceRequest(empty bool) *container.AnnounceUsedSpaceRequest { - m := new(container.AnnounceUsedSpaceRequest) - - if !empty { - m.SetBody(GenerateAnnounceUsedSpaceRequestBody(false)) - } - - m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) - m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) - - return m -} - -func GenerateAnnounceUsedSpaceResponseBody(_ bool) *container.AnnounceUsedSpaceResponseBody { - m := new(container.AnnounceUsedSpaceResponseBody) - - return m -} - -func GenerateAnnounceUsedSpaceResponse(empty bool) *container.AnnounceUsedSpaceResponse { - m := new(container.AnnounceUsedSpaceResponse) - - if !empty { - m.SetBody(GenerateAnnounceUsedSpaceResponseBody(false)) - } - - m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) - m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) - - return m -} diff --git a/container/types.go b/container/types.go index 948580d..3a9e915 100644 --- a/container/types.go +++ b/container/types.go @@ -110,26 +110,6 @@ type ListResponse struct { session.ResponseHeaders } -type SetExtendedACLRequestBody struct { - eacl *acl.Table - - sig *refs.Signature -} - -type SetExtendedACLRequest struct { - body *SetExtendedACLRequestBody - - session.RequestHeaders -} - -type SetExtendedACLResponseBody struct{} - -type SetExtendedACLResponse struct { - body *SetExtendedACLResponseBody - - session.ResponseHeaders -} - type GetExtendedACLRequestBody struct { cid *refs.ContainerID } @@ -154,32 +134,6 @@ type GetExtendedACLResponse struct { session.ResponseHeaders } -type UsedSpaceAnnouncement struct { - epoch uint64 - - cid *refs.ContainerID - - usedSpace uint64 -} - -type AnnounceUsedSpaceRequestBody struct { - announcements []UsedSpaceAnnouncement -} - -type AnnounceUsedSpaceRequest struct { - body *AnnounceUsedSpaceRequestBody - - session.RequestHeaders -} - -type AnnounceUsedSpaceResponseBody struct{} - -type AnnounceUsedSpaceResponse struct { - body *AnnounceUsedSpaceResponseBody - - session.ResponseHeaders -} - func (a *Attribute) GetKey() string { if a != nil { return a.key @@ -516,56 +470,6 @@ func (r *ListResponse) SetBody(v *ListResponseBody) { r.body = v } -func (r *SetExtendedACLRequestBody) GetEACL() *acl.Table { - if r != nil { - return r.eacl - } - - return nil -} - -func (r *SetExtendedACLRequestBody) SetEACL(v *acl.Table) { - r.eacl = v -} - -func (r *SetExtendedACLRequestBody) GetSignature() *refs.Signature { - if r != nil { - return r.sig - } - - return nil -} - -func (r *SetExtendedACLRequestBody) SetSignature(v *refs.Signature) { - // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) - v.SetScheme(0) - r.sig = v -} - -func (r *SetExtendedACLRequest) GetBody() *SetExtendedACLRequestBody { - if r != nil { - return r.body - } - - return nil -} - -func (r *SetExtendedACLRequest) SetBody(v *SetExtendedACLRequestBody) { - r.body = v -} - -func (r *SetExtendedACLResponse) GetBody() *SetExtendedACLResponseBody { - if r != nil { - return r.body - } - - return nil -} - -func (r *SetExtendedACLResponse) SetBody(v *SetExtendedACLResponseBody) { - r.body = v -} - func (r *GetExtendedACLRequestBody) GetContainerID() *refs.ContainerID { if r != nil { return r.cid @@ -643,75 +547,3 @@ func (r *GetExtendedACLResponse) GetBody() *GetExtendedACLResponseBody { func (r *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponseBody) { r.body = v } - -func (a *UsedSpaceAnnouncement) GetEpoch() uint64 { - if a != nil { - return a.epoch - } - - return 0 -} - -func (a *UsedSpaceAnnouncement) SetEpoch(v uint64) { - a.epoch = v -} - -func (a *UsedSpaceAnnouncement) GetUsedSpace() uint64 { - if a != nil { - return a.usedSpace - } - - return 0 -} - -func (a *UsedSpaceAnnouncement) SetUsedSpace(v uint64) { - a.usedSpace = v -} - -func (a *UsedSpaceAnnouncement) GetContainerID() *refs.ContainerID { - if a != nil { - return a.cid - } - - return nil -} - -func (a *UsedSpaceAnnouncement) SetContainerID(v *refs.ContainerID) { - a.cid = v -} - -func (r *AnnounceUsedSpaceRequestBody) GetAnnouncements() []UsedSpaceAnnouncement { - if r != nil { - return r.announcements - } - - return nil -} - -func (r *AnnounceUsedSpaceRequestBody) SetAnnouncements(v []UsedSpaceAnnouncement) { - r.announcements = v -} - -func (r *AnnounceUsedSpaceRequest) GetBody() *AnnounceUsedSpaceRequestBody { - if r != nil { - return r.body - } - - return nil -} - -func (r *AnnounceUsedSpaceRequest) SetBody(v *AnnounceUsedSpaceRequestBody) { - r.body = v -} - -func (r *AnnounceUsedSpaceResponse) GetBody() *AnnounceUsedSpaceResponseBody { - if r != nil { - return r.body - } - - return nil -} - -func (r *AnnounceUsedSpaceResponse) SetBody(v *AnnounceUsedSpaceResponseBody) { - r.body = v -} diff --git a/lock/grpc/types.pb.go b/lock/grpc/types.pb.go index c2d66f1..38b62fe 100644 --- a/lock/grpc/types.pb.go +++ b/lock/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: lock/grpc/types.proto package lock diff --git a/netmap/grpc/service.pb.go b/netmap/grpc/service.pb.go index 7694f3f..eb91862 100644 --- a/netmap/grpc/service.pb.go +++ b/netmap/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: netmap/grpc/service.proto package netmap diff --git a/netmap/grpc/service_grpc.pb.go b/netmap/grpc/service_grpc.pb.go index 00cb8de..7881cd6 100644 --- a/netmap/grpc/service_grpc.pb.go +++ b/netmap/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.3 +// - protoc v5.27.2 // source: netmap/grpc/service.proto package netmap diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index 59f8612..8924213 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: netmap/grpc/types.proto package netmap diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index 75d359e..01ba86f 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: object/grpc/service.proto package object @@ -2114,8 +2114,8 @@ func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { // - $Object:split.splitID \ // 16 byte UUIDv4 used to identify the split object hierarchy parts // - $Object:ec.parent \ -// If the object is stored according to EC policy, then ec_parent attribute -// is set to return an id list of all related EC chunks. +// If the object is stored according to EC policy, then ec_parent +// attribute is set to return an id list of all related EC chunks. // // There are some well-known filter aliases to match objects by certain // properties: diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 16af44a..11d132f 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.3 +// - protoc v5.27.2 // source: object/grpc/service.proto package object diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index 16736e9..2a5a2f9 100644 --- a/object/grpc/types.pb.go +++ b/object/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: object/grpc/types.proto package object @@ -824,12 +824,13 @@ type Header_EC struct { // Chunk of a parent header. Header []byte `protobuf:"bytes,5,opt,name=header,proto3" json:"header,omitempty"` // As the origin object is EC-splitted its identifier is known to all - // chunks as parent. But parent itself can be a part of Split (does not relate to EC-split). - // In this case parent_split_id should be set. + // chunks as parent. But parent itself can be a part of Split (does not + // relate to EC-split). In this case parent_split_id should be set. ParentSplitId []byte `protobuf:"bytes,6,opt,name=parent_split_id,json=parentSplitID,proto3" json:"parent_split_id,omitempty"` - // EC-parent's parent ID. parent_split_parent_id is set if EC-parent, itself, is a part of Split and - // if an object ID of its parent is presented. The field allows to determine how EC-chunk is placed - // in Split hierarchy. + // EC-parent's parent ID. parent_split_parent_id is set if EC-parent, + // itself, is a part of Split and if an object ID of its parent is + // presented. The field allows to determine how EC-chunk is placed in Split + // hierarchy. ParentSplitParentId *grpc.ObjectID `protobuf:"bytes,7,opt,name=parent_split_parent_id,json=parentSplitParentID,proto3" json:"parent_split_parent_id,omitempty"` // EC parent's attributes. ParentAttributes []*Header_Attribute `protobuf:"bytes,8,rep,name=parent_attributes,json=parentAttributes,proto3" json:"parent_attributes,omitempty"` diff --git a/refs/grpc/types.pb.go b/refs/grpc/types.pb.go index 681bb0d..ab3ae42 100644 --- a/refs/grpc/types.pb.go +++ b/refs/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: refs/grpc/types.proto package refs diff --git a/rpc/container.go b/rpc/container.go index 1292c22..39213f6 100644 --- a/rpc/container.go +++ b/rpc/container.go @@ -13,7 +13,6 @@ const ( rpcContainerGet = "Get" rpcContainerDel = "Delete" rpcContainerList = "List" - rpcContainerSetEACL = "SetExtendedACL" rpcContainerGetEACL = "GetExtendedACL" rpcContainerUsedSpace = "AnnounceUsedSpace" ) @@ -82,22 +81,6 @@ func ListContainers( return resp, nil } -// SetEACL executes ContainerService.SetExtendedACL RPC. -func SetEACL( - cli *client.Client, - req *container.SetExtendedACLRequest, - opts ...client.CallOption, -) (*container.PutResponse, error) { - resp := new(container.PutResponse) - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerSetEACL), req, resp, opts...) - if err != nil { - return nil, err - } - - return resp, nil -} - // GetEACL executes ContainerService.GetExtendedACL RPC. func GetEACL( cli *client.Client, @@ -113,19 +96,3 @@ func GetEACL( return resp, nil } - -// AnnounceUsedSpace executes ContainerService.AnnounceUsedSpace RPC. -func AnnounceUsedSpace( - cli *client.Client, - req *container.AnnounceUsedSpaceRequest, - opts ...client.CallOption, -) (*container.PutResponse, error) { - resp := new(container.PutResponse) - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerUsedSpace), req, resp, opts...) - if err != nil { - return nil, err - } - - return resp, nil -} diff --git a/session/grpc/service.pb.go b/session/grpc/service.pb.go index a6fa504..b5e999f 100644 --- a/session/grpc/service.pb.go +++ b/session/grpc/service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: session/grpc/service.proto package session diff --git a/session/grpc/service_grpc.pb.go b/session/grpc/service_grpc.pb.go index bdcc3ba..adf6fc1 100644 --- a/session/grpc/service_grpc.pb.go +++ b/session/grpc/service_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.3 +// - protoc v5.27.2 // source: session/grpc/service.proto package session diff --git a/session/grpc/types.pb.go b/session/grpc/types.pb.go index e16a7c6..924df45 100644 --- a/session/grpc/types.pb.go +++ b/session/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: session/grpc/types.proto package session diff --git a/signature/body.go b/signature/body.go index 3362e95..53b5d6b 100644 --- a/signature/body.go +++ b/signature/body.go @@ -46,18 +46,10 @@ func serviceMessageBody(req any) stableMarshaler { return v.GetBody() case *container.ListResponse: return v.GetBody() - case *container.SetExtendedACLRequest: - return v.GetBody() - case *container.SetExtendedACLResponse: - return v.GetBody() case *container.GetExtendedACLRequest: return v.GetBody() case *container.GetExtendedACLResponse: return v.GetBody() - case *container.AnnounceUsedSpaceRequest: - return v.GetBody() - case *container.AnnounceUsedSpaceResponse: - return v.GetBody() /* Object */ case *object.PutRequest: diff --git a/status/grpc/types.pb.go b/status/grpc/types.pb.go index 31f6373..b6b081b 100644 --- a/status/grpc/types.pb.go +++ b/status/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: status/grpc/types.proto package status @@ -150,7 +150,8 @@ const ( // [**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. + // request parameter as the client sent it incorrectly, then this code should + // be used. CommonFail_INVALID_ARGUMENT CommonFail = 4 ) diff --git a/tombstone/grpc/types.pb.go b/tombstone/grpc/types.pb.go index 6a064dc..7d416fe 100644 --- a/tombstone/grpc/types.pb.go +++ b/tombstone/grpc/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: tombstone/grpc/types.proto package tombstone From 9b90d139c5f030d7c7f0be1bddb00f31cab5f404 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 24 Jul 2024 17:40:47 +0300 Subject: [PATCH 110/169] [#94] object: Generate protobufs for `Patch` method * Generate protobufs for patch method; * Create marshalers, unmarshalers, converters for gererated types; * Add unit-tests. Signed-off-by: Airat Arifullin --- object/convert.go | 214 ++++++++ object/grpc/service.go | 52 ++ object/grpc/service.pb.go | 955 ++++++++++++++++++++++++--------- object/grpc/service_grpc.pb.go | 157 ++++++ object/marshal.go | 112 ++++ object/message_test.go | 5 + object/test/generate.go | 57 ++ object/types.go | 32 ++ util/proto/test/test.pb.go | 2 +- 9 files changed, 1341 insertions(+), 245 deletions(-) diff --git a/object/convert.go b/object/convert.go index 6e8ecff..1abfb5e 100644 --- a/object/convert.go +++ b/object/convert.go @@ -2345,3 +2345,217 @@ func (r *PutSingleResponse) FromGRPCMessage(m grpc.Message) error { return r.ResponseHeaders.FromMessage(v) } + +func (r *PatchRequestBodyPatch) ToGRPCMessage() grpc.Message { + var m *object.PatchRequest_Body_Patch + + if r != nil { + m = new(object.PatchRequest_Body_Patch) + + m.SetSourceRange(r.Range.ToGRPCMessage().(*object.Range)) + m.SetChunk(r.Chunk) + } + + return m +} + +func (r *PatchRequestBodyPatch) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PatchRequest_Body_Patch) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + srcRange := v.GetSourceRange() + if srcRange == nil { + r.Range = nil + } else { + if r.Range == nil { + r.Range = new(Range) + } + + err = r.Range.FromGRPCMessage(srcRange) + if err != nil { + return err + } + } + + r.Chunk = v.GetChunk() + + return nil +} + +func (r *PatchRequestBody) ToGRPCMessage() grpc.Message { + var m *object.PatchRequest_Body + + if r != nil { + m = new(object.PatchRequest_Body) + + m.SetAddress(r.Address.ToGRPCMessage().(*refsGRPC.Address)) + m.SetNewAttributes(AttributesToGRPC(r.NewAttributes)) + m.SetReplaceAttributes(r.ReplaceAttributes) + m.SetPatch(r.Patch.ToGRPCMessage().(*object.PatchRequest_Body_Patch)) + } + + return m +} + +func (r *PatchRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PatchRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + addr := v.GetAddress() + if addr == nil { + r.Address = nil + } else { + if r.Address == nil { + r.Address = new(refs.Address) + } + + err = r.Address.FromGRPCMessage(addr) + if err != nil { + return err + } + } + + r.NewAttributes, err = AttributesFromGRPC(v.GetNewAttributes()) + if err != nil { + return err + } + + r.ReplaceAttributes = v.GetReplaceAttributes() + + patch := v.GetPatch() + if patch == nil { + r.Patch = nil + } else { + if r.Patch == nil { + r.Patch = new(PatchRequestBodyPatch) + } + + err = r.Patch.FromGRPCMessage(patch) + if err != nil { + return err + } + } + + return nil +} + +func (r *PatchRequest) ToGRPCMessage() grpc.Message { + var m *object.PatchRequest + + if r != nil { + m = new(object.PatchRequest) + + m.SetBody(r.Body.ToGRPCMessage().(*object.PatchRequest_Body)) + r.RequestHeaders.ToMessage(m) + } + + return m +} + +func (r *PatchRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PatchRequest) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + r.Body = nil + } else { + if r.Body == nil { + r.Body = new(PatchRequestBody) + } + + err = r.Body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.RequestHeaders.FromMessage(v) +} + +func (r *PatchResponseBody) ToGRPCMessage() grpc.Message { + var m *object.PatchResponse_Body + + if r != nil { + m = new(object.PatchResponse_Body) + + m.SetObjectID(r.ObjectID.ToGRPCMessage().(*refsGRPC.ObjectID)) + } + + return m +} + +func (r *PatchResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PatchResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + objID := v.GetObjectId() + if objID == nil { + r.ObjectID = nil + } else { + if r.ObjectID == nil { + r.ObjectID = new(refs.ObjectID) + } + + err = r.ObjectID.FromGRPCMessage(objID) + if err != nil { + return err + } + } + + return nil +} + +func (r *PatchResponse) ToGRPCMessage() grpc.Message { + var m *object.PatchResponse + + if r != nil { + m = new(object.PatchResponse) + + m.SetBody(r.Body.ToGRPCMessage().(*object.PatchResponse_Body)) + r.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (r *PatchResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*object.PatchResponse) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + r.Body = nil + } else { + if r.Body == nil { + r.Body = new(PatchResponseBody) + } + + err = r.Body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return r.ResponseHeaders.FromMessage(v) +} diff --git a/object/grpc/service.go b/object/grpc/service.go index 3ff1f3a..ef6422e 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -556,3 +556,55 @@ func (m *PutSingleResponse) SetMetaHeader(v *session.ResponseMetaHeader) { func (m *PutSingleResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { m.VerifyHeader = v } + +func (m *PatchRequest_Body) SetAddress(addr *refs.Address) { + m.Address = addr +} + +func (m *PatchRequest_Body) SetNewAttributes(attrs []*Header_Attribute) { + m.NewAttributes = attrs +} + +func (m *PatchRequest_Body) SetReplaceAttributes(replaceAttributes bool) { + m.ReplaceAttributes = replaceAttributes +} + +func (m *PatchRequest_Body) SetPatch(patch *PatchRequest_Body_Patch) { + m.Patch = patch +} + +func (m *PatchRequest_Body_Patch) SetSourceRange(r *Range) { + m.SourceRange = r +} + +func (m *PatchRequest_Body_Patch) SetChunk(chunk []byte) { + m.Chunk = chunk +} + +func (m *PatchRequest) SetBody(b *PatchRequest_Body) { + m.Body = b +} + +func (m *PatchRequest) SetMetaHeader(v *session.RequestMetaHeader) { + m.MetaHeader = v +} + +func (m *PatchRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { + m.VerifyHeader = v +} + +func (m *PatchResponse_Body) SetObjectID(objectID *refs.ObjectID) { + m.ObjectId = objectID +} + +func (m *PatchResponse) SetBody(b *PatchResponse_Body) { + m.Body = b +} + +func (m *PatchResponse) SetMetaHeader(v *session.ResponseMetaHeader) { + m.MetaHeader = v +} + +func (m *PatchResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { + m.VerifyHeader = v +} diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index 01ba86f..979c932 100644 --- a/object/grpc/service.pb.go +++ b/object/grpc/service.pb.go @@ -1265,6 +1265,145 @@ func (x *PutSingleResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { return nil } +// Object PATCH request +type PatchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body for patch request message. + Body *PatchRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *PatchRequest) Reset() { + *x = PatchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PatchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchRequest) ProtoMessage() {} + +func (x *PatchRequest) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchRequest.ProtoReflect.Descriptor instead. +func (*PatchRequest) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{18} +} + +func (x *PatchRequest) GetBody() *PatchRequest_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *PatchRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *PatchRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + +// Object PATCH response +type PatchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Body for patch response message. + Body *PatchResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` + // Carries response verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` +} + +func (x *PatchResponse) Reset() { + *x = PatchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PatchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchResponse) ProtoMessage() {} + +func (x *PatchResponse) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchResponse.ProtoReflect.Descriptor instead. +func (*PatchResponse) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{19} +} + +func (x *PatchResponse) GetBody() *PatchResponse_Body { + if x != nil { + return x.Body + } + return nil +} + +func (x *PatchResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} + +func (x *PatchResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} + // GET Object request body type GetRequest_Body struct { state protoimpl.MessageState @@ -1281,7 +1420,7 @@ type GetRequest_Body struct { func (x *GetRequest_Body) Reset() { *x = GetRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[18] + mi := &file_object_grpc_service_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1294,7 +1433,7 @@ func (x *GetRequest_Body) String() string { func (*GetRequest_Body) ProtoMessage() {} func (x *GetRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[18] + mi := &file_object_grpc_service_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1344,7 +1483,7 @@ type GetResponse_Body struct { func (x *GetResponse_Body) Reset() { *x = GetResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[19] + mi := &file_object_grpc_service_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1357,7 +1496,7 @@ func (x *GetResponse_Body) String() string { func (*GetResponse_Body) ProtoMessage() {} func (x *GetResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[19] + mi := &file_object_grpc_service_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1458,7 +1597,7 @@ type GetResponse_Body_Init struct { func (x *GetResponse_Body_Init) Reset() { *x = GetResponse_Body_Init{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[20] + mi := &file_object_grpc_service_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1471,7 +1610,7 @@ func (x *GetResponse_Body_Init) String() string { func (*GetResponse_Body_Init) ProtoMessage() {} func (x *GetResponse_Body_Init) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[20] + mi := &file_object_grpc_service_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1526,7 +1665,7 @@ type PutRequest_Body struct { func (x *PutRequest_Body) Reset() { *x = PutRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[21] + mi := &file_object_grpc_service_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1539,7 +1678,7 @@ func (x *PutRequest_Body) String() string { func (*PutRequest_Body) ProtoMessage() {} func (x *PutRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[21] + mi := &file_object_grpc_service_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1623,7 +1762,7 @@ type PutRequest_Body_Init struct { func (x *PutRequest_Body_Init) Reset() { *x = PutRequest_Body_Init{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[22] + mi := &file_object_grpc_service_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1636,7 +1775,7 @@ func (x *PutRequest_Body_Init) String() string { func (*PutRequest_Body_Init) ProtoMessage() {} func (x *PutRequest_Body_Init) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[22] + mi := &file_object_grpc_service_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1693,7 +1832,7 @@ type PutResponse_Body struct { func (x *PutResponse_Body) Reset() { *x = PutResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[23] + mi := &file_object_grpc_service_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1706,7 +1845,7 @@ func (x *PutResponse_Body) String() string { func (*PutResponse_Body) ProtoMessage() {} func (x *PutResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[23] + mi := &file_object_grpc_service_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1742,7 +1881,7 @@ type DeleteRequest_Body struct { func (x *DeleteRequest_Body) Reset() { *x = DeleteRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[24] + mi := &file_object_grpc_service_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1755,7 +1894,7 @@ func (x *DeleteRequest_Body) String() string { func (*DeleteRequest_Body) ProtoMessage() {} func (x *DeleteRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[24] + mi := &file_object_grpc_service_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1791,7 +1930,7 @@ type DeleteResponse_Body struct { func (x *DeleteResponse_Body) Reset() { *x = DeleteResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[25] + mi := &file_object_grpc_service_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1804,7 +1943,7 @@ func (x *DeleteResponse_Body) String() string { func (*DeleteResponse_Body) ProtoMessage() {} func (x *DeleteResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[25] + mi := &file_object_grpc_service_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1845,7 +1984,7 @@ type HeadRequest_Body struct { func (x *HeadRequest_Body) Reset() { *x = HeadRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[26] + mi := &file_object_grpc_service_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1858,7 +1997,7 @@ func (x *HeadRequest_Body) String() string { func (*HeadRequest_Body) ProtoMessage() {} func (x *HeadRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[26] + mi := &file_object_grpc_service_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1916,7 +2055,7 @@ type HeadResponse_Body struct { func (x *HeadResponse_Body) Reset() { *x = HeadResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[27] + mi := &file_object_grpc_service_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1929,7 +2068,7 @@ func (x *HeadResponse_Body) String() string { func (*HeadResponse_Body) ProtoMessage() {} func (x *HeadResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[27] + mi := &file_object_grpc_service_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2029,7 +2168,7 @@ type SearchRequest_Body struct { func (x *SearchRequest_Body) Reset() { *x = SearchRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[28] + mi := &file_object_grpc_service_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2042,7 +2181,7 @@ func (x *SearchRequest_Body) String() string { func (*SearchRequest_Body) ProtoMessage() {} func (x *SearchRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[28] + mi := &file_object_grpc_service_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2152,7 +2291,7 @@ type SearchRequest_Body_Filter struct { func (x *SearchRequest_Body_Filter) Reset() { *x = SearchRequest_Body_Filter{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[29] + mi := &file_object_grpc_service_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2165,7 +2304,7 @@ func (x *SearchRequest_Body_Filter) String() string { func (*SearchRequest_Body_Filter) ProtoMessage() {} func (x *SearchRequest_Body_Filter) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[29] + mi := &file_object_grpc_service_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2215,7 +2354,7 @@ type SearchResponse_Body struct { func (x *SearchResponse_Body) Reset() { *x = SearchResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[30] + mi := &file_object_grpc_service_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2228,7 +2367,7 @@ func (x *SearchResponse_Body) String() string { func (*SearchResponse_Body) ProtoMessage() {} func (x *SearchResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[30] + mi := &file_object_grpc_service_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2269,7 +2408,7 @@ type GetRangeRequest_Body struct { func (x *GetRangeRequest_Body) Reset() { *x = GetRangeRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[31] + mi := &file_object_grpc_service_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2282,7 +2421,7 @@ func (x *GetRangeRequest_Body) String() string { func (*GetRangeRequest_Body) ProtoMessage() {} func (x *GetRangeRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[31] + mi := &file_object_grpc_service_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2341,7 +2480,7 @@ type GetRangeResponse_Body struct { func (x *GetRangeResponse_Body) Reset() { *x = GetRangeResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[32] + mi := &file_object_grpc_service_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2354,7 +2493,7 @@ func (x *GetRangeResponse_Body) String() string { func (*GetRangeResponse_Body) ProtoMessage() {} func (x *GetRangeResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[32] + mi := &file_object_grpc_service_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2442,7 +2581,7 @@ type GetRangeHashRequest_Body struct { func (x *GetRangeHashRequest_Body) Reset() { *x = GetRangeHashRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[33] + mi := &file_object_grpc_service_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2455,7 +2594,7 @@ func (x *GetRangeHashRequest_Body) String() string { func (*GetRangeHashRequest_Body) ProtoMessage() {} func (x *GetRangeHashRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[33] + mi := &file_object_grpc_service_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2514,7 +2653,7 @@ type GetRangeHashResponse_Body struct { func (x *GetRangeHashResponse_Body) Reset() { *x = GetRangeHashResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[34] + mi := &file_object_grpc_service_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2527,7 +2666,7 @@ func (x *GetRangeHashResponse_Body) String() string { func (*GetRangeHashResponse_Body) ProtoMessage() {} func (x *GetRangeHashResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[34] + mi := &file_object_grpc_service_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2577,7 +2716,7 @@ type PutSingleRequest_Body struct { func (x *PutSingleRequest_Body) Reset() { *x = PutSingleRequest_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[35] + mi := &file_object_grpc_service_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2590,7 +2729,7 @@ func (x *PutSingleRequest_Body) String() string { func (*PutSingleRequest_Body) ProtoMessage() {} func (x *PutSingleRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[35] + mi := &file_object_grpc_service_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2630,7 +2769,7 @@ type PutSingleResponse_Body struct { func (x *PutSingleResponse_Body) Reset() { *x = PutSingleResponse_Body{} if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[36] + mi := &file_object_grpc_service_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2643,7 +2782,7 @@ func (x *PutSingleResponse_Body) String() string { func (*PutSingleResponse_Body) ProtoMessage() {} func (x *PutSingleResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[36] + mi := &file_object_grpc_service_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2659,6 +2798,196 @@ func (*PutSingleResponse_Body) Descriptor() ([]byte, []int) { return file_object_grpc_service_proto_rawDescGZIP(), []int{17, 0} } +// PATCH request body +type PatchRequest_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address of the object that is requested to get patched. + Address *grpc1.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // New attributes for the object. See `replace_attributes` flag usage to define how + // new attributes should be set. + NewAttributes []*Header_Attribute `protobuf:"bytes,2,rep,name=new_attributes,json=newAttributes,proto3" json:"new_attributes,omitempty"` + // If this flag is set, then the object's attributes will be entirely replaced by `new_attributes` list. + // The empty `new_attributes` list with `replace_attributes = true` just resets attributes list for the object. + // + // Default `false` value for this flag means the attributes will be just merged. If the incoming `new_attributes` + // list contains already existing key, then it just replaces it while merging the lists. + ReplaceAttributes bool `protobuf:"varint,3,opt,name=replace_attributes,json=replaceAttributes,proto3" json:"replace_attributes,omitempty"` + // The patch that is applied for the object. + Patch *PatchRequest_Body_Patch `protobuf:"bytes,4,opt,name=patch,proto3" json:"patch,omitempty"` +} + +func (x *PatchRequest_Body) Reset() { + *x = PatchRequest_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PatchRequest_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchRequest_Body) ProtoMessage() {} + +func (x *PatchRequest_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchRequest_Body.ProtoReflect.Descriptor instead. +func (*PatchRequest_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{18, 0} +} + +func (x *PatchRequest_Body) GetAddress() *grpc1.Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *PatchRequest_Body) GetNewAttributes() []*Header_Attribute { + if x != nil { + return x.NewAttributes + } + return nil +} + +func (x *PatchRequest_Body) GetReplaceAttributes() bool { + if x != nil { + return x.ReplaceAttributes + } + return false +} + +func (x *PatchRequest_Body) GetPatch() *PatchRequest_Body_Patch { + if x != nil { + return x.Patch + } + return nil +} + +// The patch for the object's payload. +type PatchRequest_Body_Patch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The range of the source object for which the payload is replaced by the patch's chunk. + // If the range's `length = 0`, then the patch's chunk is just appended to the original payload + // starting from the `offest` without any replace. + SourceRange *Range `protobuf:"bytes,1,opt,name=source_range,json=sourceRange,proto3" json:"source_range,omitempty"` + // The chunk that is being appended to or that replaces the original payload on the given range. + Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` +} + +func (x *PatchRequest_Body_Patch) Reset() { + *x = PatchRequest_Body_Patch{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PatchRequest_Body_Patch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchRequest_Body_Patch) ProtoMessage() {} + +func (x *PatchRequest_Body_Patch) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchRequest_Body_Patch.ProtoReflect.Descriptor instead. +func (*PatchRequest_Body_Patch) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{18, 0, 0} +} + +func (x *PatchRequest_Body_Patch) GetSourceRange() *Range { + if x != nil { + return x.SourceRange + } + return nil +} + +func (x *PatchRequest_Body_Patch) GetChunk() []byte { + if x != nil { + return x.Chunk + } + return nil +} + +// PATCH response body +type PatchResponse_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The object ID of the saved patched object. + ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"` +} + +func (x *PatchResponse_Body) Reset() { + *x = PatchResponse_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_object_grpc_service_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PatchResponse_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchResponse_Body) ProtoMessage() {} + +func (x *PatchResponse_Body) ProtoReflect() protoreflect.Message { + mi := &file_object_grpc_service_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchResponse_Body.ProtoReflect.Descriptor instead. +func (*PatchResponse_Body) Descriptor() ([]byte, []int) { + return file_object_grpc_service_proto_rawDescGZIP(), []int{19, 0} +} + +func (x *PatchResponse_Body) GetObjectId() *grpc1.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} + var File_object_grpc_service_proto protoreflect.FileDescriptor var file_object_grpc_service_proto_rawDesc = []byte{ @@ -3060,54 +3389,113 @@ var file_object_grpc_service_proto_rawDesc = []byte{ 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, 0x06, 0x0a, - 0x04, 0x42, 0x6f, 0x64, 0x79, 0x32, 0x88, 0x05, 0x0a, 0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1c, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, - 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x44, 0x0a, - 0x03, 0x50, 0x75, 0x74, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x28, 0x01, 0x12, 0x4b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1f, 0x2e, + 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xb3, 0x04, 0x0a, 0x0c, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 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, 0xcf, 0x02, 0x0a, 0x04, 0x42, 0x6f, + 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x0e, 0x6e, 0x65, 0x77, 0x5f, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x52, 0x0d, 0x6e, 0x65, 0x77, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x12, 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5f, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x72, 0x65, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, + 0x3f, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x45, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x53, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x12, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5d, 0x0a, 0x0c, 0x47, - 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, - 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, - 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x09, 0x50, 0x75, - 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x53, 0x69, - 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, + 0x74, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, + 0x1a, 0x59, 0x0a, 0x05, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0xa4, 0x02, 0x0a, 0x0d, + 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, - 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, - 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, - 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, - 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x74, 0x63, 0x68, 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, 0x3d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x49, 0x64, 0x32, 0xd4, 0x05, 0x0a, 0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x03, 0x50, 0x75, + 0x74, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, + 0x12, 0x4b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, + 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1f, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x30, 0x01, 0x12, 0x53, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, + 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x09, 0x50, 0x75, 0x74, 0x53, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, + 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x53, + 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, + 0x05, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, + 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, + 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, + 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3122,7 +3510,7 @@ func file_object_grpc_service_proto_rawDescGZIP() []byte { return file_object_grpc_service_proto_rawDescData } -var file_object_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 37) +var file_object_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 42) var file_object_grpc_service_proto_goTypes = []interface{}{ (*GetRequest)(nil), // 0: neo.fs.v2.object.GetRequest (*GetResponse)(nil), // 1: neo.fs.v2.object.GetResponse @@ -3142,145 +3530,164 @@ var file_object_grpc_service_proto_goTypes = []interface{}{ (*GetRangeHashResponse)(nil), // 15: neo.fs.v2.object.GetRangeHashResponse (*PutSingleRequest)(nil), // 16: neo.fs.v2.object.PutSingleRequest (*PutSingleResponse)(nil), // 17: neo.fs.v2.object.PutSingleResponse - (*GetRequest_Body)(nil), // 18: neo.fs.v2.object.GetRequest.Body - (*GetResponse_Body)(nil), // 19: neo.fs.v2.object.GetResponse.Body - (*GetResponse_Body_Init)(nil), // 20: neo.fs.v2.object.GetResponse.Body.Init - (*PutRequest_Body)(nil), // 21: neo.fs.v2.object.PutRequest.Body - (*PutRequest_Body_Init)(nil), // 22: neo.fs.v2.object.PutRequest.Body.Init - (*PutResponse_Body)(nil), // 23: neo.fs.v2.object.PutResponse.Body - (*DeleteRequest_Body)(nil), // 24: neo.fs.v2.object.DeleteRequest.Body - (*DeleteResponse_Body)(nil), // 25: neo.fs.v2.object.DeleteResponse.Body - (*HeadRequest_Body)(nil), // 26: neo.fs.v2.object.HeadRequest.Body - (*HeadResponse_Body)(nil), // 27: neo.fs.v2.object.HeadResponse.Body - (*SearchRequest_Body)(nil), // 28: neo.fs.v2.object.SearchRequest.Body - (*SearchRequest_Body_Filter)(nil), // 29: neo.fs.v2.object.SearchRequest.Body.Filter - (*SearchResponse_Body)(nil), // 30: neo.fs.v2.object.SearchResponse.Body - (*GetRangeRequest_Body)(nil), // 31: neo.fs.v2.object.GetRangeRequest.Body - (*GetRangeResponse_Body)(nil), // 32: neo.fs.v2.object.GetRangeResponse.Body - (*GetRangeHashRequest_Body)(nil), // 33: neo.fs.v2.object.GetRangeHashRequest.Body - (*GetRangeHashResponse_Body)(nil), // 34: neo.fs.v2.object.GetRangeHashResponse.Body - (*PutSingleRequest_Body)(nil), // 35: neo.fs.v2.object.PutSingleRequest.Body - (*PutSingleResponse_Body)(nil), // 36: neo.fs.v2.object.PutSingleResponse.Body - (*grpc.RequestMetaHeader)(nil), // 37: neo.fs.v2.session.RequestMetaHeader - (*grpc.RequestVerificationHeader)(nil), // 38: neo.fs.v2.session.RequestVerificationHeader - (*grpc.ResponseMetaHeader)(nil), // 39: neo.fs.v2.session.ResponseMetaHeader - (*grpc.ResponseVerificationHeader)(nil), // 40: neo.fs.v2.session.ResponseVerificationHeader - (*Header)(nil), // 41: neo.fs.v2.object.Header - (*grpc1.Signature)(nil), // 42: neo.fs.v2.refs.Signature - (*grpc1.Address)(nil), // 43: neo.fs.v2.refs.Address - (*SplitInfo)(nil), // 44: neo.fs.v2.object.SplitInfo - (*ECInfo)(nil), // 45: neo.fs.v2.object.ECInfo - (*grpc1.ObjectID)(nil), // 46: neo.fs.v2.refs.ObjectID - (*ShortHeader)(nil), // 47: neo.fs.v2.object.ShortHeader - (*grpc1.ContainerID)(nil), // 48: neo.fs.v2.refs.ContainerID - (MatchType)(0), // 49: neo.fs.v2.object.MatchType - (grpc1.ChecksumType)(0), // 50: neo.fs.v2.refs.ChecksumType - (*Object)(nil), // 51: neo.fs.v2.object.Object + (*PatchRequest)(nil), // 18: neo.fs.v2.object.PatchRequest + (*PatchResponse)(nil), // 19: neo.fs.v2.object.PatchResponse + (*GetRequest_Body)(nil), // 20: neo.fs.v2.object.GetRequest.Body + (*GetResponse_Body)(nil), // 21: neo.fs.v2.object.GetResponse.Body + (*GetResponse_Body_Init)(nil), // 22: neo.fs.v2.object.GetResponse.Body.Init + (*PutRequest_Body)(nil), // 23: neo.fs.v2.object.PutRequest.Body + (*PutRequest_Body_Init)(nil), // 24: neo.fs.v2.object.PutRequest.Body.Init + (*PutResponse_Body)(nil), // 25: neo.fs.v2.object.PutResponse.Body + (*DeleteRequest_Body)(nil), // 26: neo.fs.v2.object.DeleteRequest.Body + (*DeleteResponse_Body)(nil), // 27: neo.fs.v2.object.DeleteResponse.Body + (*HeadRequest_Body)(nil), // 28: neo.fs.v2.object.HeadRequest.Body + (*HeadResponse_Body)(nil), // 29: neo.fs.v2.object.HeadResponse.Body + (*SearchRequest_Body)(nil), // 30: neo.fs.v2.object.SearchRequest.Body + (*SearchRequest_Body_Filter)(nil), // 31: neo.fs.v2.object.SearchRequest.Body.Filter + (*SearchResponse_Body)(nil), // 32: neo.fs.v2.object.SearchResponse.Body + (*GetRangeRequest_Body)(nil), // 33: neo.fs.v2.object.GetRangeRequest.Body + (*GetRangeResponse_Body)(nil), // 34: neo.fs.v2.object.GetRangeResponse.Body + (*GetRangeHashRequest_Body)(nil), // 35: neo.fs.v2.object.GetRangeHashRequest.Body + (*GetRangeHashResponse_Body)(nil), // 36: neo.fs.v2.object.GetRangeHashResponse.Body + (*PutSingleRequest_Body)(nil), // 37: neo.fs.v2.object.PutSingleRequest.Body + (*PutSingleResponse_Body)(nil), // 38: neo.fs.v2.object.PutSingleResponse.Body + (*PatchRequest_Body)(nil), // 39: neo.fs.v2.object.PatchRequest.Body + (*PatchRequest_Body_Patch)(nil), // 40: neo.fs.v2.object.PatchRequest.Body.Patch + (*PatchResponse_Body)(nil), // 41: neo.fs.v2.object.PatchResponse.Body + (*grpc.RequestMetaHeader)(nil), // 42: neo.fs.v2.session.RequestMetaHeader + (*grpc.RequestVerificationHeader)(nil), // 43: neo.fs.v2.session.RequestVerificationHeader + (*grpc.ResponseMetaHeader)(nil), // 44: neo.fs.v2.session.ResponseMetaHeader + (*grpc.ResponseVerificationHeader)(nil), // 45: neo.fs.v2.session.ResponseVerificationHeader + (*Header)(nil), // 46: neo.fs.v2.object.Header + (*grpc1.Signature)(nil), // 47: neo.fs.v2.refs.Signature + (*grpc1.Address)(nil), // 48: neo.fs.v2.refs.Address + (*SplitInfo)(nil), // 49: neo.fs.v2.object.SplitInfo + (*ECInfo)(nil), // 50: neo.fs.v2.object.ECInfo + (*grpc1.ObjectID)(nil), // 51: neo.fs.v2.refs.ObjectID + (*ShortHeader)(nil), // 52: neo.fs.v2.object.ShortHeader + (*grpc1.ContainerID)(nil), // 53: neo.fs.v2.refs.ContainerID + (MatchType)(0), // 54: neo.fs.v2.object.MatchType + (grpc1.ChecksumType)(0), // 55: neo.fs.v2.refs.ChecksumType + (*Object)(nil), // 56: neo.fs.v2.object.Object + (*Header_Attribute)(nil), // 57: neo.fs.v2.object.Header.Attribute } var file_object_grpc_service_proto_depIdxs = []int32{ - 18, // 0: neo.fs.v2.object.GetRequest.body:type_name -> neo.fs.v2.object.GetRequest.Body - 37, // 1: neo.fs.v2.object.GetRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 38, // 2: neo.fs.v2.object.GetRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 19, // 3: neo.fs.v2.object.GetResponse.body:type_name -> neo.fs.v2.object.GetResponse.Body - 39, // 4: neo.fs.v2.object.GetResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 40, // 5: neo.fs.v2.object.GetResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 21, // 6: neo.fs.v2.object.PutRequest.body:type_name -> neo.fs.v2.object.PutRequest.Body - 37, // 7: neo.fs.v2.object.PutRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 38, // 8: neo.fs.v2.object.PutRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 23, // 9: neo.fs.v2.object.PutResponse.body:type_name -> neo.fs.v2.object.PutResponse.Body - 39, // 10: neo.fs.v2.object.PutResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 40, // 11: neo.fs.v2.object.PutResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 24, // 12: neo.fs.v2.object.DeleteRequest.body:type_name -> neo.fs.v2.object.DeleteRequest.Body - 37, // 13: neo.fs.v2.object.DeleteRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 38, // 14: neo.fs.v2.object.DeleteRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 25, // 15: neo.fs.v2.object.DeleteResponse.body:type_name -> neo.fs.v2.object.DeleteResponse.Body - 39, // 16: neo.fs.v2.object.DeleteResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 40, // 17: neo.fs.v2.object.DeleteResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 26, // 18: neo.fs.v2.object.HeadRequest.body:type_name -> neo.fs.v2.object.HeadRequest.Body - 37, // 19: neo.fs.v2.object.HeadRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 38, // 20: neo.fs.v2.object.HeadRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 41, // 21: neo.fs.v2.object.HeaderWithSignature.header:type_name -> neo.fs.v2.object.Header - 42, // 22: neo.fs.v2.object.HeaderWithSignature.signature:type_name -> neo.fs.v2.refs.Signature - 27, // 23: neo.fs.v2.object.HeadResponse.body:type_name -> neo.fs.v2.object.HeadResponse.Body - 39, // 24: neo.fs.v2.object.HeadResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 40, // 25: neo.fs.v2.object.HeadResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 28, // 26: neo.fs.v2.object.SearchRequest.body:type_name -> neo.fs.v2.object.SearchRequest.Body - 37, // 27: neo.fs.v2.object.SearchRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 38, // 28: neo.fs.v2.object.SearchRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 30, // 29: neo.fs.v2.object.SearchResponse.body:type_name -> neo.fs.v2.object.SearchResponse.Body - 39, // 30: neo.fs.v2.object.SearchResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 40, // 31: neo.fs.v2.object.SearchResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 31, // 32: neo.fs.v2.object.GetRangeRequest.body:type_name -> neo.fs.v2.object.GetRangeRequest.Body - 37, // 33: neo.fs.v2.object.GetRangeRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 38, // 34: neo.fs.v2.object.GetRangeRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 32, // 35: neo.fs.v2.object.GetRangeResponse.body:type_name -> neo.fs.v2.object.GetRangeResponse.Body - 39, // 36: neo.fs.v2.object.GetRangeResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 40, // 37: neo.fs.v2.object.GetRangeResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 33, // 38: neo.fs.v2.object.GetRangeHashRequest.body:type_name -> neo.fs.v2.object.GetRangeHashRequest.Body - 37, // 39: neo.fs.v2.object.GetRangeHashRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 38, // 40: neo.fs.v2.object.GetRangeHashRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 34, // 41: neo.fs.v2.object.GetRangeHashResponse.body:type_name -> neo.fs.v2.object.GetRangeHashResponse.Body - 39, // 42: neo.fs.v2.object.GetRangeHashResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 40, // 43: neo.fs.v2.object.GetRangeHashResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 35, // 44: neo.fs.v2.object.PutSingleRequest.body:type_name -> neo.fs.v2.object.PutSingleRequest.Body - 37, // 45: neo.fs.v2.object.PutSingleRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 38, // 46: neo.fs.v2.object.PutSingleRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 36, // 47: neo.fs.v2.object.PutSingleResponse.body:type_name -> neo.fs.v2.object.PutSingleResponse.Body - 39, // 48: neo.fs.v2.object.PutSingleResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 40, // 49: neo.fs.v2.object.PutSingleResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 43, // 50: neo.fs.v2.object.GetRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 20, // 51: neo.fs.v2.object.GetResponse.Body.init:type_name -> neo.fs.v2.object.GetResponse.Body.Init - 44, // 52: neo.fs.v2.object.GetResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 45, // 53: neo.fs.v2.object.GetResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo - 46, // 54: neo.fs.v2.object.GetResponse.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID - 42, // 55: neo.fs.v2.object.GetResponse.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature - 41, // 56: neo.fs.v2.object.GetResponse.Body.Init.header:type_name -> neo.fs.v2.object.Header - 22, // 57: neo.fs.v2.object.PutRequest.Body.init:type_name -> neo.fs.v2.object.PutRequest.Body.Init - 46, // 58: neo.fs.v2.object.PutRequest.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID - 42, // 59: neo.fs.v2.object.PutRequest.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature - 41, // 60: neo.fs.v2.object.PutRequest.Body.Init.header:type_name -> neo.fs.v2.object.Header - 46, // 61: neo.fs.v2.object.PutResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID - 43, // 62: neo.fs.v2.object.DeleteRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 43, // 63: neo.fs.v2.object.DeleteResponse.Body.tombstone:type_name -> neo.fs.v2.refs.Address - 43, // 64: neo.fs.v2.object.HeadRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 7, // 65: neo.fs.v2.object.HeadResponse.Body.header:type_name -> neo.fs.v2.object.HeaderWithSignature - 47, // 66: neo.fs.v2.object.HeadResponse.Body.short_header:type_name -> neo.fs.v2.object.ShortHeader - 44, // 67: neo.fs.v2.object.HeadResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 45, // 68: neo.fs.v2.object.HeadResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo - 48, // 69: neo.fs.v2.object.SearchRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 29, // 70: neo.fs.v2.object.SearchRequest.Body.filters:type_name -> neo.fs.v2.object.SearchRequest.Body.Filter - 49, // 71: neo.fs.v2.object.SearchRequest.Body.Filter.match_type:type_name -> neo.fs.v2.object.MatchType - 46, // 72: neo.fs.v2.object.SearchResponse.Body.id_list:type_name -> neo.fs.v2.refs.ObjectID - 43, // 73: neo.fs.v2.object.GetRangeRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 11, // 74: neo.fs.v2.object.GetRangeRequest.Body.range:type_name -> neo.fs.v2.object.Range - 44, // 75: neo.fs.v2.object.GetRangeResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 45, // 76: neo.fs.v2.object.GetRangeResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo - 43, // 77: neo.fs.v2.object.GetRangeHashRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 11, // 78: neo.fs.v2.object.GetRangeHashRequest.Body.ranges:type_name -> neo.fs.v2.object.Range - 50, // 79: neo.fs.v2.object.GetRangeHashRequest.Body.type:type_name -> neo.fs.v2.refs.ChecksumType - 50, // 80: neo.fs.v2.object.GetRangeHashResponse.Body.type:type_name -> neo.fs.v2.refs.ChecksumType - 51, // 81: neo.fs.v2.object.PutSingleRequest.Body.object:type_name -> neo.fs.v2.object.Object - 0, // 82: neo.fs.v2.object.ObjectService.Get:input_type -> neo.fs.v2.object.GetRequest - 2, // 83: neo.fs.v2.object.ObjectService.Put:input_type -> neo.fs.v2.object.PutRequest - 4, // 84: neo.fs.v2.object.ObjectService.Delete:input_type -> neo.fs.v2.object.DeleteRequest - 6, // 85: neo.fs.v2.object.ObjectService.Head:input_type -> neo.fs.v2.object.HeadRequest - 9, // 86: neo.fs.v2.object.ObjectService.Search:input_type -> neo.fs.v2.object.SearchRequest - 12, // 87: neo.fs.v2.object.ObjectService.GetRange:input_type -> neo.fs.v2.object.GetRangeRequest - 14, // 88: neo.fs.v2.object.ObjectService.GetRangeHash:input_type -> neo.fs.v2.object.GetRangeHashRequest - 16, // 89: neo.fs.v2.object.ObjectService.PutSingle:input_type -> neo.fs.v2.object.PutSingleRequest - 1, // 90: neo.fs.v2.object.ObjectService.Get:output_type -> neo.fs.v2.object.GetResponse - 3, // 91: neo.fs.v2.object.ObjectService.Put:output_type -> neo.fs.v2.object.PutResponse - 5, // 92: neo.fs.v2.object.ObjectService.Delete:output_type -> neo.fs.v2.object.DeleteResponse - 8, // 93: neo.fs.v2.object.ObjectService.Head:output_type -> neo.fs.v2.object.HeadResponse - 10, // 94: neo.fs.v2.object.ObjectService.Search:output_type -> neo.fs.v2.object.SearchResponse - 13, // 95: neo.fs.v2.object.ObjectService.GetRange:output_type -> neo.fs.v2.object.GetRangeResponse - 15, // 96: neo.fs.v2.object.ObjectService.GetRangeHash:output_type -> neo.fs.v2.object.GetRangeHashResponse - 17, // 97: neo.fs.v2.object.ObjectService.PutSingle:output_type -> neo.fs.v2.object.PutSingleResponse - 90, // [90:98] is the sub-list for method output_type - 82, // [82:90] is the sub-list for method input_type - 82, // [82:82] is the sub-list for extension type_name - 82, // [82:82] is the sub-list for extension extendee - 0, // [0:82] is the sub-list for field type_name + 20, // 0: neo.fs.v2.object.GetRequest.body:type_name -> neo.fs.v2.object.GetRequest.Body + 42, // 1: neo.fs.v2.object.GetRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 43, // 2: neo.fs.v2.object.GetRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 21, // 3: neo.fs.v2.object.GetResponse.body:type_name -> neo.fs.v2.object.GetResponse.Body + 44, // 4: neo.fs.v2.object.GetResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 45, // 5: neo.fs.v2.object.GetResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 23, // 6: neo.fs.v2.object.PutRequest.body:type_name -> neo.fs.v2.object.PutRequest.Body + 42, // 7: neo.fs.v2.object.PutRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 43, // 8: neo.fs.v2.object.PutRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 25, // 9: neo.fs.v2.object.PutResponse.body:type_name -> neo.fs.v2.object.PutResponse.Body + 44, // 10: neo.fs.v2.object.PutResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 45, // 11: neo.fs.v2.object.PutResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 26, // 12: neo.fs.v2.object.DeleteRequest.body:type_name -> neo.fs.v2.object.DeleteRequest.Body + 42, // 13: neo.fs.v2.object.DeleteRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 43, // 14: neo.fs.v2.object.DeleteRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 27, // 15: neo.fs.v2.object.DeleteResponse.body:type_name -> neo.fs.v2.object.DeleteResponse.Body + 44, // 16: neo.fs.v2.object.DeleteResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 45, // 17: neo.fs.v2.object.DeleteResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 28, // 18: neo.fs.v2.object.HeadRequest.body:type_name -> neo.fs.v2.object.HeadRequest.Body + 42, // 19: neo.fs.v2.object.HeadRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 43, // 20: neo.fs.v2.object.HeadRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 46, // 21: neo.fs.v2.object.HeaderWithSignature.header:type_name -> neo.fs.v2.object.Header + 47, // 22: neo.fs.v2.object.HeaderWithSignature.signature:type_name -> neo.fs.v2.refs.Signature + 29, // 23: neo.fs.v2.object.HeadResponse.body:type_name -> neo.fs.v2.object.HeadResponse.Body + 44, // 24: neo.fs.v2.object.HeadResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 45, // 25: neo.fs.v2.object.HeadResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 30, // 26: neo.fs.v2.object.SearchRequest.body:type_name -> neo.fs.v2.object.SearchRequest.Body + 42, // 27: neo.fs.v2.object.SearchRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 43, // 28: neo.fs.v2.object.SearchRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 32, // 29: neo.fs.v2.object.SearchResponse.body:type_name -> neo.fs.v2.object.SearchResponse.Body + 44, // 30: neo.fs.v2.object.SearchResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 45, // 31: neo.fs.v2.object.SearchResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 33, // 32: neo.fs.v2.object.GetRangeRequest.body:type_name -> neo.fs.v2.object.GetRangeRequest.Body + 42, // 33: neo.fs.v2.object.GetRangeRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 43, // 34: neo.fs.v2.object.GetRangeRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 34, // 35: neo.fs.v2.object.GetRangeResponse.body:type_name -> neo.fs.v2.object.GetRangeResponse.Body + 44, // 36: neo.fs.v2.object.GetRangeResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 45, // 37: neo.fs.v2.object.GetRangeResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 35, // 38: neo.fs.v2.object.GetRangeHashRequest.body:type_name -> neo.fs.v2.object.GetRangeHashRequest.Body + 42, // 39: neo.fs.v2.object.GetRangeHashRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 43, // 40: neo.fs.v2.object.GetRangeHashRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 36, // 41: neo.fs.v2.object.GetRangeHashResponse.body:type_name -> neo.fs.v2.object.GetRangeHashResponse.Body + 44, // 42: neo.fs.v2.object.GetRangeHashResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 45, // 43: neo.fs.v2.object.GetRangeHashResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 37, // 44: neo.fs.v2.object.PutSingleRequest.body:type_name -> neo.fs.v2.object.PutSingleRequest.Body + 42, // 45: neo.fs.v2.object.PutSingleRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 43, // 46: neo.fs.v2.object.PutSingleRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 38, // 47: neo.fs.v2.object.PutSingleResponse.body:type_name -> neo.fs.v2.object.PutSingleResponse.Body + 44, // 48: neo.fs.v2.object.PutSingleResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 45, // 49: neo.fs.v2.object.PutSingleResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 39, // 50: neo.fs.v2.object.PatchRequest.body:type_name -> neo.fs.v2.object.PatchRequest.Body + 42, // 51: neo.fs.v2.object.PatchRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader + 43, // 52: neo.fs.v2.object.PatchRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader + 41, // 53: neo.fs.v2.object.PatchResponse.body:type_name -> neo.fs.v2.object.PatchResponse.Body + 44, // 54: neo.fs.v2.object.PatchResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader + 45, // 55: neo.fs.v2.object.PatchResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader + 48, // 56: neo.fs.v2.object.GetRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 22, // 57: neo.fs.v2.object.GetResponse.Body.init:type_name -> neo.fs.v2.object.GetResponse.Body.Init + 49, // 58: neo.fs.v2.object.GetResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 50, // 59: neo.fs.v2.object.GetResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo + 51, // 60: neo.fs.v2.object.GetResponse.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID + 47, // 61: neo.fs.v2.object.GetResponse.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature + 46, // 62: neo.fs.v2.object.GetResponse.Body.Init.header:type_name -> neo.fs.v2.object.Header + 24, // 63: neo.fs.v2.object.PutRequest.Body.init:type_name -> neo.fs.v2.object.PutRequest.Body.Init + 51, // 64: neo.fs.v2.object.PutRequest.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID + 47, // 65: neo.fs.v2.object.PutRequest.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature + 46, // 66: neo.fs.v2.object.PutRequest.Body.Init.header:type_name -> neo.fs.v2.object.Header + 51, // 67: neo.fs.v2.object.PutResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID + 48, // 68: neo.fs.v2.object.DeleteRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 48, // 69: neo.fs.v2.object.DeleteResponse.Body.tombstone:type_name -> neo.fs.v2.refs.Address + 48, // 70: neo.fs.v2.object.HeadRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 7, // 71: neo.fs.v2.object.HeadResponse.Body.header:type_name -> neo.fs.v2.object.HeaderWithSignature + 52, // 72: neo.fs.v2.object.HeadResponse.Body.short_header:type_name -> neo.fs.v2.object.ShortHeader + 49, // 73: neo.fs.v2.object.HeadResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 50, // 74: neo.fs.v2.object.HeadResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo + 53, // 75: neo.fs.v2.object.SearchRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID + 31, // 76: neo.fs.v2.object.SearchRequest.Body.filters:type_name -> neo.fs.v2.object.SearchRequest.Body.Filter + 54, // 77: neo.fs.v2.object.SearchRequest.Body.Filter.match_type:type_name -> neo.fs.v2.object.MatchType + 51, // 78: neo.fs.v2.object.SearchResponse.Body.id_list:type_name -> neo.fs.v2.refs.ObjectID + 48, // 79: neo.fs.v2.object.GetRangeRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 11, // 80: neo.fs.v2.object.GetRangeRequest.Body.range:type_name -> neo.fs.v2.object.Range + 49, // 81: neo.fs.v2.object.GetRangeResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo + 50, // 82: neo.fs.v2.object.GetRangeResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo + 48, // 83: neo.fs.v2.object.GetRangeHashRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 11, // 84: neo.fs.v2.object.GetRangeHashRequest.Body.ranges:type_name -> neo.fs.v2.object.Range + 55, // 85: neo.fs.v2.object.GetRangeHashRequest.Body.type:type_name -> neo.fs.v2.refs.ChecksumType + 55, // 86: neo.fs.v2.object.GetRangeHashResponse.Body.type:type_name -> neo.fs.v2.refs.ChecksumType + 56, // 87: neo.fs.v2.object.PutSingleRequest.Body.object:type_name -> neo.fs.v2.object.Object + 48, // 88: neo.fs.v2.object.PatchRequest.Body.address:type_name -> neo.fs.v2.refs.Address + 57, // 89: neo.fs.v2.object.PatchRequest.Body.new_attributes:type_name -> neo.fs.v2.object.Header.Attribute + 40, // 90: neo.fs.v2.object.PatchRequest.Body.patch:type_name -> neo.fs.v2.object.PatchRequest.Body.Patch + 11, // 91: neo.fs.v2.object.PatchRequest.Body.Patch.source_range:type_name -> neo.fs.v2.object.Range + 51, // 92: neo.fs.v2.object.PatchResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID + 0, // 93: neo.fs.v2.object.ObjectService.Get:input_type -> neo.fs.v2.object.GetRequest + 2, // 94: neo.fs.v2.object.ObjectService.Put:input_type -> neo.fs.v2.object.PutRequest + 4, // 95: neo.fs.v2.object.ObjectService.Delete:input_type -> neo.fs.v2.object.DeleteRequest + 6, // 96: neo.fs.v2.object.ObjectService.Head:input_type -> neo.fs.v2.object.HeadRequest + 9, // 97: neo.fs.v2.object.ObjectService.Search:input_type -> neo.fs.v2.object.SearchRequest + 12, // 98: neo.fs.v2.object.ObjectService.GetRange:input_type -> neo.fs.v2.object.GetRangeRequest + 14, // 99: neo.fs.v2.object.ObjectService.GetRangeHash:input_type -> neo.fs.v2.object.GetRangeHashRequest + 16, // 100: neo.fs.v2.object.ObjectService.PutSingle:input_type -> neo.fs.v2.object.PutSingleRequest + 18, // 101: neo.fs.v2.object.ObjectService.Patch:input_type -> neo.fs.v2.object.PatchRequest + 1, // 102: neo.fs.v2.object.ObjectService.Get:output_type -> neo.fs.v2.object.GetResponse + 3, // 103: neo.fs.v2.object.ObjectService.Put:output_type -> neo.fs.v2.object.PutResponse + 5, // 104: neo.fs.v2.object.ObjectService.Delete:output_type -> neo.fs.v2.object.DeleteResponse + 8, // 105: neo.fs.v2.object.ObjectService.Head:output_type -> neo.fs.v2.object.HeadResponse + 10, // 106: neo.fs.v2.object.ObjectService.Search:output_type -> neo.fs.v2.object.SearchResponse + 13, // 107: neo.fs.v2.object.ObjectService.GetRange:output_type -> neo.fs.v2.object.GetRangeResponse + 15, // 108: neo.fs.v2.object.ObjectService.GetRangeHash:output_type -> neo.fs.v2.object.GetRangeHashResponse + 17, // 109: neo.fs.v2.object.ObjectService.PutSingle:output_type -> neo.fs.v2.object.PutSingleResponse + 19, // 110: neo.fs.v2.object.ObjectService.Patch:output_type -> neo.fs.v2.object.PatchResponse + 102, // [102:111] is the sub-list for method output_type + 93, // [93:102] is the sub-list for method input_type + 93, // [93:93] is the sub-list for extension type_name + 93, // [93:93] is the sub-list for extension extendee + 0, // [0:93] is the sub-list for field type_name } func init() { file_object_grpc_service_proto_init() } @@ -3507,7 +3914,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest_Body); i { + switch v := v.(*PatchRequest); i { case 0: return &v.state case 1: @@ -3519,7 +3926,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse_Body); i { + switch v := v.(*PatchResponse); i { case 0: return &v.state case 1: @@ -3531,7 +3938,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse_Body_Init); i { + switch v := v.(*GetRequest_Body); i { case 0: return &v.state case 1: @@ -3543,7 +3950,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutRequest_Body); i { + switch v := v.(*GetResponse_Body); i { case 0: return &v.state case 1: @@ -3555,7 +3962,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutRequest_Body_Init); i { + switch v := v.(*GetResponse_Body_Init); i { case 0: return &v.state case 1: @@ -3567,7 +3974,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutResponse_Body); i { + switch v := v.(*PutRequest_Body); i { case 0: return &v.state case 1: @@ -3579,7 +3986,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRequest_Body); i { + switch v := v.(*PutRequest_Body_Init); i { case 0: return &v.state case 1: @@ -3591,7 +3998,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResponse_Body); i { + switch v := v.(*PutResponse_Body); i { case 0: return &v.state case 1: @@ -3603,7 +4010,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadRequest_Body); i { + switch v := v.(*DeleteRequest_Body); i { case 0: return &v.state case 1: @@ -3615,7 +4022,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadResponse_Body); i { + switch v := v.(*DeleteResponse_Body); i { case 0: return &v.state case 1: @@ -3627,7 +4034,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchRequest_Body); i { + switch v := v.(*HeadRequest_Body); i { case 0: return &v.state case 1: @@ -3639,7 +4046,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchRequest_Body_Filter); i { + switch v := v.(*HeadResponse_Body); i { case 0: return &v.state case 1: @@ -3651,7 +4058,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchResponse_Body); i { + switch v := v.(*SearchRequest_Body); i { case 0: return &v.state case 1: @@ -3663,7 +4070,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeRequest_Body); i { + switch v := v.(*SearchRequest_Body_Filter); i { case 0: return &v.state case 1: @@ -3675,7 +4082,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeResponse_Body); i { + switch v := v.(*SearchResponse_Body); i { case 0: return &v.state case 1: @@ -3687,7 +4094,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeHashRequest_Body); i { + switch v := v.(*GetRangeRequest_Body); i { case 0: return &v.state case 1: @@ -3699,7 +4106,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeHashResponse_Body); i { + switch v := v.(*GetRangeResponse_Body); i { case 0: return &v.state case 1: @@ -3711,7 +4118,7 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutSingleRequest_Body); i { + switch v := v.(*GetRangeHashRequest_Body); i { case 0: return &v.state case 1: @@ -3723,6 +4130,30 @@ func file_object_grpc_service_proto_init() { } } file_object_grpc_service_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRangeHashResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutSingleRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PutSingleResponse_Body); i { case 0: return &v.state @@ -3734,24 +4165,60 @@ func file_object_grpc_service_proto_init() { return nil } } + file_object_grpc_service_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PatchRequest_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PatchRequest_Body_Patch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_object_grpc_service_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PatchResponse_Body); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } - file_object_grpc_service_proto_msgTypes[19].OneofWrappers = []interface{}{ + file_object_grpc_service_proto_msgTypes[21].OneofWrappers = []interface{}{ (*GetResponse_Body_Init_)(nil), (*GetResponse_Body_Chunk)(nil), (*GetResponse_Body_SplitInfo)(nil), (*GetResponse_Body_EcInfo)(nil), } - file_object_grpc_service_proto_msgTypes[21].OneofWrappers = []interface{}{ + file_object_grpc_service_proto_msgTypes[23].OneofWrappers = []interface{}{ (*PutRequest_Body_Init_)(nil), (*PutRequest_Body_Chunk)(nil), } - file_object_grpc_service_proto_msgTypes[27].OneofWrappers = []interface{}{ + file_object_grpc_service_proto_msgTypes[29].OneofWrappers = []interface{}{ (*HeadResponse_Body_Header)(nil), (*HeadResponse_Body_ShortHeader)(nil), (*HeadResponse_Body_SplitInfo)(nil), (*HeadResponse_Body_EcInfo)(nil), } - file_object_grpc_service_proto_msgTypes[32].OneofWrappers = []interface{}{ + file_object_grpc_service_proto_msgTypes[34].OneofWrappers = []interface{}{ (*GetRangeResponse_Body_Chunk)(nil), (*GetRangeResponse_Body_SplitInfo)(nil), (*GetRangeResponse_Body_EcInfo)(nil), @@ -3762,7 +4229,7 @@ func file_object_grpc_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_object_grpc_service_proto_rawDesc, NumEnums: 0, - NumMessages: 37, + NumMessages: 42, NumExtensions: 0, NumServices: 1, }, diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 11d132f..2494be9 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -27,6 +27,7 @@ const ( ObjectService_GetRange_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRange" ObjectService_GetRangeHash_FullMethodName = "/neo.fs.v2.object.ObjectService/GetRangeHash" ObjectService_PutSingle_FullMethodName = "/neo.fs.v2.object.ObjectService/PutSingle" + ObjectService_Patch_FullMethodName = "/neo.fs.v2.object.ObjectService/Patch" ) // ObjectServiceClient is the client API for ObjectService service. @@ -299,6 +300,50 @@ type ObjectServiceClient interface { // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. PutSingle(ctx context.Context, in *PutSingleRequest, opts ...grpc.CallOption) (*PutSingleResponse, error) + // Patch the object. Request uses gRPC stream. First message must set + // the address of the object that is going to get patched. If the object's attributes + // are patched, then these attrubutes must be set only within the first stream message. + // + // If the patch request is performed by NOT the object's owner but if the actor has the permission + // to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner + // loses the object's ownership after the patch request is successfully done. + // + // As objects are content-addressable the patching causes new object ID generation for the patched object. + // This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases: + // 1. The chunk of the applying patch contains the same value as the object's payload within the same range; + // 2. The patch that reverts the changes applied by preceding patch; + // 3. The application of the same patches for the object a few times. + // + // Extended headers can change `Patch` behaviour: + // - [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully patched and saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or + // has been deleted; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Patch(ctx context.Context, opts ...grpc.CallOption) (ObjectService_PatchClient, error) } type objectServiceClient struct { @@ -475,6 +520,40 @@ func (c *objectServiceClient) PutSingle(ctx context.Context, in *PutSingleReques 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...) + if err != nil { + return nil, err + } + x := &objectServicePatchClient{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 +} + // ObjectServiceServer is the server API for ObjectService service. // All implementations should embed UnimplementedObjectServiceServer // for forward compatibility @@ -745,6 +824,50 @@ type ObjectServiceServer interface { // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error) + // Patch the object. Request uses gRPC stream. First message must set + // the address of the object that is going to get patched. If the object's attributes + // are patched, then these attrubutes must be set only within the first stream message. + // + // If the patch request is performed by NOT the object's owner but if the actor has the permission + // to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner + // loses the object's ownership after the patch request is successfully done. + // + // As objects are content-addressable the patching causes new object ID generation for the patched object. + // This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases: + // 1. The chunk of the applying patch contains the same value as the object's payload within the same range; + // 2. The patch that reverts the changes applied by preceding patch; + // 3. The application of the same patches for the object a few times. + // + // Extended headers can change `Patch` behaviour: + // - [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully patched and saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or + // has been deleted; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + Patch(ObjectService_PatchServer) error } // UnimplementedObjectServiceServer should be embedded to have forward compatible implementations. @@ -775,6 +898,9 @@ 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 { + return status.Errorf(codes.Unimplemented, "method Patch not implemented") +} // 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 @@ -948,6 +1074,32 @@ func _ObjectService_PutSingle_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _ObjectService_Patch_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ObjectServiceServer).Patch(&objectServicePatchServer{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 +} + // ObjectService_ServiceDesc is the grpc.ServiceDesc for ObjectService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -993,6 +1145,11 @@ var ObjectService_ServiceDesc = grpc.ServiceDesc{ Handler: _ObjectService_GetRange_Handler, ServerStreams: true, }, + { + StreamName: "Patch", + Handler: _ObjectService_Patch_Handler, + ClientStreams: true, + }, }, Metadata: "object/grpc/service.proto", } diff --git a/object/marshal.go b/object/marshal.go index f96b098..a0b82df 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -132,6 +132,16 @@ const ( putSingleReqObjectField = 1 putSingleReqCopiesNumberField = 2 + + patchRequestBodyPatchRangeField = 1 + patchRequestBodyPatchChunkField = 2 + + patchRequestBodyAddrField = 1 + patchRequestBodyNewAttrsField = 2 + patchRequestBodyReplaceAttrField = 3 + patchRequestBodyPatchField = 4 + + patchResponseBodyObjectIDField = 1 ) func (h *ShortHeader) StableMarshal(buf []byte) []byte { @@ -1314,3 +1324,105 @@ func (r *PutSingleResponseBody) StableSize() int { func (r *PutSingleResponseBody) Unmarshal(data []byte) error { return message.Unmarshal(r, data, new(object.PutSingleResponse_Body)) } + +func (r *PatchRequestBodyPatch) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + offset += proto.NestedStructureMarshal(patchRequestBodyPatchRangeField, buf[offset:], r.Range) + offset += proto.BytesMarshal(patchRequestBodyPatchChunkField, buf[offset:], r.Chunk) + + return buf +} + +func (r *PatchRequestBodyPatch) StableSize() int { + if r == nil { + return 0 + } + + var size int + size += proto.NestedStructureSize(patchRequestBodyPatchRangeField, r.Range) + size += proto.BytesSize(patchRequestBodyPatchChunkField, r.Chunk) + + return size +} + +func (r *PatchRequestBodyPatch) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.PatchRequest_Body_Patch)) +} + +func (r *PatchRequestBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + offset += proto.NestedStructureMarshal(patchRequestBodyAddrField, buf[offset:], r.Address) + for i := range r.NewAttributes { + offset += proto.NestedStructureMarshal(patchRequestBodyNewAttrsField, buf[offset:], &r.NewAttributes[i]) + } + offset += proto.BoolMarshal(patchRequestBodyReplaceAttrField, buf[offset:], r.ReplaceAttributes) + offset += proto.NestedStructureMarshal(patchRequestBodyPatchField, buf[offset:], r.Patch) + + return buf +} + +func (r *PatchRequestBody) StableSize() int { + if r == nil { + return 0 + } + + var size int + size += proto.NestedStructureSize(patchRequestBodyAddrField, r.Address) + for i := range r.NewAttributes { + size += proto.NestedStructureSize(patchRequestBodyNewAttrsField, &r.NewAttributes[i]) + } + size += proto.BoolSize(patchRequestBodyReplaceAttrField, r.ReplaceAttributes) + size += proto.NestedStructureSize(patchRequestBodyPatchField, r.Patch) + + return size +} + +func (r *PatchRequestBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.PatchRequest_Body)) +} + +func (r *PatchResponseBody) StableSize() int { + if r == nil { + return 0 + } + + var size int + size += proto.NestedStructureSize(patchResponseBodyObjectIDField, r.ObjectID) + + return size +} + +func (r *PatchResponseBody) StableMarshal(buf []byte) []byte { + if r == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, r.StableSize()) + } + + var offset int + offset += proto.NestedStructureMarshal(patchResponseBodyObjectIDField, buf[offset:], r.ObjectID) + + return buf +} + +func (r *PatchResponseBody) Unmarshal(data []byte) error { + return message.Unmarshal(r, data, new(object.PatchResponse_Body)) +} diff --git a/object/message_test.go b/object/message_test.go index 749c373..d4e95b3 100644 --- a/object/message_test.go +++ b/object/message_test.go @@ -56,5 +56,10 @@ func TestMessageConvert(t *testing.T) { func(empty bool) message.Message { return objecttest.GenerateLock(empty) }, func(empty bool) message.Message { return objecttest.GeneratePutSingleRequest(empty) }, func(empty bool) message.Message { return objecttest.GeneratePutSingleResponse(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePatchRequestBodyPatch(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePatchRequestBody(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePatchRequest(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePatchResponseBody(empty) }, + func(empty bool) message.Message { return objecttest.GeneratePatchResponse(empty) }, ) } diff --git a/object/test/generate.go b/object/test/generate.go index b1931fc..f45941f 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -691,6 +691,63 @@ func GeneratePutSingleResponse(empty bool) *object.PutSingleResponse { return m } +func GeneratePatchRequestBodyPatch(empty bool) *object.PatchRequestBodyPatch { + m := new(object.PatchRequestBodyPatch) + + if !empty { + m.Range = GenerateRange(false) + m.Chunk = []byte("GeneratePatchRequestBodyPatch") + } + + return m +} + +func GeneratePatchRequestBody(empty bool) *object.PatchRequestBody { + m := new(object.PatchRequestBody) + + if !empty { + m.Address = refstest.GenerateAddress(empty) + m.NewAttributes = GenerateAttributes(empty) + m.ReplaceAttributes = false + m.Patch = GeneratePatchRequestBodyPatch(empty) + } + + return m +} + +func GeneratePatchRequest(empty bool) *object.PatchRequest { + m := new(object.PatchRequest) + + if !empty { + m.Body = GeneratePatchRequestBody(empty) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GeneratePatchResponseBody(empty bool) *object.PatchResponseBody { + m := new(object.PatchResponseBody) + + if !empty { + m.ObjectID = refstest.GenerateObjectID(empty) + } + + return m +} + +func GeneratePatchResponse(empty bool) *object.PatchResponse { + m := new(object.PatchResponse) + + if !empty { + m.Body = GeneratePatchResponseBody(empty) + } + + return m +} + func randomInt(n int) int { return rand.New(rand.NewSource(time.Now().UnixNano())).Intn(n) } diff --git a/object/types.go b/object/types.go index 43caf80..d0cac37 100644 --- a/object/types.go +++ b/object/types.go @@ -349,6 +349,38 @@ type PutSingleResponse struct { session.ResponseHeaders } +type PatchRequestBodyPatch struct { + Range *Range + + Chunk []byte +} + +type PatchRequestBody struct { + Address *refs.Address + + NewAttributes []Attribute + + ReplaceAttributes bool + + Patch *PatchRequestBodyPatch +} + +type PatchRequest struct { + Body *PatchRequestBody + + session.RequestHeaders +} + +type PatchResponseBody struct { + ObjectID *refs.ObjectID +} + +type PatchResponse struct { + Body *PatchResponseBody + + session.ResponseHeaders +} + const ( TypeRegular Type = iota TypeTombstone diff --git a/util/proto/test/test.pb.go b/util/proto/test/test.pb.go index 57f7fb0..199fe2f 100644 --- a/util/proto/test/test.pb.go +++ b/util/proto/test/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v5.27.2 +// protoc v4.25.3 // source: util/proto/test/test.proto package test From 8580b49c8d65a78126444ef49df1bbb18a849a42 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 24 Jul 2024 17:45:30 +0300 Subject: [PATCH 111/169] [#94] rpc: Introduce `ObjectService.Patch` method Signed-off-by: Airat Arifullin --- object/marshal.go | 6 +++--- rpc/object.go | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/object/marshal.go b/object/marshal.go index a0b82df..00bafc9 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -1336,7 +1336,7 @@ func (r *PatchRequestBodyPatch) StableMarshal(buf []byte) []byte { var offset int offset += proto.NestedStructureMarshal(patchRequestBodyPatchRangeField, buf[offset:], r.Range) - offset += proto.BytesMarshal(patchRequestBodyPatchChunkField, buf[offset:], r.Chunk) + proto.BytesMarshal(patchRequestBodyPatchChunkField, buf[offset:], r.Chunk) return buf } @@ -1372,7 +1372,7 @@ func (r *PatchRequestBody) StableMarshal(buf []byte) []byte { offset += proto.NestedStructureMarshal(patchRequestBodyNewAttrsField, buf[offset:], &r.NewAttributes[i]) } offset += proto.BoolMarshal(patchRequestBodyReplaceAttrField, buf[offset:], r.ReplaceAttributes) - offset += proto.NestedStructureMarshal(patchRequestBodyPatchField, buf[offset:], r.Patch) + proto.NestedStructureMarshal(patchRequestBodyPatchField, buf[offset:], r.Patch) return buf } @@ -1418,7 +1418,7 @@ func (r *PatchResponseBody) StableMarshal(buf []byte) []byte { } var offset int - offset += proto.NestedStructureMarshal(patchResponseBodyObjectIDField, buf[offset:], r.ObjectID) + proto.NestedStructureMarshal(patchResponseBodyObjectIDField, buf[offset:], r.ObjectID) return buf } diff --git a/rpc/object.go b/rpc/object.go index 1eca922..6d7af31 100644 --- a/rpc/object.go +++ b/rpc/object.go @@ -18,6 +18,7 @@ const ( rpcObjectHead = "Head" rpcObjectDelete = "Delete" rpcObjectPutSingle = "PutSingle" + rpcObjectPatch = "Patch" ) // PutRequestWriter is an object.PutRequest @@ -205,3 +206,38 @@ func PutSingleObject( return resp, nil } + +// PatchRequestWriter is an object.PatchRequest +// message streaming component. +type PatchRequestWriter struct { + wc client.MessageWriterCloser + + resp message.Message +} + +// Write writes req to the stream. +func (w *PatchRequestWriter) Write(req *object.PatchRequest) error { + return w.wc.WriteMessage(req) +} + +// Close closes the stream. +func (w *PatchRequestWriter) Close() error { + return w.wc.Close() +} + +// Patch executes ObjectService.Patch RPC. +func Patch( + cli *client.Client, + resp *object.PatchResponse, + opts ...client.CallOption, +) (*PatchRequestWriter, error) { + wc, err := client.OpenClientStream(cli, common.CallMethodInfoClientStream(serviceObject, rpcObjectPatch), resp, opts...) + if err != nil { + return nil, err + } + + return &PatchRequestWriter{ + wc: wc, + resp: resp, + }, nil +} From 8ce8cd6ec272d947a29c8d180d8d6feabfb934ad Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 29 Jul 2024 15:40:43 +0300 Subject: [PATCH 112/169] [#96] .golangci.yml: Fix deprecated config options ``` WARN [config_reader] The configuration option `run.skip-files` is deprecated, please use `issues.exclude-files`. WARN [config_reader] The configuration option `output.format` is deprecated, please use `output.formats` ``` Signed-off-by: Evgenii Stratonikov --- .golangci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index db94146..c6f4308 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,13 +9,11 @@ run: # include test files or not, default is true tests: false - skip-files: - - (^|.*/)grpc/(.*) - # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: tab + formats: + - format: tab # all available settings of specific linters linters-settings: @@ -67,6 +65,9 @@ linters: fast: false issues: + exclude-files: + - (^|.*/)grpc/(.*) + # Excluding configuration per-path, per-linter, per-text and per-source exclude-rules: - path: v2 # ignore stutters in universal structures due to protobuf compatibility From 8609f29a6019d2a09722b2bde69bcf30b772f426 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 30 Jul 2024 17:49:45 +0300 Subject: [PATCH 113/169] [#97] object: Refactor Patch related structs * Add getters and setters for related types; * Fix unit-tests. Signed-off-by: Airat Arifullin --- object/convert.go | 38 +++++++++---------- object/marshal.go | 20 +++++----- object/test/generate.go | 10 ++--- object/types.go | 82 ++++++++++++++++++++++++++++++++++++++--- 4 files changed, 111 insertions(+), 39 deletions(-) diff --git a/object/convert.go b/object/convert.go index 1abfb5e..5c9e20a 100644 --- a/object/convert.go +++ b/object/convert.go @@ -2392,10 +2392,10 @@ func (r *PatchRequestBody) ToGRPCMessage() grpc.Message { if r != nil { m = new(object.PatchRequest_Body) - m.SetAddress(r.Address.ToGRPCMessage().(*refsGRPC.Address)) - m.SetNewAttributes(AttributesToGRPC(r.NewAttributes)) - m.SetReplaceAttributes(r.ReplaceAttributes) - m.SetPatch(r.Patch.ToGRPCMessage().(*object.PatchRequest_Body_Patch)) + m.SetAddress(r.address.ToGRPCMessage().(*refsGRPC.Address)) + m.SetNewAttributes(AttributesToGRPC(r.newAttributes)) + m.SetReplaceAttributes(r.replaceAttributes) + m.SetPatch(r.patch.ToGRPCMessage().(*object.PatchRequest_Body_Patch)) } return m @@ -2411,34 +2411,34 @@ func (r *PatchRequestBody) FromGRPCMessage(m grpc.Message) error { addr := v.GetAddress() if addr == nil { - r.Address = nil + r.address = nil } else { - if r.Address == nil { - r.Address = new(refs.Address) + if r.address == nil { + r.address = new(refs.Address) } - err = r.Address.FromGRPCMessage(addr) + err = r.address.FromGRPCMessage(addr) if err != nil { return err } } - r.NewAttributes, err = AttributesFromGRPC(v.GetNewAttributes()) + r.newAttributes, err = AttributesFromGRPC(v.GetNewAttributes()) if err != nil { return err } - r.ReplaceAttributes = v.GetReplaceAttributes() + r.replaceAttributes = v.GetReplaceAttributes() patch := v.GetPatch() if patch == nil { - r.Patch = nil + r.patch = nil } else { - if r.Patch == nil { - r.Patch = new(PatchRequestBodyPatch) + if r.patch == nil { + r.patch = new(PatchRequestBodyPatch) } - err = r.Patch.FromGRPCMessage(patch) + err = r.patch.FromGRPCMessage(patch) if err != nil { return err } @@ -2453,7 +2453,7 @@ func (r *PatchRequest) ToGRPCMessage() grpc.Message { if r != nil { m = new(object.PatchRequest) - m.SetBody(r.Body.ToGRPCMessage().(*object.PatchRequest_Body)) + m.SetBody(r.body.ToGRPCMessage().(*object.PatchRequest_Body)) r.RequestHeaders.ToMessage(m) } @@ -2470,13 +2470,13 @@ func (r *PatchRequest) FromGRPCMessage(m grpc.Message) error { body := v.GetBody() if body == nil { - r.Body = nil + r.body = nil } else { - if r.Body == nil { - r.Body = new(PatchRequestBody) + if r.body == nil { + r.body = new(PatchRequestBody) } - err = r.Body.FromGRPCMessage(body) + err = r.body.FromGRPCMessage(body) if err != nil { return err } diff --git a/object/marshal.go b/object/marshal.go index 00bafc9..f337502 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -1367,12 +1367,12 @@ func (r *PatchRequestBody) StableMarshal(buf []byte) []byte { } var offset int - offset += proto.NestedStructureMarshal(patchRequestBodyAddrField, buf[offset:], r.Address) - for i := range r.NewAttributes { - offset += proto.NestedStructureMarshal(patchRequestBodyNewAttrsField, buf[offset:], &r.NewAttributes[i]) + offset += proto.NestedStructureMarshal(patchRequestBodyAddrField, buf[offset:], r.address) + for i := range r.newAttributes { + offset += proto.NestedStructureMarshal(patchRequestBodyNewAttrsField, buf[offset:], &r.newAttributes[i]) } - offset += proto.BoolMarshal(patchRequestBodyReplaceAttrField, buf[offset:], r.ReplaceAttributes) - proto.NestedStructureMarshal(patchRequestBodyPatchField, buf[offset:], r.Patch) + offset += proto.BoolMarshal(patchRequestBodyReplaceAttrField, buf[offset:], r.replaceAttributes) + proto.NestedStructureMarshal(patchRequestBodyPatchField, buf[offset:], r.patch) return buf } @@ -1383,12 +1383,12 @@ func (r *PatchRequestBody) StableSize() int { } var size int - size += proto.NestedStructureSize(patchRequestBodyAddrField, r.Address) - for i := range r.NewAttributes { - size += proto.NestedStructureSize(patchRequestBodyNewAttrsField, &r.NewAttributes[i]) + size += proto.NestedStructureSize(patchRequestBodyAddrField, r.address) + for i := range r.newAttributes { + size += proto.NestedStructureSize(patchRequestBodyNewAttrsField, &r.newAttributes[i]) } - size += proto.BoolSize(patchRequestBodyReplaceAttrField, r.ReplaceAttributes) - size += proto.NestedStructureSize(patchRequestBodyPatchField, r.Patch) + size += proto.BoolSize(patchRequestBodyReplaceAttrField, r.replaceAttributes) + size += proto.NestedStructureSize(patchRequestBodyPatchField, r.patch) return size } diff --git a/object/test/generate.go b/object/test/generate.go index f45941f..87ad64e 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -706,10 +706,10 @@ func GeneratePatchRequestBody(empty bool) *object.PatchRequestBody { m := new(object.PatchRequestBody) if !empty { - m.Address = refstest.GenerateAddress(empty) - m.NewAttributes = GenerateAttributes(empty) - m.ReplaceAttributes = false - m.Patch = GeneratePatchRequestBodyPatch(empty) + m.SetAddress(refstest.GenerateAddress(empty)) + m.SetNewAttributes(GenerateAttributes(empty)) + m.SetReplaceAttributes(false) + m.SetPatch(GeneratePatchRequestBodyPatch(empty)) } return m @@ -719,7 +719,7 @@ func GeneratePatchRequest(empty bool) *object.PatchRequest { m := new(object.PatchRequest) if !empty { - m.Body = GeneratePatchRequestBody(empty) + m.SetBody(GeneratePatchRequestBody(empty)) } m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) diff --git a/object/types.go b/object/types.go index d0cac37..c1a8b87 100644 --- a/object/types.go +++ b/object/types.go @@ -356,17 +356,17 @@ type PatchRequestBodyPatch struct { } type PatchRequestBody struct { - Address *refs.Address + address *refs.Address - NewAttributes []Attribute + newAttributes []Attribute - ReplaceAttributes bool + replaceAttributes bool - Patch *PatchRequestBodyPatch + patch *PatchRequestBodyPatch } type PatchRequest struct { - Body *PatchRequestBody + body *PatchRequestBody session.RequestHeaders } @@ -1543,6 +1543,78 @@ func (r *PutSingleResponse) SetBody(v *PutSingleResponseBody) { r.body = v } +func (r *PatchRequest) GetBody() *PatchRequestBody { + if r != nil { + return r.body + } + + return nil +} + +func (r *PatchRequest) SetBody(v *PatchRequestBody) { + r.body = v +} + +func (r *PatchRequestBody) GetAddress() *refs.Address { + if r != nil { + return r.address + } + + return nil +} + +func (r *PatchRequestBody) SetAddress(addr *refs.Address) { + r.address = addr +} + +func (r *PatchRequestBody) GetNewAttributes() []Attribute { + if r != nil { + return r.newAttributes + } + + return nil +} + +func (r *PatchRequestBody) SetNewAttributes(attrs []Attribute) { + r.newAttributes = attrs +} + +func (r *PatchRequestBody) GetReplaceAttributes() bool { + if r != nil { + return r.replaceAttributes + } + + return false +} + +func (r *PatchRequestBody) SetReplaceAttributes(replace bool) { + r.replaceAttributes = replace +} + +func (r *PatchRequestBody) GetPatch() *PatchRequestBodyPatch { + if r != nil { + return r.patch + } + + return nil +} + +func (r *PatchRequestBody) SetPatch(patch *PatchRequestBodyPatch) { + r.patch = patch +} + +func (r *PatchResponse) GetBody() *PatchResponseBody { + if r != nil { + return r.Body + } + + return nil +} + +func (r *PatchResponse) SetBody(v *PatchResponseBody) { + r.Body = v +} + func (s *ECInfo) getObjectPart() {} func (s *ECInfo) getHeaderPart() {} From c27b978770a334a964ce682888b7d08dd2a4a627 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 30 Jul 2024 17:50:26 +0300 Subject: [PATCH 114/169] [#97] signature: Add Patch messages to `serviceMessageBody` Signed-off-by: Airat Arifullin --- signature/body.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/signature/body.go b/signature/body.go index 53b5d6b..4b43b84 100644 --- a/signature/body.go +++ b/signature/body.go @@ -84,6 +84,10 @@ func serviceMessageBody(req any) stableMarshaler { return v.GetBody() case *object.PutSingleResponse: return v.GetBody() + case *object.PatchRequest: + return v.GetBody() + case *object.PatchResponse: + return v.GetBody() /* Netmap */ case *netmap.LocalNodeInfoRequest: From 1473fa588f8a0bab0806c2fae380ee2512174652 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 31 Jul 2024 15:34:44 +0300 Subject: [PATCH 115/169] [#98] rpc: Accept interface in place of ClientConn gRPC client load-balancing API is ugly as f: 1. It is configured by pre-registering a balancer and the providing JSON configuration. 2. It doesn't allow different credentials for different endpoints (consider using "insecure" localhost and external endpoint). 3. To support frostfs usecase we also need to implement a resolver, which has its own difficulties. 4. https://github.com/grpc/grpc-go/issues/239#issuecomment-264548415 Using interface in place of grpc.ClientConn allows us to provide custom implentation for it (load-balancing, circuit breaker etc.). Refs TrueCloudLab/frostfs-node#1268 Signed-off-by: Evgenii Stratonikov --- rpc/client/conn.go | 8 ++++++++ rpc/client/options.go | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rpc/client/conn.go b/rpc/client/conn.go index 9fc7a51..f208413 100644 --- a/rpc/client/conn.go +++ b/rpc/client/conn.go @@ -2,8 +2,16 @@ package client import ( "io" + + "google.golang.org/grpc" ) +// Conn is an interface for grpc client connection. +type Conn interface { + grpc.ClientConnInterface + io.Closer +} + // Conn returns underlying connection. // // Returns non-nil result after the first Init() call diff --git a/rpc/client/options.go b/rpc/client/options.go index 0575dfc..22358a3 100644 --- a/rpc/client/options.go +++ b/rpc/client/options.go @@ -25,7 +25,7 @@ type cfg struct { tlsCfg *tls.Config grpcDialOpts []grpc.DialOption - conn *grpc.ClientConn + conn Conn } const ( @@ -114,7 +114,7 @@ func WithTLSCfg(v *tls.Config) Option { // WithGRPCConn returns option to specify // gRPC virtual connection. -func WithGRPCConn(v *grpc.ClientConn) Option { +func WithGRPCConn(v Conn) Option { return func(c *cfg) { if v != nil { c.conn = v From ebaf78c8faab21031b50ba546d25052b84d7d482 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 5 Aug 2024 20:52:47 +0300 Subject: [PATCH 116/169] [#100] session: Introduce `ObjectPatch` verb Signed-off-by: Airat Arifullin --- session/convert.go | 4 + session/grpc/types.pb.go | 289 ++++++++++++++++++++------------------- session/types.go | 1 + 3 files changed, 152 insertions(+), 142 deletions(-) diff --git a/session/convert.go b/session/convert.go index bbfe070..4197935 100644 --- a/session/convert.go +++ b/session/convert.go @@ -641,6 +641,8 @@ func ObjectSessionVerbToGRPCField(v ObjectSessionVerb) session.ObjectSessionCont return session.ObjectSessionContext_RANGE case ObjectVerbRangeHash: return session.ObjectSessionContext_RANGEHASH + case ObjectVerbPatch: + return session.ObjectSessionContext_PATCH default: return session.ObjectSessionContext_VERB_UNSPECIFIED } @@ -662,6 +664,8 @@ func ObjectSessionVerbFromGRPCField(v session.ObjectSessionContext_Verb) ObjectS return ObjectVerbRange case session.ObjectSessionContext_RANGEHASH: return ObjectVerbRangeHash + case session.ObjectSessionContext_PATCH: + return ObjectVerbPatch default: return ObjectVerbUnknown } diff --git a/session/grpc/types.pb.go b/session/grpc/types.pb.go index 924df45..9f51743 100644 --- a/session/grpc/types.pb.go +++ b/session/grpc/types.pb.go @@ -43,6 +43,8 @@ const ( ObjectSessionContext_RANGE ObjectSessionContext_Verb = 6 // Refers to object.GetRangeHash RPC call ObjectSessionContext_RANGEHASH ObjectSessionContext_Verb = 7 + // Refers to object.Patch RPC call + ObjectSessionContext_PATCH ObjectSessionContext_Verb = 8 ) // Enum value maps for ObjectSessionContext_Verb. @@ -56,6 +58,7 @@ var ( 5: "DELETE", 6: "RANGE", 7: "RANGEHASH", + 8: "PATCH", } ObjectSessionContext_Verb_value = map[string]int32{ "VERB_UNSPECIFIED": 0, @@ -66,6 +69,7 @@ var ( "DELETE": 5, "RANGE": 6, "RANGEHASH": 7, + "PATCH": 8, } ) @@ -1040,7 +1044,7 @@ var file_session_grpc_types_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x03, 0x0a, 0x14, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, + 0x6f, 0x74, 0x6f, 0x22, 0x90, 0x03, 0x0a, 0x14, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x76, 0x65, 0x72, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, @@ -1058,154 +1062,155 @@ var file_session_grpc_types_proto_rawDesc = []byte{ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, - 0x6a, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x45, 0x52, 0x42, 0x5f, + 0x75, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x45, 0x52, 0x42, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x45, 0x41, 0x44, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x05, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, - 0x52, 0x41, 0x4e, 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, 0x10, 0x07, 0x22, 0xfa, 0x01, 0x0a, 0x17, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x76, 0x65, 0x72, 0x62, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x2e, 0x56, 0x65, 0x72, 0x62, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12, 0x1a, 0x0a, 0x08, - 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x77, 0x69, 0x6c, 0x64, 0x63, 0x61, 0x72, 0x64, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x22, 0x3e, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, - 0x12, 0x14, 0x0a, 0x10, 0x56, 0x45, 0x52, 0x42, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, - 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, - 0x45, 0x54, 0x45, 0x41, 0x43, 0x4c, 0x10, 0x03, 0x22, 0xa0, 0x04, 0x0a, 0x0c, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x18, 0x01, 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, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x9c, 0x03, 0x0a, - 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x02, 0x69, 0x64, 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, 0x4e, 0x0a, 0x08, 0x6c, 0x69, 0x66, - 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, - 0x79, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x52, - 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x41, 0x0a, 0x06, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x4a, 0x0a, - 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, + 0x52, 0x41, 0x4e, 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, 0x10, 0x07, 0x12, 0x09, 0x0a, 0x05, 0x50, + 0x41, 0x54, 0x43, 0x48, 0x10, 0x08, 0x22, 0xfa, 0x01, 0x0a, 0x17, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x76, 0x65, 0x72, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x09, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x1a, 0x45, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, - 0x6e, 0x62, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6e, 0x62, 0x66, 0x12, 0x10, - 0x0a, 0x03, 0x69, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x69, 0x61, 0x74, - 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x31, 0x0a, 0x07, 0x58, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x22, 0x8d, - 0x03, 0x0a, 0x11, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, - 0x61, 0x64, 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, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, 0x0a, - 0x03, 0x74, 0x74, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, - 0x37, 0x0a, 0x09, 0x78, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x08, - 0x78, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3d, - 0x0a, 0x0c, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x52, 0x0b, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3c, 0x0a, - 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x07, 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, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6d, - 0x61, 0x67, 0x69, 0x63, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x99, - 0x02, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, - 0x65, 0x61, 0x64, 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, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, - 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, - 0x12, 0x37, 0x0a, 0x09, 0x78, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, - 0x08, 0x78, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x06, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x18, 0x05, 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, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xab, 0x02, 0x0a, 0x19, 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, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, - 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, - 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, - 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, - 0x74, 0x61, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, - 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, - 0x65, 0x74, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 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, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xad, 0x02, 0x0a, 0x1a, 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, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, 0x5f, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, 0x74, - 0x61, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x56, 0x65, 0x72, + 0x62, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x69, 0x6c, 0x64, 0x63, + 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x6c, 0x64, 0x63, + 0x61, 0x72, 0x64, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, + 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x49, 0x44, 0x22, 0x3e, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x14, 0x0a, 0x10, 0x56, + 0x45, 0x52, 0x42, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, + 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x54, 0x45, 0x41, 0x43, + 0x4c, 0x10, 0x03, 0x22, 0xa0, 0x04, 0x0a, 0x0c, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 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, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x37, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, - 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, 0x65, - 0x74, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x45, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 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, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x42, 0x64, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x2e, - 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, - 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0xaa, 0x02, 0x1b, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x9c, 0x03, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, + 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, 0x4e, 0x0a, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, + 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, + 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x41, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, + 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, + 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x4a, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x1a, 0x45, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, + 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x62, 0x66, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6e, 0x62, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x61, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x69, 0x61, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x31, 0x0a, 0x07, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 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, 0x22, 0x8d, 0x03, 0x0a, 0x11, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 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, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x37, 0x0a, 0x09, 0x78, 0x5f, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x08, 0x78, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x62, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0b, 0x62, 0x65, 0x61, + 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3c, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x18, 0x07, 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, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, + 0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x99, 0x02, 0x0a, 0x12, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 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, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x37, 0x0a, 0x09, 0x78, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x08, 0x78, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x05, + 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, 0x06, 0x6f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xab, 0x02, 0x0a, 0x19, 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, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, + 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, + 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, 0x6f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, + 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 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, 0x06, 0x6f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x22, 0xad, 0x02, 0x0a, 0x1a, 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, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, + 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, + 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, + 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, 0x6f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x45, 0x0a, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 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, 0x06, 0x6f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x42, 0x64, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, + 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, + 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, 0x4e, 0x65, + 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, + 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/session/types.go b/session/types.go index 5732b29..d2df9c5 100644 --- a/session/types.go +++ b/session/types.go @@ -175,6 +175,7 @@ const ( ObjectVerbDelete ObjectVerbRange ObjectVerbRangeHash + ObjectVerbPatch ) func (c *CreateRequestBody) GetOwnerID() *refs.OwnerID { From 611355510cfafeba0d604be2022b75b74cc9661e Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 24 Jun 2024 11:22:49 +0300 Subject: [PATCH 117/169] [#87] go.mod: Update `google.golang.org/grpc` to `v1.63.2` Signed-off-by: Anton Nikiforov --- go.mod | 13 ++++++------- go.sum | 33 +++++++++++++-------------------- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 0315850..e00f012 100644 --- a/go.mod +++ b/go.mod @@ -5,22 +5,21 @@ go 1.20 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 github.com/stretchr/testify v1.8.3 - golang.org/x/sync v0.2.0 - google.golang.org/grpc v1.55.0 + golang.org/x/sync v0.6.0 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) require ( git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.3 // indirect github.com/kr/pretty v0.1.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 56fc5d0..6ce46f7 100644 --- a/go.sum +++ b/go.sum @@ -5,11 +5,7 @@ git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -23,21 +19,18 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 42e50c963327afecad227f90a1fff787340121af Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 24 Jun 2024 12:58:37 +0300 Subject: [PATCH 118/169] [#87] Makefile: Add target `protoc-install` Signed-off-by: Anton Nikiforov --- Makefile | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 239565b..7789692 100755 --- a/Makefile +++ b/Makefile @@ -2,6 +2,17 @@ SHELL = bash VERSION ?= $(shell git describe --tags --match "v*" --abbrev=8 --dirty --always) +PROTOC_VERSION ?= 27.2 +PROTOC_GEN_GO_VERSION ?= $(shell go list -f '{{.Version}}' -m google.golang.org/protobuf) +PROTOC_OS_VERSION=osx-x86_64 +ifeq ($(shell uname), Linux) + PROTOC_OS_VERSION=linux-x86_64 +endif + +BIN = bin +PROTOBUF_DIR ?= $(abspath $(BIN))/protobuf +PROTOC_DIR ?= $(PROTOBUF_DIR)/protoc-v$(PROTOC_VERSION) +PROTOC_GEN_GO_DIR ?= $(PROTOBUF_DIR)/protoc-gen-go-$(PROTOC_GEN_GO_VERSION) .PHONY: dep fmts fumpt imports protoc test lint version help @@ -32,16 +43,29 @@ fumpt: @echo "⇒ Processing gofumpt check" @gofumpt -l -w . +# Install protoc +protoc-install: + @rm -rf $(PROTOBUF_DIR) + @mkdir -p $(PROTOBUF_DIR) + @echo "⇒ Installing protoc... " + @wget -q -O $(PROTOBUF_DIR)/protoc-$(PROTOC_VERSION).zip 'https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-$(PROTOC_OS_VERSION).zip' + @unzip -q -o $(PROTOBUF_DIR)/protoc-$(PROTOC_VERSION).zip -d $(PROTOC_DIR) + @rm $(PROTOBUF_DIR)/protoc-$(PROTOC_VERSION).zip + @echo "⇒ Installing protoc-gen-go..." + @GOBIN=$(PROTOC_GEN_GO_DIR) go install -v google.golang.org/protobuf/...@$(PROTOC_GEN_GO_VERSION) + + # Regenerate code for proto files protoc: - @GOPRIVATE=github.com/TrueCloudLab go mod vendor - # Install specific version for protobuf lib - @go list -f '{{.Path}}/...@{{.Version}}' -m google.golang.org/protobuf | xargs go install -v + @if [ ! -d "$(PROTOC_DIR)" ] || [ ! -d "$(PROTOC_GEN_GO_DIR)" ]; then \ + make protoc-install; \ + fi # Protoc generate - @for f in `find . -type f -name '*.proto' -not -path './vendor/*'`; do \ + @for f in `find . -type f -name '*.proto'`; do \ echo "⇒ Processing $$f "; \ - protoc \ + $(PROTOC_DIR)/bin/protoc \ --proto_path=.:./vendor:/usr/local/include \ + --plugin=protoc-gen-go=$(PROTOC_GEN_GO_DIR)/protoc-gen-go \ --go_out=. --go_opt=paths=source_relative \ --go-grpc_opt=require_unimplemented_servers=false \ --go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \ From b72aa14bab97f3fd6c12705391b70d0ea03e84b6 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 24 Jun 2024 13:50:21 +0300 Subject: [PATCH 119/169] [#87] proto: Process files with `protoc` version `27.2` Signed-off-by: Anton Nikiforov --- util/proto/test/test.pb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/proto/test/test.pb.go b/util/proto/test/test.pb.go index 199fe2f..57f7fb0 100644 --- a/util/proto/test/test.pb.go +++ b/util/proto/test/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.25.3 +// protoc v5.27.2 // source: util/proto/test/test.proto package test From 174773454ec41756199666be94b6886bc075cbad Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 24 Jun 2024 13:53:27 +0300 Subject: [PATCH 120/169] [#87] netmap: Regenerate to add `LIKE` operation for `filter` Signed-off-by: Anton Nikiforov --- netmap/grpc/types.pb.go | 49 +++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go index 8924213..ae1f55f 100644 --- a/netmap/grpc/types.pb.go +++ b/netmap/grpc/types.pb.go @@ -44,21 +44,24 @@ const ( Operation_AND Operation = 8 // Logical negation Operation_NOT Operation = 9 + // Matches pattern + Operation_LIKE Operation = 10 ) // Enum value maps for Operation. var ( Operation_name = map[int32]string{ - 0: "OPERATION_UNSPECIFIED", - 1: "EQ", - 2: "NE", - 3: "GT", - 4: "GE", - 5: "LT", - 6: "LE", - 7: "OR", - 8: "AND", - 9: "NOT", + 0: "OPERATION_UNSPECIFIED", + 1: "EQ", + 2: "NE", + 3: "GT", + 4: "GE", + 5: "LT", + 6: "LE", + 7: "OR", + 8: "AND", + 9: "NOT", + 10: "LIKE", } Operation_value = map[string]int32{ "OPERATION_UNSPECIFIED": 0, @@ -71,6 +74,7 @@ var ( "OR": 7, "AND": 8, "NOT": 9, + "LIKE": 10, } ) @@ -1149,24 +1153,25 @@ var file_netmap_grpc_types_proto_rawDesc = []byte{ 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x70, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x7a, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x54, 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, 0x04, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10, 0x05, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x52, 0x10, 0x07, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x08, 0x12, - 0x07, 0x0a, 0x03, 0x4e, 0x4f, 0x54, 0x10, 0x09, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c, 0x61, 0x75, - 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, - 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, 0x43, 0x54, - 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, - 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, - 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x07, 0x0a, 0x03, 0x4e, 0x4f, 0x54, 0x10, 0x09, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x4b, 0x45, + 0x10, 0x0a, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, + 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, + 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, 0x43, 0x54, 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, + 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, + 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, + 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, + 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, + 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 35e7397d48d77423a7c53662b3446a3fd1a2e348 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 24 Jun 2024 13:55:23 +0300 Subject: [PATCH 121/169] [#87] netmap: Extend enum `Operation` Signed-off-by: Anton Nikiforov --- netmap/types.go | 1 + 1 file changed, 1 insertion(+) diff --git a/netmap/types.go b/netmap/types.go index dd5db68..1fcdc6e 100644 --- a/netmap/types.go +++ b/netmap/types.go @@ -111,6 +111,7 @@ const ( OR AND NOT + LIKE ) const ( From 280d052cefa0bb00134fff80fb1c6aed31e7e934 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Thu, 8 Aug 2024 17:31:58 +0300 Subject: [PATCH 122/169] [#101] Remove usage of folder `vendor` Signed-off-by: Anton Nikiforov --- .gitignore | 1 - Makefile | 5 ++--- prepare.sh | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 354a562..30476bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ .idea bin temp -/vendor/ diff --git a/Makefile b/Makefile index 7789692..30d599d 100755 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ fmts: fumpt imports # Reformat imports imports: @echo "⇒ Processing goimports check" - @for f in `find . -type f -name '*.go' -not -path './vendor/*' -not -name '*.pb.go' -prune`; do \ + @for f in `find . -type f -name '*.go' -not -name '*.pb.go' -prune`; do \ goimports -w $$f; \ done @@ -64,13 +64,12 @@ protoc: @for f in `find . -type f -name '*.proto'`; do \ echo "⇒ Processing $$f "; \ $(PROTOC_DIR)/bin/protoc \ - --proto_path=.:./vendor:/usr/local/include \ + --proto_path=.:/usr/local/include \ --plugin=protoc-gen-go=$(PROTOC_GEN_GO_DIR)/protoc-gen-go \ --go_out=. --go_opt=paths=source_relative \ --go-grpc_opt=require_unimplemented_servers=false \ --go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \ done - rm -rf vendor # Run Unit Test with go test test: GOFLAGS ?= "-count=1" diff --git a/prepare.sh b/prepare.sh index 32048b3..4b8b125 100755 --- a/prepare.sh +++ b/prepare.sh @@ -10,7 +10,7 @@ API_PATH=$1 # MOVE FILES FROM API REPO cd "$API_PATH" || exit 1 -ARGS=$(find ./ -name '*.proto' -not -path './vendor/*') +ARGS=$(find ./ -name '*.proto') for file in $ARGS; do dir=$(dirname "$file") mkdir -p "$API_GO_PATH/$dir/grpc" @@ -30,7 +30,7 @@ cd "$API_GO_PATH" || exit 1 make protoc # REMOVE PROTO DEFINITIONS -ARGS=$(find ./$prefix -name '*.proto' -not -path './vendor/*' -not -path './util/*') +ARGS=$(find ./$prefix -name '*.proto' -not -path './util/*') for file in $ARGS; do rm "$file" done From a0a9b765f3a56423b1c6f1fef1d1b413da0e03ef Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Thu, 8 Aug 2024 18:02:30 +0300 Subject: [PATCH 123/169] [#101] Fix `make test` Signed-off-by: Anton Nikiforov --- Makefile | 4 ++-- prepare.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 30d599d..db1cc2d 100755 --- a/Makefile +++ b/Makefile @@ -61,10 +61,10 @@ protoc: make protoc-install; \ fi # Protoc generate - @for f in `find . -type f -name '*.proto'`; do \ + @for f in `find . -type f -name '*.proto' -not -path './bin/*'`; do \ echo "⇒ Processing $$f "; \ $(PROTOC_DIR)/bin/protoc \ - --proto_path=.:/usr/local/include \ + --proto_path=.:$(PROTOC_DIR)/include:/usr/local/include \ --plugin=protoc-gen-go=$(PROTOC_GEN_GO_DIR)/protoc-gen-go \ --go_out=. --go_opt=paths=source_relative \ --go-grpc_opt=require_unimplemented_servers=false \ diff --git a/prepare.sh b/prepare.sh index 4b8b125..1d00954 100755 --- a/prepare.sh +++ b/prepare.sh @@ -10,7 +10,7 @@ API_PATH=$1 # MOVE FILES FROM API REPO cd "$API_PATH" || exit 1 -ARGS=$(find ./ -name '*.proto') +ARGS=$(find ./ -name '*.proto' -not -path './bin/*') for file in $ARGS; do dir=$(dirname "$file") mkdir -p "$API_GO_PATH/$dir/grpc" @@ -19,7 +19,7 @@ done # MODIFY FILES cd "$API_GO_PATH" || exit 1 -ARGS2=$(find ./ -name '*.proto') +ARGS2=$(find ./ -name '*.proto' -not -path './bin/*') for file in $ARGS2; do echo "$file" sed -i "s/import\ \"\(.*\)\/\(.*\)\.proto\";/import\ \"\1\/grpc\/\2\.proto\";/" $file @@ -30,7 +30,7 @@ cd "$API_GO_PATH" || exit 1 make protoc # REMOVE PROTO DEFINITIONS -ARGS=$(find ./$prefix -name '*.proto' -not -path './util/*') +ARGS=$(find ./$prefix -name '*.proto' -not -path './util/*' -not -path './bin/*') for file in $ARGS; do rm "$file" done From ff4f31b6f3a977df26b0328afc7604215f1dc86a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 9 Aug 2024 10:19:37 +0300 Subject: [PATCH 124/169] [#103] protogen: Handle files in all packages Signed-off-by: Evgenii Stratonikov --- util/protogen/main.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/util/protogen/main.go b/util/protogen/main.go index 85c6ded..1a287ba 100644 --- a/util/protogen/main.go +++ b/util/protogen/main.go @@ -16,11 +16,7 @@ var ( func main() { protogen.Options{}.Run(func(gen *protogen.Plugin) error { for _, f := range gen.Files { - //if !f.Generate { - // continue - //} - imp := string(f.GoImportPath) - if strings.HasSuffix(imp, "/tree") || strings.HasSuffix(imp, "/control") { + if f.Generate { generateFile(gen, f) } } From 19247e8941d9f80122746a01a065729a68ec58e7 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 9 Aug 2024 10:22:13 +0300 Subject: [PATCH 125/169] [#103] protogen: Handle uint32 type Signed-off-by: Evgenii Stratonikov --- util/protogen/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/protogen/main.go b/util/protogen/main.go index 1a287ba..0f2a7ca 100644 --- a/util/protogen/main.go +++ b/util/protogen/main.go @@ -229,7 +229,8 @@ type marshalerDesc struct { var marshalers = map[protoreflect.Kind]marshalerDesc{ protoreflect.BoolKind: {Prefix: "Bool"}, protoreflect.EnumKind: {Prefix: "Enum"}, - // protoreflect.Int32Kind: "", + + protoreflect.Int32Kind: {Prefix: "Int32", RepeatedDouble: true}, // protoreflect.Sint32Kind: "", protoreflect.Uint32Kind: {Prefix: "UInt32", RepeatedDouble: true}, protoreflect.Int64Kind: {Prefix: "Int64", RepeatedDouble: true}, From 47a48969b0676fa35a6d04b0fdd921dbdeccfbc5 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 9 Aug 2024 10:44:14 +0300 Subject: [PATCH 126/169] [#103] proto: Test end-to-end scenario Test the generated code, do not write yet another marshaling routine in tests. Before: ``` ok git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto 0.003s coverage: 55.6% of statements ``` After: ``` ok git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto 0.003s coverage: 80.0% of statements ``` Signed-off-by: Evgenii Stratonikov --- Makefile | 11 + util/proto/marshal_test.go | 925 ++++------------------------- util/proto/test/test_frostfs.pb.go | 117 ++++ 3 files changed, 255 insertions(+), 798 deletions(-) create mode 100644 util/proto/test/test_frostfs.pb.go diff --git a/Makefile b/Makefile index db1cc2d..19b3138 100755 --- a/Makefile +++ b/Makefile @@ -71,6 +71,17 @@ protoc: --go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \ done +protogen: + @go build -v -trimpath \ + -o $(BIN)/protogen \ + ./util/protogen + +protoc-test: protoc protogen + @$(PROTOC_DIR)/bin/protoc \ + --plugin=protoc-gen-go-frostfs=$(abspath $(BIN)/protogen) \ + --go-frostfs_out=. --go-frostfs_opt=paths=source_relative \ + ./util/proto/test/test.proto + # Run Unit Test with go test test: GOFLAGS ?= "-count=1" test: diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index c2a0f8e..56d9594 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -1,826 +1,155 @@ package proto_test import ( - "encoding/binary" "math" + "math/rand" "testing" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test" "github.com/stretchr/testify/require" - "google.golang.org/protobuf/encoding/protowire" goproto "google.golang.org/protobuf/proto" ) -type SomeEnum int32 - -type stablePrimitives struct { - FieldA []byte - FieldB string - FieldC bool - FieldD int32 - FieldE uint32 - FieldF int64 - FieldG uint64 - FieldH SomeEnum - FieldI uint64 // fixed64 - FieldJ float64 - FieldK uint32 // fixed32 +type protoInt interface { + ~int32 | ~uint32 | ~int64 | ~uint64 } -type stableRepPrimitives struct { - FieldA [][]byte - FieldB []string - FieldC []int32 - FieldD []uint32 - FieldE []int64 - FieldF []uint64 - - FieldFu []uint64 +func nonZero[T protoInt]() T { + var r T + for r == 0 { + r = T(rand.Uint64()) + } + return r } -const ( - ENUM_UNKNOWN SomeEnum = 0 - ENUM_POSITIVE SomeEnum = 1 - ENUM_NEGATIVE SomeEnum = -1 -) - -func (s *stablePrimitives) stableMarshal(buf []byte, wrongField bool) ([]byte, error) { - if s == nil { - return []byte{}, nil - } - - if buf == nil { - buf = make([]byte, s.stableSize()) - } - - var i, offset, fieldNum int - - fieldNum = 1 - if wrongField { - fieldNum++ - } - i += proto.BytesMarshal(fieldNum, buf, s.FieldA) - - fieldNum = 2 - if wrongField { - fieldNum++ - } - i += proto.StringMarshal(fieldNum, buf, s.FieldB) - - fieldNum = 200 - if wrongField { - fieldNum++ - } - i += proto.BoolMarshal(fieldNum, buf, s.FieldC) - - fieldNum = 201 - if wrongField { - fieldNum++ - } - i += proto.Int32Marshal(fieldNum, buf, s.FieldD) - - fieldNum = 202 - if wrongField { - fieldNum++ - } - i += proto.UInt32Marshal(fieldNum, buf, s.FieldE) - - fieldNum = 203 - if wrongField { - fieldNum++ - } - i += proto.Int64Marshal(fieldNum, buf, s.FieldF) - - fieldNum = 204 - if wrongField { - fieldNum++ - } - i += proto.UInt64Marshal(fieldNum, buf, s.FieldG) - - fieldNum = 205 - if wrongField { - fieldNum++ - } - i += proto.Fixed64Marshal(fieldNum, buf, s.FieldI) - - fieldNum = 206 - if wrongField { - fieldNum++ - } - i += proto.Float64Marshal(fieldNum, buf, s.FieldJ) - - fieldNum = 207 - if wrongField { - fieldNum++ - } - - offset = proto.Fixed32Marshal(fieldNum, buf, s.FieldK) - - i += offset - - fieldNum = 300 - if wrongField { - fieldNum++ - } - i += proto.EnumMarshal(fieldNum, buf, int32(s.FieldH)) - - return buf, nil -} - -func (s *stablePrimitives) stableSize() int { - return proto.BytesSize(1, s.FieldA) + - proto.StringSize(2, s.FieldB) + - proto.BoolSize(200, s.FieldC) + - proto.Int32Size(201, s.FieldD) + - proto.UInt32Size(202, s.FieldE) + - proto.Int64Size(203, s.FieldF) + - proto.UInt64Size(204, s.FieldG) + - proto.Fixed64Size(205, s.FieldI) + - proto.Float64Size(206, s.FieldJ) + - proto.Fixed32Size(207, s.FieldK) + - proto.EnumSize(300, int32(s.FieldH)) -} - -func (s *stableRepPrimitives) stableMarshal(buf []byte, wrongField bool) ([]byte, error) { - if s == nil { - return []byte{}, nil - } - - if buf == nil { - buf = make([]byte, s.stableSize()) - } - - var i, fieldNum int - - fieldNum = 1 - if wrongField { - fieldNum++ - } - i += proto.RepeatedBytesMarshal(fieldNum, buf, s.FieldA) - - fieldNum = 2 - if wrongField { - fieldNum++ - } - i += proto.RepeatedStringMarshal(fieldNum, buf, s.FieldB) - - fieldNum = 3 - if wrongField { - fieldNum++ - } - i += proto.RepeatedInt32Marshal(fieldNum, buf, s.FieldC) - - fieldNum = 4 - if wrongField { - fieldNum++ - } - i += proto.RepeatedUInt32Marshal(fieldNum, buf, s.FieldD) - - fieldNum = 5 - if wrongField { - fieldNum++ - } - i += proto.RepeatedInt64Marshal(fieldNum, buf, s.FieldE) - - fieldNum = 6 - if wrongField { - fieldNum++ - } - i += proto.RepeatedUInt64Marshal(fieldNum, buf, s.FieldF) - - fieldNum = 7 - if wrongField { - fieldNum++ - } - for j := range s.FieldFu { - { - prefix := protowire.EncodeTag( - protowire.Number(fieldNum), - protowire.VarintType) - i += binary.PutUvarint(buf[i:], uint64(prefix)) - i += binary.PutUvarint(buf[i:], s.FieldFu[j]) - } - } - - return buf, nil -} - -func (s *stableRepPrimitives) stableSize() int { - f1 := proto.RepeatedBytesSize(1, s.FieldA) - f2 := proto.RepeatedStringSize(2, s.FieldB) - f3, _ := proto.RepeatedInt32Size(3, s.FieldC) - f4, _ := proto.RepeatedUInt32Size(4, s.FieldD) - f5, _ := proto.RepeatedInt64Size(5, s.FieldE) - f6, _ := proto.RepeatedUInt64Size(6, s.FieldF) - - var f7 int - for i := range s.FieldFu { - f7 += protowire.SizeGroup(protowire.Number(7), protowire.SizeVarint(s.FieldFu[i])) - } - - return f1 + f2 + f3 + f4 + f5 + f6 + f7 -} - -func TestBytesMarshal(t *testing.T) { - t.Run("not empty", func(t *testing.T) { - data := []byte("Hello World") - testBytesMarshal(t, data, false) - testBytesMarshal(t, data, true) - }) - +func TestStableMarshalSingle(t *testing.T) { t.Run("empty", func(t *testing.T) { - testBytesMarshal(t, []byte{}, false) + input := &test.Primitives{} + require.Zero(t, input.StableSize()) + + r := input.StableMarshal(nil) + require.Empty(t, r) }) - t.Run("nil", func(t *testing.T) { - testBytesMarshal(t, nil, false) - }) + marshalCases := []struct { + name string + input *test.Primitives + }{ + {name: "bytes", input: &test.Primitives{FieldA: []byte{1, 2, 3}}}, + {name: "string", input: &test.Primitives{FieldB: "123"}}, + {name: "bool", input: &test.Primitives{FieldC: true}}, + {name: "int32", input: &test.Primitives{FieldD: nonZero[int32]()}}, + {name: "uint32", input: &test.Primitives{FieldE: nonZero[uint32]()}}, + {name: "int64", input: &test.Primitives{FieldF: nonZero[int64]()}}, + {name: "uint64", input: &test.Primitives{FieldG: nonZero[uint64]()}}, + {name: "uint64", input: &test.Primitives{FieldI: nonZero[uint64]()}}, + {name: "float64", input: &test.Primitives{FieldJ: math.Float64frombits(12345677890)}}, + {name: "fixed32", input: &test.Primitives{FieldK: nonZero[uint32]()}}, + {name: "enum, positive", input: &test.Primitives{FieldH: test.Primitives_POSITIVE}}, + {name: "enum, negative", input: &test.Primitives{FieldH: test.Primitives_NEGATIVE}}, + } + for _, tc := range marshalCases { + t.Run(tc.name, func(t *testing.T) { + r := tc.input.StableMarshal(nil) + require.Equal(t, len(r), tc.input.StableSize()) + require.NotEmpty(t, r) + + var actual test.Primitives + require.NoError(t, goproto.Unmarshal(r, &actual)) + + // Compare each field directly, because proto-generated code has private fields. + require.Equal(t, tc.input.FieldA, actual.FieldA) + require.Equal(t, tc.input.FieldB, actual.FieldB) + require.Equal(t, tc.input.FieldC, actual.FieldC) + require.Equal(t, tc.input.FieldD, actual.FieldD) + require.Equal(t, tc.input.FieldE, actual.FieldE) + require.Equal(t, tc.input.FieldF, actual.FieldF) + require.Equal(t, tc.input.FieldG, actual.FieldG) + require.Equal(t, tc.input.FieldI, actual.FieldI) + require.Equal(t, tc.input.FieldJ, actual.FieldJ) + require.Equal(t, tc.input.FieldK, actual.FieldK) + require.Equal(t, tc.input.FieldH, actual.FieldH) + }) + } } -func TestStringMarshal(t *testing.T) { - t.Run("not empty", func(t *testing.T) { - data := "Hello World" - testStringMarshal(t, data, false) - testStringMarshal(t, data, true) - }) +func randIntSlice[T protoInt](n int, includeZero bool) []T { + r := make([]T, n) + if n == 0 { + return r + } + for i := range r { + r[i] = T(rand.Uint64()) + } + if includeZero { + r[0] = 0 + } + return r +} +func TestStableMarshalRep(t *testing.T) { t.Run("empty", func(t *testing.T) { - testStringMarshal(t, "", false) - }) -} - -func TestBoolMarshal(t *testing.T) { - t.Run("true", func(t *testing.T) { - testBoolMarshal(t, true, false) - testBoolMarshal(t, true, true) - }) - - t.Run("false", func(t *testing.T) { - testBoolMarshal(t, false, false) - }) -} - -func TestInt32Marshal(t *testing.T) { - t.Run("zero", func(t *testing.T) { - testInt32Marshal(t, 0, false) - }) - - t.Run("positive", func(t *testing.T) { - testInt32Marshal(t, math.MaxInt32, false) - testInt32Marshal(t, math.MaxInt32, true) - }) - - t.Run("negative", func(t *testing.T) { - testInt32Marshal(t, math.MinInt32, false) - testInt32Marshal(t, math.MinInt32, true) - }) -} - -func TestUInt32Marshal(t *testing.T) { - t.Run("zero", func(t *testing.T) { - testUInt32Marshal(t, 0, false) - }) - - t.Run("non zero", func(t *testing.T) { - testUInt32Marshal(t, math.MaxUint32, false) - testUInt32Marshal(t, math.MaxUint32, true) - }) -} - -func TestInt64Marshal(t *testing.T) { - t.Run("zero", func(t *testing.T) { - testInt32Marshal(t, 0, false) - }) - - t.Run("positive", func(t *testing.T) { - testInt64Marshal(t, math.MaxInt64, false) - testInt64Marshal(t, math.MaxInt64, true) - }) - - t.Run("negative", func(t *testing.T) { - testInt64Marshal(t, math.MinInt64, false) - testInt64Marshal(t, math.MinInt64, true) - }) -} - -func TestUInt64Marshal(t *testing.T) { - t.Run("zero", func(t *testing.T) { - testUInt64Marshal(t, 0, false) - }) - - t.Run("non zero", func(t *testing.T) { - testUInt64Marshal(t, math.MaxUint64, false) - testUInt64Marshal(t, math.MaxUint64, true) - }) -} - -func TestEnumMarshal(t *testing.T) { - testEnumMarshal(t, ENUM_UNKNOWN, false) - testEnumMarshal(t, ENUM_POSITIVE, false) - testEnumMarshal(t, ENUM_POSITIVE, true) - testEnumMarshal(t, ENUM_NEGATIVE, false) - testEnumMarshal(t, ENUM_NEGATIVE, true) -} - -func TestRepeatedBytesMarshal(t *testing.T) { - t.Run("not empty", func(t *testing.T) { - data := [][]byte{[]byte("One"), []byte("Two"), []byte("Three")} - testRepeatedBytesMarshal(t, data, false) - testRepeatedBytesMarshal(t, data, true) - }) - - t.Run("empty", func(t *testing.T) { - testRepeatedBytesMarshal(t, [][]byte{}, false) - }) - - t.Run("empty element", func(t *testing.T) { - testRepeatedBytesMarshal(t, [][]byte{{1}, {}}, false) - }) - - t.Run("nil", func(t *testing.T) { - testRepeatedBytesMarshal(t, nil, false) - }) -} - -func TestRepeatedStringMarshal(t *testing.T) { - t.Run("not empty", func(t *testing.T) { - data := []string{"One", "Two", "Three"} - testRepeatedStringMarshal(t, data, false) - testRepeatedStringMarshal(t, data, true) - }) - - t.Run("empty element", func(t *testing.T) { - testRepeatedStringMarshal(t, []string{""}, false) - }) - - t.Run("empty", func(t *testing.T) { - testRepeatedStringMarshal(t, []string{}, false) - }) - - t.Run("nil", func(t *testing.T) { - testRepeatedStringMarshal(t, nil, false) - }) -} - -func TestRepeatedInt32Marshal(t *testing.T) { - t.Run("not empty", func(t *testing.T) { - data := []int32{-1, 0, 1, 2, 3, 4, 5} - testRepeatedInt32Marshal(t, data, false) - testRepeatedInt32Marshal(t, data, true) - }) - - t.Run("empty", func(t *testing.T) { - testRepeatedInt32Marshal(t, []int32{}, false) - }) - - t.Run("nil", func(t *testing.T) { - testRepeatedInt32Marshal(t, nil, false) - }) -} - -func TestRepeatedUInt32Marshal(t *testing.T) { - t.Run("not empty", func(t *testing.T) { - data := []uint32{0, 1, 2, 3, 4, 5} - testRepeatedUInt32Marshal(t, data, false) - testRepeatedUInt32Marshal(t, data, true) - }) - - t.Run("empty", func(t *testing.T) { - testRepeatedUInt32Marshal(t, []uint32{}, false) - }) - - t.Run("nil", func(t *testing.T) { - testRepeatedUInt32Marshal(t, nil, false) - }) -} - -func TestRepeatedInt64Marshal(t *testing.T) { - t.Run("not empty", func(t *testing.T) { - data := []int64{-1, 0, 1, 2, 3, 4, 5} - testRepeatedInt64Marshal(t, data, false) - testRepeatedInt64Marshal(t, data, true) - }) - - t.Run("empty", func(t *testing.T) { - testRepeatedInt64Marshal(t, []int64{}, false) - }) - - t.Run("nil", func(t *testing.T) { - testRepeatedInt64Marshal(t, nil, false) - }) -} - -func TestRepeatedUInt64Marshal(t *testing.T) { - t.Run("not empty", func(t *testing.T) { - data := []uint64{0, 1, 2, 3, 4, 5} - testRepeatedUInt64Marshal(t, data, false) - testRepeatedUInt64Marshal(t, data, true) - }) - - t.Run("empty", func(t *testing.T) { - testRepeatedUInt64Marshal(t, []uint64{}, false) - }) - - t.Run("nil", func(t *testing.T) { - testRepeatedUInt64Marshal(t, nil, false) - }) -} - -func TestRepeatedUInt64MarshalUnpacked(t *testing.T) { - t.Run("not empty", func(t *testing.T) { - data := []uint64{0, 1, 2, 3, 4, 5} - testRepeatedUInt64MarshalUnpacked(t, data, false) - testRepeatedUInt64MarshalUnpacked(t, data, true) - }) - - t.Run("empty", func(t *testing.T) { - testRepeatedUInt64MarshalUnpacked(t, []uint64{}, false) - }) - - t.Run("nil", func(t *testing.T) { - testRepeatedUInt64MarshalUnpacked(t, nil, false) - }) -} - -func TestFixed64Marshal(t *testing.T) { - t.Run("zero", func(t *testing.T) { - testFixed64Marshal(t, 0, false) - }) - - t.Run("non zero", func(t *testing.T) { - testFixed64Marshal(t, math.MaxUint64, false) - testFixed64Marshal(t, math.MaxUint64, true) - }) -} - -func TestFloat64Marshal(t *testing.T) { - t.Run("zero", func(t *testing.T) { - testFloat64Marshal(t, 0, false) - }) - - t.Run("non zero", func(t *testing.T) { - f := math.Float64frombits(12345677890) - - testFloat64Marshal(t, f, false) - testFloat64Marshal(t, f, true) - }) -} - -func TestFixed32Marshal(t *testing.T) { - t.Run("zero", func(t *testing.T) { - testFixed32Marshal(t, 0, false) - }) - - t.Run("non zero", func(t *testing.T) { - testFixed32Marshal(t, math.MaxUint32, false) - testFixed32Marshal(t, math.MaxUint32, true) - }) -} - -func testMarshal(t *testing.T, c stablePrimitives, tr *test.Primitives, wrongField bool) *test.Primitives { - var ( - wire []byte - err error - ) - wire, err = c.stableMarshal(nil, wrongField) - require.NoError(t, err) - - wireGen, err := goproto.Marshal(tr) - require.NoError(t, err) - - if !wrongField { - // we can check equality because single field cannot be unstable marshalled - require.Equal(t, wireGen, wire) - } else { - require.NotEqual(t, wireGen, wire) - } - - result := new(test.Primitives) - err = goproto.Unmarshal(wire, result) - require.NoError(t, err) - - return result -} - -func testBytesMarshal(t *testing.T, data []byte, wrongField bool) { - var ( - custom = stablePrimitives{FieldA: data} - transport = test.Primitives{FieldA: data} - ) - - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Len(t, result.FieldA, len(data)) - if len(data) > 0 { - require.Equal(t, data, result.FieldA) + marshalCases := []struct { + name string + input *test.RepPrimitives + }{ + {name: "default", input: &test.RepPrimitives{}}, + {name: "bytes", input: &test.RepPrimitives{FieldA: [][]byte{}}}, + {name: "string", input: &test.RepPrimitives{FieldB: []string{}}}, + {name: "int32", input: &test.RepPrimitives{FieldC: []int32{}}}, + {name: "uint32", input: &test.RepPrimitives{FieldD: []uint32{}}}, + {name: "int64", input: &test.RepPrimitives{FieldE: []int64{}}}, + {name: "uint64", input: &test.RepPrimitives{FieldF: []uint64{}}}, + {name: "uint64", input: &test.RepPrimitives{FieldFu: []uint64{}}}, } - } else { - require.Len(t, result.FieldA, 0) - } -} -func testStringMarshal(t *testing.T, s string, wrongField bool) { - var ( - custom = stablePrimitives{FieldB: s} - transport = test.Primitives{FieldB: s} - ) + for _, tc := range marshalCases { + require.Zero(t, tc.input.StableSize()) - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Len(t, result.FieldB, len(s)) - if len(s) > 0 { - require.Equal(t, s, result.FieldB) + r := tc.input.StableMarshal(nil) + require.Empty(t, r) } - } else { - require.Len(t, result.FieldB, 0) - } -} - -func testBoolMarshal(t *testing.T, b bool, wrongField bool) { - var ( - custom = stablePrimitives{FieldC: b} - transport = test.Primitives{FieldC: b} - ) - - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Equal(t, b, result.FieldC) - } else { - require.False(t, false, result.FieldC) - } -} - -func testInt32Marshal(t *testing.T, n int32, wrongField bool) { - var ( - custom = stablePrimitives{FieldD: n} - transport = test.Primitives{FieldD: n} - ) - - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Equal(t, n, result.FieldD) - } else { - require.EqualValues(t, 0, result.FieldD) - } -} - -func testUInt32Marshal(t *testing.T, n uint32, wrongField bool) { - var ( - custom = stablePrimitives{FieldE: n} - transport = test.Primitives{FieldE: n} - ) - - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Equal(t, n, result.FieldE) - } else { - require.EqualValues(t, 0, result.FieldE) - } -} - -func testInt64Marshal(t *testing.T, n int64, wrongField bool) { - var ( - custom = stablePrimitives{FieldF: n} - transport = test.Primitives{FieldF: n} - ) - - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Equal(t, n, result.FieldF) - } else { - require.EqualValues(t, 0, result.FieldF) - } -} - -func testUInt64Marshal(t *testing.T, n uint64, wrongField bool) { - var ( - custom = stablePrimitives{FieldG: n} - transport = test.Primitives{FieldG: n} - ) - - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Equal(t, n, result.FieldG) - } else { - require.EqualValues(t, 0, result.FieldG) - } -} - -func testFloat64Marshal(t *testing.T, n float64, wrongField bool) { - var ( - custom = stablePrimitives{FieldJ: n} - transport = test.Primitives{FieldJ: n} - ) - - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Equal(t, n, result.FieldJ) - } else { - require.EqualValues(t, 0, result.FieldJ) - } -} - -func testEnumMarshal(t *testing.T, e SomeEnum, wrongField bool) { - var ( - custom = stablePrimitives{FieldH: e} - transport = test.Primitives{FieldH: test.Primitives_SomeEnum(e)} - ) - - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.EqualValues(t, custom.FieldH, result.FieldH) - } else { - require.EqualValues(t, 0, result.FieldH) - } -} - -func testRepMarshal(t *testing.T, c stableRepPrimitives, tr *test.RepPrimitives, wrongField bool) *test.RepPrimitives { - var ( - wire []byte - err error - ) - wire, err = c.stableMarshal(nil, wrongField) - require.NoError(t, err) - - wireGen, err := goproto.Marshal(tr) - require.NoError(t, err) - - if !wrongField { - // we can check equality because single field cannot be unstable marshalled - require.Equal(t, wireGen, wire) - } else { - require.NotEqual(t, wireGen, wire) - } - - result := new(test.RepPrimitives) - err = goproto.Unmarshal(wire, result) - require.NoError(t, err) - - return result -} - -func testRepeatedBytesMarshal(t *testing.T, data [][]byte, wrongField bool) { - var ( - custom = stableRepPrimitives{FieldA: data} - transport = test.RepPrimitives{FieldA: data} - ) - - result := testRepMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Len(t, result.FieldA, len(data)) - if len(data) > 0 { - require.Equal(t, data, result.FieldA) - } - } else { - require.Len(t, result.FieldA, 0) - } -} - -func testRepeatedStringMarshal(t *testing.T, s []string, wrongField bool) { - var ( - custom = stableRepPrimitives{FieldB: s} - transport = test.RepPrimitives{FieldB: s} - ) - - result := testRepMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Len(t, result.FieldB, len(s)) - if len(s) > 0 { - require.Equal(t, s, result.FieldB) - } - } else { - require.Len(t, result.FieldB, 0) - } -} - -func testRepeatedInt32Marshal(t *testing.T, n []int32, wrongField bool) { - var ( - custom = stableRepPrimitives{FieldC: n} - transport = test.RepPrimitives{FieldC: n} - ) - - result := testRepMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Len(t, result.FieldC, len(n)) - if len(n) > 0 { - require.Equal(t, n, result.FieldC) - } - } else { - require.Len(t, result.FieldC, 0) - } -} - -func testRepeatedUInt32Marshal(t *testing.T, n []uint32, wrongField bool) { - var ( - custom = stableRepPrimitives{FieldD: n} - transport = test.RepPrimitives{FieldD: n} - ) - - result := testRepMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Len(t, result.FieldD, len(n)) - if len(n) > 0 { - require.Equal(t, n, result.FieldD) - } - } else { - require.Len(t, result.FieldD, 0) - } -} - -func testRepeatedInt64Marshal(t *testing.T, n []int64, wrongField bool) { - var ( - custom = stableRepPrimitives{FieldE: n} - transport = test.RepPrimitives{FieldE: n} - ) - - result := testRepMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Len(t, result.FieldE, len(n)) - if len(n) > 0 { - require.Equal(t, n, result.FieldE) - } - } else { - require.Len(t, result.FieldE, 0) - } -} - -func testRepeatedUInt64Marshal(t *testing.T, n []uint64, wrongField bool) { - var ( - custom = stableRepPrimitives{FieldF: n} - transport = test.RepPrimitives{FieldF: n} - ) - - result := testRepMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Len(t, result.FieldF, len(n)) - if len(n) > 0 { - require.Equal(t, n, result.FieldF) - } - } else { - require.Len(t, result.FieldF, 0) - } -} - -func testRepeatedUInt64MarshalUnpacked(t *testing.T, n []uint64, wrongField bool) { - var ( - custom = stableRepPrimitives{FieldFu: n} - transport = test.RepPrimitives{FieldFu: n} - ) - - result := testRepMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Len(t, result.FieldFu, len(n)) - if len(n) > 0 { - require.Equal(t, n, result.FieldFu) - } - } else { - require.Len(t, result.FieldFu, 0) - } -} - -func testFixed64Marshal(t *testing.T, n uint64, wrongField bool) { - var ( - custom = stablePrimitives{FieldI: n} - transport = test.Primitives{FieldI: n} - ) - - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Equal(t, n, result.FieldI) - } else { - require.EqualValues(t, 0, result.FieldI) - } -} - -func testFixed32Marshal(t *testing.T, n uint32, wrongField bool) { - var ( - custom = stablePrimitives{FieldK: n} - transport = test.Primitives{FieldK: n} - ) - - result := testMarshal(t, custom, &transport, wrongField) - - if !wrongField { - require.Equal(t, n, result.FieldK) - } else { - require.EqualValues(t, 0, result.FieldK) + }) + + marshalCases := []struct { + name string + input *test.RepPrimitives + }{ + {name: "bytes", input: &test.RepPrimitives{FieldA: [][]byte{{1, 2, 3}}}}, + {name: "string", input: &test.RepPrimitives{FieldB: []string{"123"}}}, + {name: "int32", input: &test.RepPrimitives{FieldC: randIntSlice[int32](1, true)}}, + {name: "int32", input: &test.RepPrimitives{FieldC: randIntSlice[int32](2, true)}}, + {name: "int32", input: &test.RepPrimitives{FieldC: randIntSlice[int32](2, false)}}, + {name: "uint32", input: &test.RepPrimitives{FieldD: randIntSlice[uint32](1, true)}}, + {name: "uint32", input: &test.RepPrimitives{FieldD: randIntSlice[uint32](2, true)}}, + {name: "uint32", input: &test.RepPrimitives{FieldD: randIntSlice[uint32](2, false)}}, + {name: "int64", input: &test.RepPrimitives{FieldE: randIntSlice[int64](1, true)}}, + {name: "int64", input: &test.RepPrimitives{FieldE: randIntSlice[int64](2, true)}}, + {name: "int64", input: &test.RepPrimitives{FieldE: randIntSlice[int64](2, false)}}, + {name: "uint64", input: &test.RepPrimitives{FieldF: randIntSlice[uint64](1, true)}}, + {name: "uint64", input: &test.RepPrimitives{FieldF: randIntSlice[uint64](2, true)}}, + {name: "uint64", input: &test.RepPrimitives{FieldF: randIntSlice[uint64](2, false)}}, + {name: "uint64", input: &test.RepPrimitives{FieldFu: randIntSlice[uint64](1, true)}}, + {name: "uint64", input: &test.RepPrimitives{FieldFu: randIntSlice[uint64](2, true)}}, + {name: "uint64", input: &test.RepPrimitives{FieldFu: randIntSlice[uint64](2, false)}}, + } + for _, tc := range marshalCases { + t.Run(tc.name, func(t *testing.T) { + r := tc.input.StableMarshal(nil) + require.Equal(t, len(r), tc.input.StableSize()) + require.NotEmpty(t, r) + + var actual test.RepPrimitives + require.NoError(t, goproto.Unmarshal(r, &actual)) + + // Compare each field directly, because proto-generated code has private fields. + require.Equal(t, tc.input.FieldA, actual.FieldA) + require.Equal(t, tc.input.FieldB, actual.FieldB) + require.Equal(t, tc.input.FieldC, actual.FieldC) + require.Equal(t, tc.input.FieldD, actual.FieldD) + require.Equal(t, tc.input.FieldE, actual.FieldE) + require.Equal(t, tc.input.FieldF, actual.FieldF) + require.Equal(t, tc.input.FieldFu, actual.FieldFu) + }) } } diff --git a/util/proto/test/test_frostfs.pb.go b/util/proto/test/test_frostfs.pb.go new file mode 100644 index 0000000..47c6d60 --- /dev/null +++ b/util/proto/test/test_frostfs.pb.go @@ -0,0 +1,117 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package test + +import ( + binary "encoding/binary" + protowire "google.golang.org/protobuf/encoding/protowire" +) + +import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Primitives) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.FieldA) + size += proto.StringSize(2, x.FieldB) + size += proto.BoolSize(200, x.FieldC) + size += proto.Int32Size(201, x.FieldD) + size += proto.UInt32Size(202, x.FieldE) + size += proto.Int64Size(203, x.FieldF) + size += proto.UInt64Size(204, x.FieldG) + size += proto.Fixed64Size(205, x.FieldI) + size += proto.Float64Size(206, x.FieldJ) + size += proto.Fixed32Size(207, x.FieldK) + size += proto.EnumSize(300, int32(x.FieldH)) + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), 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 binary format. +func (x *Primitives) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.BytesMarshal(1, buf[offset:], x.FieldA) + offset += proto.StringMarshal(2, buf[offset:], x.FieldB) + offset += proto.BoolMarshal(200, buf[offset:], x.FieldC) + offset += proto.Int32Marshal(201, buf[offset:], x.FieldD) + offset += proto.UInt32Marshal(202, buf[offset:], x.FieldE) + offset += proto.Int64Marshal(203, buf[offset:], x.FieldF) + offset += proto.UInt64Marshal(204, buf[offset:], x.FieldG) + offset += proto.Fixed64Marshal(205, buf[offset:], x.FieldI) + offset += proto.Float64Marshal(206, buf[offset:], x.FieldJ) + offset += proto.Fixed32Marshal(207, buf[offset:], x.FieldK) + offset += proto.EnumMarshal(300, buf[offset:], int32(x.FieldH)) + return buf +} + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RepPrimitives) StableSize() (size int) { + if x == nil { + return 0 + } + var n int + size += proto.RepeatedBytesSize(1, x.FieldA) + size += proto.RepeatedStringSize(2, x.FieldB) + n, _ = proto.RepeatedInt32Size(3, x.FieldC) + size += n + n, _ = proto.RepeatedUInt32Size(4, x.FieldD) + size += n + n, _ = proto.RepeatedInt64Size(5, x.FieldE) + size += n + n, _ = proto.RepeatedUInt64Size(6, x.FieldF) + size += n + for i := range x.FieldFu { + size += protowire.SizeGroup(protowire.Number(7), protowire.SizeVarint(x.FieldFu[i])) + } + return size +} + +// StableMarshal marshals x in protobuf binary format with stable field order. +// +// If buffer length is less than x.StableSize(), 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 binary format. +func (x *RepPrimitives) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + if buf == nil { + buf = make([]byte, x.StableSize()) + } + var offset int + offset += proto.RepeatedBytesMarshal(1, buf[offset:], x.FieldA) + offset += proto.RepeatedStringMarshal(2, buf[offset:], x.FieldB) + offset += proto.RepeatedInt32Marshal(3, buf[offset:], x.FieldC) + offset += proto.RepeatedUInt32Marshal(4, buf[offset:], x.FieldD) + offset += proto.RepeatedInt64Marshal(5, buf[offset:], x.FieldE) + offset += proto.RepeatedUInt64Marshal(6, buf[offset:], x.FieldF) + for i := range x.FieldFu { + { + prefix := protowire.EncodeTag(protowire.Number(7), protowire.VarintType) + offset += binary.PutUvarint(buf[offset:], uint64(prefix)) + offset += binary.PutUvarint(buf[offset:], x.FieldFu[i]) + } + } + return buf +} From d112a28d382f6e6a10a2aa24190c857f70cf8984 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 13 Aug 2024 18:50:51 +0300 Subject: [PATCH 127/169] [#104] object: Add getters for `PatchRequestBodyPatch` Signed-off-by: Airat Arifullin --- object/convert.go | 4 ++-- object/marshal.go | 8 ++++---- object/types.go | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/object/convert.go b/object/convert.go index 5c9e20a..9814b58 100644 --- a/object/convert.go +++ b/object/convert.go @@ -2352,8 +2352,8 @@ func (r *PatchRequestBodyPatch) ToGRPCMessage() grpc.Message { if r != nil { m = new(object.PatchRequest_Body_Patch) - m.SetSourceRange(r.Range.ToGRPCMessage().(*object.Range)) - m.SetChunk(r.Chunk) + m.SetSourceRange(r.GetRange().ToGRPCMessage().(*object.Range)) + m.SetChunk(r.GetChunk()) } return m diff --git a/object/marshal.go b/object/marshal.go index f337502..166b523 100644 --- a/object/marshal.go +++ b/object/marshal.go @@ -1335,8 +1335,8 @@ func (r *PatchRequestBodyPatch) StableMarshal(buf []byte) []byte { } var offset int - offset += proto.NestedStructureMarshal(patchRequestBodyPatchRangeField, buf[offset:], r.Range) - proto.BytesMarshal(patchRequestBodyPatchChunkField, buf[offset:], r.Chunk) + offset += proto.NestedStructureMarshal(patchRequestBodyPatchRangeField, buf[offset:], r.GetRange()) + proto.BytesMarshal(patchRequestBodyPatchChunkField, buf[offset:], r.GetChunk()) return buf } @@ -1347,8 +1347,8 @@ func (r *PatchRequestBodyPatch) StableSize() int { } var size int - size += proto.NestedStructureSize(patchRequestBodyPatchRangeField, r.Range) - size += proto.BytesSize(patchRequestBodyPatchChunkField, r.Chunk) + size += proto.NestedStructureSize(patchRequestBodyPatchRangeField, r.GetRange()) + size += proto.BytesSize(patchRequestBodyPatchChunkField, r.GetChunk()) return size } diff --git a/object/types.go b/object/types.go index c1a8b87..160e820 100644 --- a/object/types.go +++ b/object/types.go @@ -1615,6 +1615,22 @@ func (r *PatchResponse) SetBody(v *PatchResponseBody) { r.Body = v } +func (r *PatchRequestBodyPatch) GetChunk() []byte { + if r != nil { + return r.Chunk + } + + return nil +} + +func (r *PatchRequestBodyPatch) GetRange() *Range { + if r != nil { + return r.Range + } + + return nil +} + func (s *ECInfo) getObjectPart() {} func (s *ECInfo) getHeaderPart() {} From a28ceb251a433869e56110070cbc484295afff3a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 9 Aug 2024 17:20:07 +0300 Subject: [PATCH 128/169] [#77] util/proto: Optimize int32 marshaling This is the approach used in easyproto https://github.com/VictoriaMetrics/easyproto/blob/52d3ac47440b52fd42bf4bbb5bacb358a85fccc3/writer.go#L203 It allows to occupy slightly less space for negative numbers. The format is still protobuf, although, technically, this is a breaking change for our stable marshaling format. However, we don't use int32 at all and all enums have positive values, so nothing is broken. Signed-off-by: Evgenii Stratonikov --- util/proto/marshal.go | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/util/proto/marshal.go b/util/proto/marshal.go index 26b3eb0..42c6a91 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -136,19 +136,19 @@ func UInt32Size(field int, v uint32) int { } func Int32Marshal(field int, buf []byte, v int32) int { - return UInt64Marshal(field, buf, uint64(v)) + return UInt64Marshal(field, buf, uint64(uint32(v))) } func Int32Size(field int, v int32) int { - return UInt64Size(field, uint64(v)) + return UInt64Size(field, uint64(uint32(v))) } func EnumMarshal(field int, buf []byte, v int32) int { - return UInt64Marshal(field, buf, uint64(v)) + return UInt64Marshal(field, buf, uint64(uint32(v))) } func EnumSize(field int, v int32) int { - return UInt64Size(field, uint64(v)) + return UInt64Size(field, uint64(uint32(v))) } func RepeatedBytesMarshal(field int, buf []byte, v [][]byte) int { @@ -243,11 +243,28 @@ func RepeatedUInt32Size(field int, v []uint32) (size, arraySize int) { } func RepeatedInt32Marshal(field int, buf []byte, v []int32) int { - return repeatedUIntMarshal(field, buf, v) + if len(v) == 0 { + return 0 + } + + prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType) + offset := binary.PutUvarint(buf, uint64(prefix)) + _, arrSize := RepeatedInt32Size(field, v) + offset += binary.PutUvarint(buf[offset:], uint64(arrSize)) + for i := range v { + offset += binary.PutUvarint(buf[offset:], uint64(uint32(v[i]))) + } + return offset } func RepeatedInt32Size(field int, v []int32) (size, arraySize int) { - return repeatedUIntSize(field, v) + if len(v) == 0 { + return 0, 0 + } + for i := range v { + arraySize += protowire.SizeVarint(uint64(uint32(v[i]))) + } + return protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(arraySize)), arraySize } // VarUIntSize returns length of varint byte sequence for uint64 value 'x'. From adb7c602d7e5762bd385cb0282dec3b323de25ac Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 25 Apr 2024 15:13:10 +0300 Subject: [PATCH 129/169] [#77] protogen: Initial implementation Signed-off-by: Evgenii Stratonikov --- Makefile | 11 +- accounting/grpc/service.go | 46 - accounting/grpc/service.pb.go | 451 - accounting/grpc/service_frostfs.pb.go | 724 ++ accounting/grpc/service_frostfs_fuzz.go | 45 + accounting/grpc/service_frostfs_test.go | 31 + accounting/grpc/types.go | 11 - accounting/grpc/types.pb.go | 169 - accounting/grpc/types_frostfs.pb.go | 174 + accounting/grpc/types_frostfs_fuzz.go | 26 + accounting/grpc/types_frostfs_test.go | 21 + acl/convert.go | 2 +- acl/grpc/types.go | 193 - acl/grpc/types.pb.go | 1231 --- acl/grpc/types_frostfs.pb.go | 1994 ++++ acl/grpc/types_frostfs_fuzz.go | 64 + acl/grpc/types_frostfs_test.go | 41 + ape/grpc/types.go | 21 - ape/grpc/types.pb.go | 310 - ape/grpc/types_frostfs.pb.go | 400 + ape/grpc/types_frostfs_fuzz.go | 45 + ape/grpc/types_frostfs_test.go | 31 + apemanager/grpc/service.go | 106 - apemanager/grpc/service.pb.go | 1129 --- apemanager/grpc/service_frostfs.pb.go | 2183 +++++ apemanager/grpc/service_frostfs_fuzz.go | 121 + apemanager/grpc/service_frostfs_test.go | 71 + container/grpc/service.go | 234 - container/grpc/service.pb.go | 1909 ---- container/grpc/service_frostfs.pb.go | 3748 +++++++ container/grpc/service_frostfs_fuzz.go | 197 + container/grpc/service_frostfs_test.go | 111 + container/grpc/types.go | 46 - container/grpc/types.pb.go | 337 - container/grpc/types_frostfs.pb.go | 495 + container/grpc/types_frostfs_fuzz.go | 26 + container/grpc/types_frostfs_test.go | 21 + go.mod | 3 + go.sum | 6 + lock/grpc/types.go | 8 - lock/grpc/types.pb.go | 160 - lock/grpc/types_frostfs.pb.go | 167 + lock/grpc/types_frostfs_fuzz.go | 26 + lock/grpc/types_frostfs_test.go | 21 + netmap/grpc/service.go | 116 - netmap/grpc/service.pb.go | 1108 --- netmap/grpc/service_frostfs.pb.go | 2061 ++++ netmap/grpc/service_frostfs_fuzz.go | 121 + netmap/grpc/service_frostfs_test.go | 71 + netmap/grpc/types.go | 212 - netmap/grpc/types.pb.go | 1371 --- netmap/grpc/types_frostfs.pb.go | 2453 +++++ netmap/grpc/types_frostfs_fuzz.go | 159 + netmap/grpc/types_frostfs_test.go | 91 + object/convert.go | 2 +- object/grpc/service.go | 610 -- object/grpc/service.pb.go | 4244 -------- object/grpc/service_frostfs.pb.go | 8690 +++++++++++++++++ object/grpc/service_frostfs_fuzz.go | 387 + object/grpc/service_frostfs_test.go | 211 + object/grpc/service_grpc.pb.go | 4 +- object/grpc/status.pb.go | 251 - object/grpc/types.go | 197 - object/grpc/types.pb.go | 1373 --- object/grpc/types_frostfs.pb.go | 2621 +++++ object/grpc/types_frostfs_fuzz.go | 102 + object/grpc/types_frostfs_test.go | 61 + refs/grpc/types.go | 97 - refs/grpc/types.pb.go | 852 -- refs/grpc/types_frostfs.pb.go | 1343 +++ refs/grpc/types_frostfs_fuzz.go | 159 + refs/grpc/types_frostfs_test.go | 91 + rpc/client/client.go | 2 + rpc/message/encoding.go | 20 +- rpc/netmap.go | 1 - session/convert.go | 2 +- session/grpc/service.go | 55 - session/grpc/service.pb.go | 458 - session/grpc/service_frostfs.pb.go | 781 ++ session/grpc/service_frostfs_fuzz.go | 45 + session/grpc/service_frostfs_test.go | 31 + session/grpc/types.go | 246 - session/grpc/types.pb.go | 1451 --- session/grpc/types_frostfs.pb.go | 2730 ++++++ session/grpc/types_frostfs_fuzz.go | 159 + session/grpc/types_frostfs_test.go | 91 + status/grpc/types.go | 26 - status/grpc/types.pb.go | 721 -- status/grpc/types_frostfs.pb.go | 643 ++ status/grpc/types_frostfs_fuzz.go | 26 + status/grpc/types_frostfs_test.go | 21 + tombstone/grpc/types.go | 20 - tombstone/grpc/types.pb.go | 187 - tombstone/grpc/types_frostfs.pb.go | 229 + tombstone/grpc/types_frostfs_fuzz.go | 26 + tombstone/grpc/types_frostfs_test.go | 21 + util/pool/marshal.go | 7 + util/proto/encoding/compat.go | 22 + util/proto/encoding/json.go | 48 + util/proto/encoding/proto.go | 57 + util/proto/marshal.go | 13 +- util/proto/marshal_test.go | 103 +- util/proto/test/custom/test_frostfs.pb.go | 926 ++ util/proto/test/test_frostfs.pb.go | 117 - util/protogen/internalgengo/file.go | 250 + util/protogen/internalgengo/fuzz.go | 69 + util/protogen/internalgengo/getter.go | 14 + util/protogen/internalgengo/json.go | 230 + util/protogen/internalgengo/options.go | 7 + util/protogen/internalgengo/proto.go | 201 + .../internalgengo/proto_field_type.go | 56 + .../internalgengo/proto_stable_compat.go | 124 + util/protogen/internalgengo/writer.go | 30 + util/protogen/main.go | 265 +- util/signature/data.go | 18 +- 115 files changed, 36376 insertions(+), 20397 deletions(-) delete mode 100644 accounting/grpc/service.go delete mode 100644 accounting/grpc/service.pb.go create mode 100644 accounting/grpc/service_frostfs.pb.go create mode 100644 accounting/grpc/service_frostfs_fuzz.go create mode 100644 accounting/grpc/service_frostfs_test.go delete mode 100644 accounting/grpc/types.go delete mode 100644 accounting/grpc/types.pb.go create mode 100644 accounting/grpc/types_frostfs.pb.go create mode 100644 accounting/grpc/types_frostfs_fuzz.go create mode 100644 accounting/grpc/types_frostfs_test.go delete mode 100644 acl/grpc/types.go delete mode 100644 acl/grpc/types.pb.go create mode 100644 acl/grpc/types_frostfs.pb.go create mode 100644 acl/grpc/types_frostfs_fuzz.go create mode 100644 acl/grpc/types_frostfs_test.go delete mode 100644 ape/grpc/types.go delete mode 100644 ape/grpc/types.pb.go create mode 100644 ape/grpc/types_frostfs.pb.go create mode 100644 ape/grpc/types_frostfs_fuzz.go create mode 100644 ape/grpc/types_frostfs_test.go delete mode 100644 apemanager/grpc/service.go delete mode 100644 apemanager/grpc/service.pb.go create mode 100644 apemanager/grpc/service_frostfs.pb.go create mode 100644 apemanager/grpc/service_frostfs_fuzz.go create mode 100644 apemanager/grpc/service_frostfs_test.go delete mode 100644 container/grpc/service.go delete mode 100644 container/grpc/service.pb.go create mode 100644 container/grpc/service_frostfs.pb.go create mode 100644 container/grpc/service_frostfs_fuzz.go create mode 100644 container/grpc/service_frostfs_test.go delete mode 100644 container/grpc/types.go delete mode 100644 container/grpc/types.pb.go create mode 100644 container/grpc/types_frostfs.pb.go create mode 100644 container/grpc/types_frostfs_fuzz.go create mode 100644 container/grpc/types_frostfs_test.go delete mode 100644 lock/grpc/types.go delete mode 100644 lock/grpc/types.pb.go create mode 100644 lock/grpc/types_frostfs.pb.go create mode 100644 lock/grpc/types_frostfs_fuzz.go create mode 100644 lock/grpc/types_frostfs_test.go delete mode 100644 netmap/grpc/service.go delete mode 100644 netmap/grpc/service.pb.go create mode 100644 netmap/grpc/service_frostfs.pb.go create mode 100644 netmap/grpc/service_frostfs_fuzz.go create mode 100644 netmap/grpc/service_frostfs_test.go delete mode 100644 netmap/grpc/types.go delete mode 100644 netmap/grpc/types.pb.go create mode 100644 netmap/grpc/types_frostfs.pb.go create mode 100644 netmap/grpc/types_frostfs_fuzz.go create mode 100644 netmap/grpc/types_frostfs_test.go delete mode 100644 object/grpc/service.go delete mode 100644 object/grpc/service.pb.go create mode 100644 object/grpc/service_frostfs.pb.go create mode 100644 object/grpc/service_frostfs_fuzz.go create mode 100644 object/grpc/service_frostfs_test.go delete mode 100644 object/grpc/status.pb.go delete mode 100644 object/grpc/types.go delete mode 100644 object/grpc/types.pb.go create mode 100644 object/grpc/types_frostfs.pb.go create mode 100644 object/grpc/types_frostfs_fuzz.go create mode 100644 object/grpc/types_frostfs_test.go delete mode 100644 refs/grpc/types.go delete mode 100644 refs/grpc/types.pb.go create mode 100644 refs/grpc/types_frostfs.pb.go create mode 100644 refs/grpc/types_frostfs_fuzz.go create mode 100644 refs/grpc/types_frostfs_test.go delete mode 100644 session/grpc/service.go delete mode 100644 session/grpc/service.pb.go create mode 100644 session/grpc/service_frostfs.pb.go create mode 100644 session/grpc/service_frostfs_fuzz.go create mode 100644 session/grpc/service_frostfs_test.go delete mode 100644 session/grpc/types.go delete mode 100644 session/grpc/types.pb.go create mode 100644 session/grpc/types_frostfs.pb.go create mode 100644 session/grpc/types_frostfs_fuzz.go create mode 100644 session/grpc/types_frostfs_test.go delete mode 100644 status/grpc/types.go delete mode 100644 status/grpc/types.pb.go create mode 100644 status/grpc/types_frostfs.pb.go create mode 100644 status/grpc/types_frostfs_fuzz.go create mode 100644 status/grpc/types_frostfs_test.go delete mode 100644 tombstone/grpc/types.go delete mode 100644 tombstone/grpc/types.pb.go create mode 100644 tombstone/grpc/types_frostfs.pb.go create mode 100644 tombstone/grpc/types_frostfs_fuzz.go create mode 100644 tombstone/grpc/types_frostfs_test.go create mode 100644 util/pool/marshal.go create mode 100644 util/proto/encoding/compat.go create mode 100644 util/proto/encoding/json.go create mode 100644 util/proto/encoding/proto.go create mode 100644 util/proto/test/custom/test_frostfs.pb.go delete mode 100644 util/proto/test/test_frostfs.pb.go create mode 100644 util/protogen/internalgengo/file.go create mode 100644 util/protogen/internalgengo/fuzz.go create mode 100644 util/protogen/internalgengo/getter.go create mode 100644 util/protogen/internalgengo/json.go create mode 100644 util/protogen/internalgengo/options.go create mode 100644 util/protogen/internalgengo/proto.go create mode 100644 util/protogen/internalgengo/proto_field_type.go create mode 100644 util/protogen/internalgengo/proto_stable_compat.go create mode 100644 util/protogen/internalgengo/writer.go diff --git a/Makefile b/Makefile index 19b3138..7ed6954 100755 --- a/Makefile +++ b/Makefile @@ -61,12 +61,13 @@ protoc: make protoc-install; \ fi # Protoc generate - @for f in `find . -type f -name '*.proto' -not -path './bin/*'`; do \ + @for f in `find . -type f -name '*.proto' -not -path './bin/*' -not -path './util/proto/test/*'`; do \ echo "⇒ Processing $$f "; \ $(PROTOC_DIR)/bin/protoc \ --proto_path=.:$(PROTOC_DIR)/include:/usr/local/include \ - --plugin=protoc-gen-go=$(PROTOC_GEN_GO_DIR)/protoc-gen-go \ - --go_out=. --go_opt=paths=source_relative \ + --plugin=protoc-gen-go-frostfs=$(abspath ./bin/protogen) \ + --go-frostfs_out=fuzz=true:. \ + --go-frostfs_opt=paths=source_relative \ --go-grpc_opt=require_unimplemented_servers=false \ --go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \ done @@ -79,7 +80,9 @@ protogen: protoc-test: protoc protogen @$(PROTOC_DIR)/bin/protoc \ --plugin=protoc-gen-go-frostfs=$(abspath $(BIN)/protogen) \ - --go-frostfs_out=. --go-frostfs_opt=paths=source_relative \ + --go-frostfs_opt=Mutil/proto/test/test.proto=git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test/custom \ + --go-frostfs_opt=module=git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 \ + --go-frostfs_out=. --go-frostfs_opt=paths=import \ ./util/proto/test/test.proto # Run Unit Test with go test diff --git a/accounting/grpc/service.go b/accounting/grpc/service.go deleted file mode 100644 index fa292bf..0000000 --- a/accounting/grpc/service.go +++ /dev/null @@ -1,46 +0,0 @@ -package accounting - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" -) - -// SetOwnerId sets identifier of the account owner. -func (m *BalanceRequest_Body) SetOwnerId(v *refs.OwnerID) { - m.OwnerId = v -} - -// SetBody sets body of the request. -func (m *BalanceRequest) SetBody(v *BalanceRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *BalanceRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *BalanceRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetBalance sets balance value of the response. -func (m *BalanceResponse_Body) SetBalance(v *Decimal) { - m.Balance = v -} - -// SetBody sets body of the response. -func (m *BalanceResponse) SetBody(v *BalanceResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *BalanceResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *BalanceResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} diff --git a/accounting/grpc/service.pb.go b/accounting/grpc/service.pb.go deleted file mode 100644 index b66bb7a..0000000 --- a/accounting/grpc/service.pb.go +++ /dev/null @@ -1,451 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: accounting/grpc/service.proto - -package accounting - -import ( - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// BalanceRequest message -type BalanceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of the balance request message. - Body *BalanceRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *BalanceRequest) Reset() { - *x = BalanceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_accounting_grpc_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BalanceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BalanceRequest) ProtoMessage() {} - -func (x *BalanceRequest) ProtoReflect() protoreflect.Message { - mi := &file_accounting_grpc_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BalanceRequest.ProtoReflect.Descriptor instead. -func (*BalanceRequest) Descriptor() ([]byte, []int) { - return file_accounting_grpc_service_proto_rawDescGZIP(), []int{0} -} - -func (x *BalanceRequest) GetBody() *BalanceRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *BalanceRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *BalanceRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// BalanceResponse message -type BalanceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of the balance response message. - Body *BalanceResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *BalanceResponse) Reset() { - *x = BalanceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_accounting_grpc_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BalanceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BalanceResponse) ProtoMessage() {} - -func (x *BalanceResponse) ProtoReflect() protoreflect.Message { - mi := &file_accounting_grpc_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BalanceResponse.ProtoReflect.Descriptor instead. -func (*BalanceResponse) Descriptor() ([]byte, []int) { - return file_accounting_grpc_service_proto_rawDescGZIP(), []int{1} -} - -func (x *BalanceResponse) GetBody() *BalanceResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *BalanceResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *BalanceResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// To indicate the account for which the balance is requested, its identifier -// is used. It can be any existing account in NeoFS sidechain `Balance` smart -// contract. If omitted, client implementation MUST set it to the request's -// signer `OwnerID`. -type BalanceRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Valid user identifier in `OwnerID` format for which the balance is - // requested. Required field. - OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` -} - -func (x *BalanceRequest_Body) Reset() { - *x = BalanceRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_accounting_grpc_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BalanceRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BalanceRequest_Body) ProtoMessage() {} - -func (x *BalanceRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_accounting_grpc_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BalanceRequest_Body.ProtoReflect.Descriptor instead. -func (*BalanceRequest_Body) Descriptor() ([]byte, []int) { - return file_accounting_grpc_service_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *BalanceRequest_Body) GetOwnerId() *grpc1.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} - -// The amount of funds in GAS token for the `OwnerID`'s account requested. -// Balance is given in the `Decimal` format to avoid precision issues with -// rounding. -type BalanceResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Amount of funds in GAS token for the requested account. - Balance *Decimal `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` -} - -func (x *BalanceResponse_Body) Reset() { - *x = BalanceResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_accounting_grpc_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BalanceResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BalanceResponse_Body) ProtoMessage() {} - -func (x *BalanceResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_accounting_grpc_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BalanceResponse_Body.ProtoReflect.Descriptor instead. -func (*BalanceResponse_Body) Descriptor() ([]byte, []int) { - return file_accounting_grpc_service_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *BalanceResponse_Body) GetBalance() *Decimal { - if x != nil { - return x.Balance - } - return nil -} - -var File_accounting_grpc_service_proto protoreflect.FileDescriptor - -var file_accounting_grpc_service_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x14, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x1a, 0x1b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, - 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x02, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, - 0x3a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, - 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xae, 0x02, 0x0a, 0x0f, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3e, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, - 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, - 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x3f, 0x0a, 0x04, 0x42, - 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x65, 0x63, 0x69, - 0x6d, 0x61, 0x6c, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x32, 0x6b, 0x0a, 0x11, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x56, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74, - 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, - 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_accounting_grpc_service_proto_rawDescOnce sync.Once - file_accounting_grpc_service_proto_rawDescData = file_accounting_grpc_service_proto_rawDesc -) - -func file_accounting_grpc_service_proto_rawDescGZIP() []byte { - file_accounting_grpc_service_proto_rawDescOnce.Do(func() { - file_accounting_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounting_grpc_service_proto_rawDescData) - }) - return file_accounting_grpc_service_proto_rawDescData -} - -var file_accounting_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_accounting_grpc_service_proto_goTypes = []interface{}{ - (*BalanceRequest)(nil), // 0: neo.fs.v2.accounting.BalanceRequest - (*BalanceResponse)(nil), // 1: neo.fs.v2.accounting.BalanceResponse - (*BalanceRequest_Body)(nil), // 2: neo.fs.v2.accounting.BalanceRequest.Body - (*BalanceResponse_Body)(nil), // 3: neo.fs.v2.accounting.BalanceResponse.Body - (*grpc.RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader - (*grpc.RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader - (*grpc.ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader - (*grpc.ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader - (*grpc1.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID - (*Decimal)(nil), // 9: neo.fs.v2.accounting.Decimal -} -var file_accounting_grpc_service_proto_depIdxs = []int32{ - 2, // 0: neo.fs.v2.accounting.BalanceRequest.body:type_name -> neo.fs.v2.accounting.BalanceRequest.Body - 4, // 1: neo.fs.v2.accounting.BalanceRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 5, // 2: neo.fs.v2.accounting.BalanceRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 3, // 3: neo.fs.v2.accounting.BalanceResponse.body:type_name -> neo.fs.v2.accounting.BalanceResponse.Body - 6, // 4: neo.fs.v2.accounting.BalanceResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 7, // 5: neo.fs.v2.accounting.BalanceResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 8, // 6: neo.fs.v2.accounting.BalanceRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID - 9, // 7: neo.fs.v2.accounting.BalanceResponse.Body.balance:type_name -> neo.fs.v2.accounting.Decimal - 0, // 8: neo.fs.v2.accounting.AccountingService.Balance:input_type -> neo.fs.v2.accounting.BalanceRequest - 1, // 9: neo.fs.v2.accounting.AccountingService.Balance:output_type -> neo.fs.v2.accounting.BalanceResponse - 9, // [9:10] is the sub-list for method output_type - 8, // [8:9] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_accounting_grpc_service_proto_init() } -func file_accounting_grpc_service_proto_init() { - if File_accounting_grpc_service_proto != nil { - return - } - file_accounting_grpc_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_accounting_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounting_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounting_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_accounting_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_accounting_grpc_service_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_accounting_grpc_service_proto_goTypes, - DependencyIndexes: file_accounting_grpc_service_proto_depIdxs, - MessageInfos: file_accounting_grpc_service_proto_msgTypes, - }.Build() - File_accounting_grpc_service_proto = out.File - file_accounting_grpc_service_proto_rawDesc = nil - file_accounting_grpc_service_proto_goTypes = nil - file_accounting_grpc_service_proto_depIdxs = nil -} diff --git a/accounting/grpc/service_frostfs.pb.go b/accounting/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..e44d7d4 --- /dev/null +++ b/accounting/grpc/service_frostfs.pb.go @@ -0,0 +1,724 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package accounting + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type BalanceRequest_Body struct { + OwnerId *grpc.OwnerID `json:"ownerId"` +} + +var ( + _ encoding.ProtoMarshaler = (*BalanceRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*BalanceRequest_Body)(nil) + _ json.Marshaler = (*BalanceRequest_Body)(nil) + _ json.Unmarshaler = (*BalanceRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BalanceRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.OwnerId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BalanceRequest_Body) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *BalanceRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BalanceRequest_Body) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "BalanceRequest_Body") + } + switch fc.FieldNum { + case 1: // OwnerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "OwnerId") + } + x.OwnerId = new(grpc.OwnerID) + if err := x.OwnerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BalanceRequest_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *BalanceRequest_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BalanceRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"ownerId\":" + out.RawString(prefix[1:]) + x.OwnerId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BalanceRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BalanceRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "ownerId": + { + var f *grpc.OwnerID + f = new(grpc.OwnerID) + f.UnmarshalEasyJSON(in) + x.OwnerId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type BalanceRequest struct { + Body *BalanceRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*BalanceRequest)(nil) + _ encoding.ProtoUnmarshaler = (*BalanceRequest)(nil) + _ json.Marshaler = (*BalanceRequest)(nil) + _ json.Unmarshaler = (*BalanceRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BalanceRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.MetaHeader) + size += proto.NestedStructureSize(3, x.VerifyHeader) + return size +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *BalanceRequest) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *BalanceRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BalanceRequest) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *BalanceRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BalanceRequest) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "BalanceRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(BalanceRequest_Body) + if err := x.Body.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MetaHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") + } + x.MetaHeader = new(grpc1.RequestMetaHeader) + if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // VerifyHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") + } + x.VerifyHeader = new(grpc1.RequestVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BalanceRequest) GetBody() *BalanceRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *BalanceRequest) SetBody(v *BalanceRequest_Body) { + x.Body = v +} +func (x *BalanceRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *BalanceRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *BalanceRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *BalanceRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BalanceRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BalanceRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BalanceRequest) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "body": + { + var f *BalanceRequest_Body + f = new(BalanceRequest_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *grpc1.RequestMetaHeader + f = new(grpc1.RequestMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *grpc1.RequestVerificationHeader + f = new(grpc1.RequestVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type BalanceResponse_Body struct { + Balance *Decimal `json:"balance"` +} + +var ( + _ encoding.ProtoMarshaler = (*BalanceResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*BalanceResponse_Body)(nil) + _ json.Marshaler = (*BalanceResponse_Body)(nil) + _ json.Unmarshaler = (*BalanceResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BalanceResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Balance) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BalanceResponse_Body) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *BalanceResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Balance != nil && x.Balance.StableSize() != 0 { + x.Balance.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BalanceResponse_Body) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "BalanceResponse_Body") + } + switch fc.FieldNum { + case 1: // Balance + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Balance") + } + x.Balance = new(Decimal) + if err := x.Balance.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BalanceResponse_Body) GetBalance() *Decimal { + if x != nil { + return x.Balance + } + return nil +} +func (x *BalanceResponse_Body) SetBalance(v *Decimal) { + x.Balance = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BalanceResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"balance\":" + out.RawString(prefix[1:]) + x.Balance.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BalanceResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BalanceResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "balance": + { + var f *Decimal + f = new(Decimal) + f.UnmarshalEasyJSON(in) + x.Balance = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type BalanceResponse struct { + Body *BalanceResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*BalanceResponse)(nil) + _ encoding.ProtoUnmarshaler = (*BalanceResponse)(nil) + _ json.Marshaler = (*BalanceResponse)(nil) + _ json.Unmarshaler = (*BalanceResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BalanceResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.MetaHeader) + size += proto.NestedStructureSize(3, x.VerifyHeader) + return size +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *BalanceResponse) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *BalanceResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BalanceResponse) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *BalanceResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BalanceResponse) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "BalanceResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(BalanceResponse_Body) + if err := x.Body.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MetaHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") + } + x.MetaHeader = new(grpc1.ResponseMetaHeader) + if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // VerifyHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") + } + x.VerifyHeader = new(grpc1.ResponseVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BalanceResponse) GetBody() *BalanceResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *BalanceResponse) SetBody(v *BalanceResponse_Body) { + x.Body = v +} +func (x *BalanceResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *BalanceResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *BalanceResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *BalanceResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BalanceResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BalanceResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BalanceResponse) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "body": + { + var f *BalanceResponse_Body + f = new(BalanceResponse_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *grpc1.ResponseMetaHeader + f = new(grpc1.ResponseMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *grpc1.ResponseVerificationHeader + f = new(grpc1.ResponseVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/accounting/grpc/service_frostfs_fuzz.go b/accounting/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..69e7174 --- /dev/null +++ b/accounting/grpc/service_frostfs_fuzz.go @@ -0,0 +1,45 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package accounting + +func DoFuzzProtoBalanceRequest(data []byte) int { + msg := new(BalanceRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONBalanceRequest(data []byte) int { + msg := new(BalanceRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoBalanceResponse(data []byte) int { + msg := new(BalanceResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONBalanceResponse(data []byte) int { + msg := new(BalanceResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/accounting/grpc/service_frostfs_test.go b/accounting/grpc/service_frostfs_test.go new file mode 100644 index 0000000..b97a13e --- /dev/null +++ b/accounting/grpc/service_frostfs_test.go @@ -0,0 +1,31 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package accounting + +import ( + testing "testing" +) + +func FuzzProtoBalanceRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoBalanceRequest(data) + }) +} +func FuzzJSONBalanceRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONBalanceRequest(data) + }) +} +func FuzzProtoBalanceResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoBalanceResponse(data) + }) +} +func FuzzJSONBalanceResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONBalanceResponse(data) + }) +} diff --git a/accounting/grpc/types.go b/accounting/grpc/types.go deleted file mode 100644 index 1c1bac9..0000000 --- a/accounting/grpc/types.go +++ /dev/null @@ -1,11 +0,0 @@ -package accounting - -// SetValue sets value of the decimal number. -func (m *Decimal) SetValue(v int64) { - m.Value = v -} - -// SetPrecision sets precision of the decimal number. -func (m *Decimal) SetPrecision(v uint32) { - m.Precision = v -} diff --git a/accounting/grpc/types.pb.go b/accounting/grpc/types.pb.go deleted file mode 100644 index 8be14bc..0000000 --- a/accounting/grpc/types.pb.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: accounting/grpc/types.proto - -package accounting - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Standard floating point data type can't be used in NeoFS due to inexactness -// of the result when doing lots of small number operations. To solve the lost -// precision issue, special `Decimal` format is used for monetary computations. -// -// Please see [The General Decimal Arithmetic -// Specification](http://speleotrove.com/decimal/) for detailed problem -// description. -type Decimal struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Number in the smallest Token fractions. - Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` - // Precision value indicating how many smallest fractions can be in one - // integer. - Precision uint32 `protobuf:"varint,2,opt,name=precision,proto3" json:"precision,omitempty"` -} - -func (x *Decimal) Reset() { - *x = Decimal{} - if protoimpl.UnsafeEnabled { - mi := &file_accounting_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Decimal) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Decimal) ProtoMessage() {} - -func (x *Decimal) ProtoReflect() protoreflect.Message { - mi := &file_accounting_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Decimal.ProtoReflect.Descriptor instead. -func (*Decimal) Descriptor() ([]byte, []int) { - return file_accounting_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *Decimal) GetValue() int64 { - if x != nil { - return x.Value - } - return 0 -} - -func (x *Decimal) GetPrecision() uint32 { - if x != nil { - return x.Precision - } - return 0 -} - -var File_accounting_grpc_types_proto protoreflect.FileDescriptor - -var file_accounting_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x42, 0x6d, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, - 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, - 0xaa, 0x02, 0x1e, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, - 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_accounting_grpc_types_proto_rawDescOnce sync.Once - file_accounting_grpc_types_proto_rawDescData = file_accounting_grpc_types_proto_rawDesc -) - -func file_accounting_grpc_types_proto_rawDescGZIP() []byte { - file_accounting_grpc_types_proto_rawDescOnce.Do(func() { - file_accounting_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_accounting_grpc_types_proto_rawDescData) - }) - return file_accounting_grpc_types_proto_rawDescData -} - -var file_accounting_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_accounting_grpc_types_proto_goTypes = []interface{}{ - (*Decimal)(nil), // 0: neo.fs.v2.accounting.Decimal -} -var file_accounting_grpc_types_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_accounting_grpc_types_proto_init() } -func file_accounting_grpc_types_proto_init() { - if File_accounting_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_accounting_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Decimal); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_accounting_grpc_types_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_accounting_grpc_types_proto_goTypes, - DependencyIndexes: file_accounting_grpc_types_proto_depIdxs, - MessageInfos: file_accounting_grpc_types_proto_msgTypes, - }.Build() - File_accounting_grpc_types_proto = out.File - file_accounting_grpc_types_proto_rawDesc = nil - file_accounting_grpc_types_proto_goTypes = nil - file_accounting_grpc_types_proto_depIdxs = nil -} diff --git a/accounting/grpc/types_frostfs.pb.go b/accounting/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..182705e --- /dev/null +++ b/accounting/grpc/types_frostfs.pb.go @@ -0,0 +1,174 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package accounting + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type Decimal struct { + Value int64 `json:"value"` + Precision uint32 `json:"precision"` +} + +var ( + _ encoding.ProtoMarshaler = (*Decimal)(nil) + _ encoding.ProtoUnmarshaler = (*Decimal)(nil) + _ json.Marshaler = (*Decimal)(nil) + _ json.Unmarshaler = (*Decimal)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Decimal) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.Int64Size(1, x.Value) + size += proto.UInt32Size(2, x.Precision) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Decimal) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Decimal) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Value != 0 { + mm.AppendInt64(1, x.Value) + } + if x.Precision != 0 { + mm.AppendUint32(2, x.Precision) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Decimal) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Decimal") + } + switch fc.FieldNum { + case 1: // Value + data, ok := fc.Int64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + case 2: // Precision + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Precision") + } + x.Precision = data + } + } + return nil +} +func (x *Decimal) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} +func (x *Decimal) SetValue(v int64) { + x.Value = v +} +func (x *Decimal) GetPrecision() uint32 { + if x != nil { + return x.Precision + } + return 0 +} +func (x *Decimal) SetPrecision(v uint32) { + x.Precision = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Decimal) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"value\":" + out.RawString(prefix[1:]) + out.Int64(x.Value) + } + { + const prefix string = ",\"precision\":" + out.RawString(prefix) + out.Uint32(x.Precision) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Decimal) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Decimal) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "value": + { + var f int64 + f = in.Int64() + x.Value = f + } + case "precision": + { + var f uint32 + f = in.Uint32() + x.Precision = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/accounting/grpc/types_frostfs_fuzz.go b/accounting/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..5eb5e97 --- /dev/null +++ b/accounting/grpc/types_frostfs_fuzz.go @@ -0,0 +1,26 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package accounting + +func DoFuzzProtoDecimal(data []byte) int { + msg := new(Decimal) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONDecimal(data []byte) int { + msg := new(Decimal) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/accounting/grpc/types_frostfs_test.go b/accounting/grpc/types_frostfs_test.go new file mode 100644 index 0000000..404b75e --- /dev/null +++ b/accounting/grpc/types_frostfs_test.go @@ -0,0 +1,21 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package accounting + +import ( + testing "testing" +) + +func FuzzProtoDecimal(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoDecimal(data) + }) +} +func FuzzJSONDecimal(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONDecimal(data) + }) +} diff --git a/acl/convert.go b/acl/convert.go index 0cf455c..c5768ad 100644 --- a/acl/convert.go +++ b/acl/convert.go @@ -478,7 +478,7 @@ func (bt *BearerTokenBody) ToGRPCMessage() grpc.Message { m.SetLifetime(bt.lifetime.ToGRPCMessage().(*acl.BearerToken_Body_TokenLifetime)) m.SetEaclTable(bt.eacl.ToGRPCMessage().(*acl.EACLTable)) m.SetAllowImpersonate(bt.impersonate) - m.SetAPEOverride(bt.apeOverride.ToGRPCMessage().(*acl.BearerToken_Body_APEOverride)) + m.SetApeOverride(bt.apeOverride.ToGRPCMessage().(*acl.BearerToken_Body_APEOverride)) } return m diff --git a/acl/grpc/types.go b/acl/grpc/types.go deleted file mode 100644 index fbcbb91..0000000 --- a/acl/grpc/types.go +++ /dev/null @@ -1,193 +0,0 @@ -package acl - -import ( - ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" -) - -// SetVersion sets version of EACL rules in table. -func (m *EACLTable) SetVersion(v *refs.Version) { - m.Version = v -} - -// SetContainerId sets container identifier of the eACL table. -func (m *EACLTable) SetContainerId(v *refs.ContainerID) { - m.ContainerId = v -} - -// SetRecords sets record list of the eACL table. -func (m *EACLTable) SetRecords(v []*EACLRecord) { - m.Records = v -} - -// SetOperation sets operation of the eACL record. -func (m *EACLRecord) SetOperation(v Operation) { - m.Operation = v -} - -// SetAction sets action of the eACL record. -func (m *EACLRecord) SetAction(v Action) { - m.Action = v -} - -// SetFilters sets filter list of the eACL record. -func (m *EACLRecord) SetFilters(v []*EACLRecord_Filter) { - m.Filters = v -} - -// SetTargets sets target list of the eACL record. -func (m *EACLRecord) SetTargets(v []*EACLRecord_Target) { - m.Targets = v -} - -// SetHeaderType sets header type of the eACL filter. -func (m *EACLRecord_Filter) SetHeaderType(v HeaderType) { - m.HeaderType = v -} - -// SetMatchType sets match type of the eACL filter. -func (m *EACLRecord_Filter) SetMatchType(v MatchType) { - m.MatchType = v -} - -// SetKey sets key of the eACL filter. -func (m *EACLRecord_Filter) SetKey(v string) { - m.Key = v -} - -// SetValue sets value of the eACL filter. -func (m *EACLRecord_Filter) SetValue(v string) { - m.Value = v -} - -// SetRole sets target group of the eACL target. -func (m *EACLRecord_Target) SetRole(v Role) { - m.Role = v -} - -// SetKeys of the eACL target. -func (m *EACLRecord_Target) SetKeys(v [][]byte) { - m.Keys = v -} - -// SetEaclTable sets eACL table of the bearer token. -func (m *BearerToken_Body) SetEaclTable(v *EACLTable) { - m.EaclTable = v -} - -func (m *BearerToken_Body) SetAPEOverride(v *BearerToken_Body_APEOverride) { - m.ApeOverride = v -} - -func (m *BearerToken_Body_APEOverride) SetChains(v []*ape.Chain) { - m.Chains = v -} - -func (m *BearerToken_Body_APEOverride) SetTarget(v *ape.ChainTarget) { - m.Target = v -} - -// SetOwnerId sets identifier of the bearer token owner. -func (m *BearerToken_Body) SetOwnerId(v *refs.OwnerID) { - m.OwnerId = v -} - -// SetLifetime sets lifetime of the bearer token. -func (m *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) { - m.Lifetime = v -} - -// SetAllowImpersonate allows impersonate. -func (m *BearerToken_Body) SetAllowImpersonate(v bool) { - m.AllowImpersonate = v -} - -// SetBody sets bearer token body. -func (m *BearerToken) SetBody(v *BearerToken_Body) { - m.Body = v -} - -// SetSignature sets bearer token signature. -func (m *BearerToken) SetSignature(v *refs.Signature) { - m.Signature = v -} - -// SetExp sets epoch number of the token expiration. -func (m *BearerToken_Body_TokenLifetime) SetExp(v uint64) { - m.Exp = v -} - -// SetNbf sets starting epoch number of the token. -func (m *BearerToken_Body_TokenLifetime) SetNbf(v uint64) { - m.Nbf = v -} - -// SetIat sets the number of the epoch in which the token was issued. -func (m *BearerToken_Body_TokenLifetime) SetIat(v uint64) { - m.Iat = v -} - -// FromString parses Action from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *Action) FromString(s string) bool { - i, ok := Action_value[s] - if ok { - *x = Action(i) - } - - return ok -} - -// FromString parses Role from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *Role) FromString(s string) bool { - i, ok := Role_value[s] - if ok { - *x = Role(i) - } - - return ok -} - -// FromString parses Operation from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *Operation) FromString(s string) bool { - i, ok := Operation_value[s] - if ok { - *x = Operation(i) - } - - return ok -} - -// FromString parses MatchType from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *MatchType) FromString(s string) bool { - i, ok := MatchType_value[s] - if ok { - *x = MatchType(i) - } - - return ok -} - -// FromString parses HeaderType from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *HeaderType) FromString(s string) bool { - i, ok := HeaderType_value[s] - if ok { - *x = HeaderType(i) - } - - return ok -} diff --git a/acl/grpc/types.pb.go b/acl/grpc/types.pb.go deleted file mode 100644 index 39ab1e1..0000000 --- a/acl/grpc/types.pb.go +++ /dev/null @@ -1,1231 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: acl/grpc/types.proto - -package acl - -import ( - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Target role of the access control rule in access control list. -type Role int32 - -const ( - // Unspecified role, default value - Role_ROLE_UNSPECIFIED Role = 0 - // User target rule is applied if sender is the owner of the container - Role_USER Role = 1 - // System target rule is applied if sender is a storage node within the - // container or an inner ring node - Role_SYSTEM Role = 2 - // Others target rule is applied if sender is neither a user nor a system - // target - Role_OTHERS Role = 3 -) - -// Enum value maps for Role. -var ( - Role_name = map[int32]string{ - 0: "ROLE_UNSPECIFIED", - 1: "USER", - 2: "SYSTEM", - 3: "OTHERS", - } - Role_value = map[string]int32{ - "ROLE_UNSPECIFIED": 0, - "USER": 1, - "SYSTEM": 2, - "OTHERS": 3, - } -) - -func (x Role) Enum() *Role { - p := new(Role) - *p = x - return p -} - -func (x Role) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Role) Descriptor() protoreflect.EnumDescriptor { - return file_acl_grpc_types_proto_enumTypes[0].Descriptor() -} - -func (Role) Type() protoreflect.EnumType { - return &file_acl_grpc_types_proto_enumTypes[0] -} - -func (x Role) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Role.Descriptor instead. -func (Role) EnumDescriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{0} -} - -// MatchType is an enumeration of match types. -type MatchType int32 - -const ( - // Unspecified match type, default value. - MatchType_MATCH_TYPE_UNSPECIFIED MatchType = 0 - // Return true if strings are equal - MatchType_STRING_EQUAL MatchType = 1 - // Return true if strings are different - MatchType_STRING_NOT_EQUAL MatchType = 2 -) - -// Enum value maps for MatchType. -var ( - MatchType_name = map[int32]string{ - 0: "MATCH_TYPE_UNSPECIFIED", - 1: "STRING_EQUAL", - 2: "STRING_NOT_EQUAL", - } - MatchType_value = map[string]int32{ - "MATCH_TYPE_UNSPECIFIED": 0, - "STRING_EQUAL": 1, - "STRING_NOT_EQUAL": 2, - } -) - -func (x MatchType) Enum() *MatchType { - p := new(MatchType) - *p = x - return p -} - -func (x MatchType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MatchType) Descriptor() protoreflect.EnumDescriptor { - return file_acl_grpc_types_proto_enumTypes[1].Descriptor() -} - -func (MatchType) Type() protoreflect.EnumType { - return &file_acl_grpc_types_proto_enumTypes[1] -} - -func (x MatchType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MatchType.Descriptor instead. -func (MatchType) EnumDescriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{1} -} - -// Request's operation type to match if the rule is applicable to a particular -// request. -type Operation int32 - -const ( - // Unspecified operation, default value - Operation_OPERATION_UNSPECIFIED Operation = 0 - // Get - Operation_GET Operation = 1 - // Head - Operation_HEAD Operation = 2 - // Put - Operation_PUT Operation = 3 - // Delete - Operation_DELETE Operation = 4 - // Search - Operation_SEARCH Operation = 5 - // GetRange - Operation_GETRANGE Operation = 6 - // GetRangeHash - Operation_GETRANGEHASH Operation = 7 -) - -// Enum value maps for Operation. -var ( - Operation_name = map[int32]string{ - 0: "OPERATION_UNSPECIFIED", - 1: "GET", - 2: "HEAD", - 3: "PUT", - 4: "DELETE", - 5: "SEARCH", - 6: "GETRANGE", - 7: "GETRANGEHASH", - } - Operation_value = map[string]int32{ - "OPERATION_UNSPECIFIED": 0, - "GET": 1, - "HEAD": 2, - "PUT": 3, - "DELETE": 4, - "SEARCH": 5, - "GETRANGE": 6, - "GETRANGEHASH": 7, - } -) - -func (x Operation) Enum() *Operation { - p := new(Operation) - *p = x - return p -} - -func (x Operation) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Operation) Descriptor() protoreflect.EnumDescriptor { - return file_acl_grpc_types_proto_enumTypes[2].Descriptor() -} - -func (Operation) Type() protoreflect.EnumType { - return &file_acl_grpc_types_proto_enumTypes[2] -} - -func (x Operation) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Operation.Descriptor instead. -func (Operation) EnumDescriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{2} -} - -// Rule execution result action. Either allows or denies access if the rule's -// filters match. -type Action int32 - -const ( - // Unspecified action, default value - Action_ACTION_UNSPECIFIED Action = 0 - // Allow action - Action_ALLOW Action = 1 - // Deny action - Action_DENY Action = 2 -) - -// Enum value maps for Action. -var ( - Action_name = map[int32]string{ - 0: "ACTION_UNSPECIFIED", - 1: "ALLOW", - 2: "DENY", - } - Action_value = map[string]int32{ - "ACTION_UNSPECIFIED": 0, - "ALLOW": 1, - "DENY": 2, - } -) - -func (x Action) Enum() *Action { - p := new(Action) - *p = x - return p -} - -func (x Action) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Action) Descriptor() protoreflect.EnumDescriptor { - return file_acl_grpc_types_proto_enumTypes[3].Descriptor() -} - -func (Action) Type() protoreflect.EnumType { - return &file_acl_grpc_types_proto_enumTypes[3] -} - -func (x Action) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Action.Descriptor instead. -func (Action) EnumDescriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{3} -} - -// Enumeration of possible sources of Headers to apply filters. -type HeaderType int32 - -const ( - // Unspecified header, default value. - HeaderType_HEADER_UNSPECIFIED HeaderType = 0 - // Filter request headers - HeaderType_REQUEST HeaderType = 1 - // Filter object headers - HeaderType_OBJECT HeaderType = 2 - // Filter service headers. These are not processed by NeoFS nodes and - // exist for service use only. - HeaderType_SERVICE HeaderType = 3 -) - -// Enum value maps for HeaderType. -var ( - HeaderType_name = map[int32]string{ - 0: "HEADER_UNSPECIFIED", - 1: "REQUEST", - 2: "OBJECT", - 3: "SERVICE", - } - HeaderType_value = map[string]int32{ - "HEADER_UNSPECIFIED": 0, - "REQUEST": 1, - "OBJECT": 2, - "SERVICE": 3, - } -) - -func (x HeaderType) Enum() *HeaderType { - p := new(HeaderType) - *p = x - return p -} - -func (x HeaderType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (HeaderType) Descriptor() protoreflect.EnumDescriptor { - return file_acl_grpc_types_proto_enumTypes[4].Descriptor() -} - -func (HeaderType) Type() protoreflect.EnumType { - return &file_acl_grpc_types_proto_enumTypes[4] -} - -func (x HeaderType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use HeaderType.Descriptor instead. -func (HeaderType) EnumDescriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{4} -} - -// Describes a single eACL rule. -type EACLRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // NeoFS request Verb to match - Operation Operation `protobuf:"varint,1,opt,name=operation,proto3,enum=neo.fs.v2.acl.Operation" json:"operation,omitempty"` - // Rule execution result. Either allows or denies access if filters match. - Action Action `protobuf:"varint,2,opt,name=action,proto3,enum=neo.fs.v2.acl.Action" json:"action,omitempty"` - // List of filters to match and see if rule is applicable - Filters []*EACLRecord_Filter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"` - // List of target subjects to apply ACL rule to - Targets []*EACLRecord_Target `protobuf:"bytes,4,rep,name=targets,proto3" json:"targets,omitempty"` -} - -func (x *EACLRecord) Reset() { - *x = EACLRecord{} - if protoimpl.UnsafeEnabled { - mi := &file_acl_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EACLRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EACLRecord) ProtoMessage() {} - -func (x *EACLRecord) ProtoReflect() protoreflect.Message { - mi := &file_acl_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EACLRecord.ProtoReflect.Descriptor instead. -func (*EACLRecord) Descriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *EACLRecord) GetOperation() Operation { - if x != nil { - return x.Operation - } - return Operation_OPERATION_UNSPECIFIED -} - -func (x *EACLRecord) GetAction() Action { - if x != nil { - return x.Action - } - return Action_ACTION_UNSPECIFIED -} - -func (x *EACLRecord) GetFilters() []*EACLRecord_Filter { - if x != nil { - return x.Filters - } - return nil -} - -func (x *EACLRecord) GetTargets() []*EACLRecord_Target { - if x != nil { - return x.Targets - } - return nil -} - -// Extended ACL rules table. A list of ACL rules defined additionally to Basic -// ACL. Extended ACL rules can be attached to a container and can be updated -// or may be defined in `BearerToken` structure. Please see the corresponding -// NeoFS Technical Specification section for detailed description. -type EACLTable struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // eACL format version. Effectively, the version of API library used to create - // eACL Table. - Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Identifier of the container that should use given access control rules - ContainerId *grpc.ContainerID `protobuf:"bytes,2,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"` - // List of Extended ACL rules - Records []*EACLRecord `protobuf:"bytes,3,rep,name=records,proto3" json:"records,omitempty"` -} - -func (x *EACLTable) Reset() { - *x = EACLTable{} - if protoimpl.UnsafeEnabled { - mi := &file_acl_grpc_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EACLTable) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EACLTable) ProtoMessage() {} - -func (x *EACLTable) ProtoReflect() protoreflect.Message { - mi := &file_acl_grpc_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EACLTable.ProtoReflect.Descriptor instead. -func (*EACLTable) Descriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{1} -} - -func (x *EACLTable) GetVersion() *grpc.Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *EACLTable) GetContainerId() *grpc.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -func (x *EACLTable) GetRecords() []*EACLRecord { - if x != nil { - return x.Records - } - return nil -} - -// BearerToken allows to attach signed Extended ACL rules to the request in -// `RequestMetaHeader`. If container's Basic ACL rules allow, the attached rule -// set will be checked instead of one attached to the container itself. Just -// like [JWT](https://jwt.io), it has a limited lifetime and scope, hence can be -// used in the similar use cases, like providing authorisation to externally -// authenticated party. -// -// BearerToken can be issued only by the container's owner and must be signed -// using the key associated with the container's `OwnerID`. -type BearerToken struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Bearer Token body - Body *BearerToken_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Signature of BearerToken body - Signature *grpc.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *BearerToken) Reset() { - *x = BearerToken{} - if protoimpl.UnsafeEnabled { - mi := &file_acl_grpc_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BearerToken) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BearerToken) ProtoMessage() {} - -func (x *BearerToken) ProtoReflect() protoreflect.Message { - mi := &file_acl_grpc_types_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BearerToken.ProtoReflect.Descriptor instead. -func (*BearerToken) Descriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{2} -} - -func (x *BearerToken) GetBody() *BearerToken_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *BearerToken) GetSignature() *grpc.Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Filter to check particular properties of the request or the object. -// -// By default `key` field refers to the corresponding object's `Attribute`. -// Some Object's header fields can also be accessed by adding `$Object:` -// prefix to the name. Here is the list of fields available via this prefix: -// -// - $Object:version \ -// version -// - $Object:objectID \ -// object_id -// - $Object:containerID \ -// container_id -// - $Object:ownerID \ -// owner_id -// - $Object:creationEpoch \ -// creation_epoch -// - $Object:payloadLength \ -// payload_length -// - $Object:payloadHash \ -// payload_hash -// - $Object:objectType \ -// object_type -// - $Object:homomorphicHash \ -// homomorphic_hash -// -// Please note, that if request or response does not have object's headers of -// full object (Range, RangeHash, Search, Delete), it will not be possible to -// filter by object header fields or user attributes. From the well-known list -// only `$Object:objectID` and `$Object:containerID` will be available, as -// it's possible to take that information from the requested address. -type EACLRecord_Filter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Define if Object or Request header will be used - HeaderType HeaderType `protobuf:"varint,1,opt,name=header_type,json=headerType,proto3,enum=neo.fs.v2.acl.HeaderType" json:"header_type,omitempty"` - // Match operation type - MatchType MatchType `protobuf:"varint,2,opt,name=match_type,json=matchType,proto3,enum=neo.fs.v2.acl.MatchType" json:"match_type,omitempty"` - // Name of the Header to use - Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - // Expected Header Value or pattern to match - Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *EACLRecord_Filter) Reset() { - *x = EACLRecord_Filter{} - if protoimpl.UnsafeEnabled { - mi := &file_acl_grpc_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EACLRecord_Filter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EACLRecord_Filter) ProtoMessage() {} - -func (x *EACLRecord_Filter) ProtoReflect() protoreflect.Message { - mi := &file_acl_grpc_types_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EACLRecord_Filter.ProtoReflect.Descriptor instead. -func (*EACLRecord_Filter) Descriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *EACLRecord_Filter) GetHeaderType() HeaderType { - if x != nil { - return x.HeaderType - } - return HeaderType_HEADER_UNSPECIFIED -} - -func (x *EACLRecord_Filter) GetMatchType() MatchType { - if x != nil { - return x.MatchType - } - return MatchType_MATCH_TYPE_UNSPECIFIED -} - -func (x *EACLRecord_Filter) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *EACLRecord_Filter) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// Target to apply ACL rule. Can be a subject's role class or a list of public -// keys to match. -type EACLRecord_Target struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Target subject's role class - Role Role `protobuf:"varint,1,opt,name=role,proto3,enum=neo.fs.v2.acl.Role" json:"role,omitempty"` - // List of public keys to identify target subject - Keys [][]byte `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` -} - -func (x *EACLRecord_Target) Reset() { - *x = EACLRecord_Target{} - if protoimpl.UnsafeEnabled { - mi := &file_acl_grpc_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EACLRecord_Target) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EACLRecord_Target) ProtoMessage() {} - -func (x *EACLRecord_Target) ProtoReflect() protoreflect.Message { - mi := &file_acl_grpc_types_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EACLRecord_Target.ProtoReflect.Descriptor instead. -func (*EACLRecord_Target) Descriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *EACLRecord_Target) GetRole() Role { - if x != nil { - return x.Role - } - return Role_ROLE_UNSPECIFIED -} - -func (x *EACLRecord_Target) GetKeys() [][]byte { - if x != nil { - return x.Keys - } - return nil -} - -// Bearer Token body structure contains Extended ACL table issued by the -// container owner with additional information preventing token abuse. -type BearerToken_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Table of Extended ACL rules to use instead of the ones attached to the - // container. If it contains `container_id` field, bearer token is only - // valid for this specific container. Otherwise, any container of the same - // owner is allowed. - // - // Deprecated: eACL tables are no longer relevant - `APEOverrides` should be - // used instead. - EaclTable *EACLTable `protobuf:"bytes,1,opt,name=eacl_table,json=eaclTable,proto3" json:"eacl_table,omitempty"` - // `OwnerID` defines to whom the token was issued. It must match the request - // originator's `OwnerID`. If empty, any token bearer will be accepted. - OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` - // Token expiration and valid time period parameters - Lifetime *BearerToken_Body_TokenLifetime `protobuf:"bytes,3,opt,name=lifetime,proto3" json:"lifetime,omitempty"` - // AllowImpersonate flag to consider token signer as request owner. - // If this field is true extended ACL table in token body isn't processed. - AllowImpersonate bool `protobuf:"varint,4,opt,name=allow_impersonate,json=allowImpersonate,proto3" json:"allow_impersonate,omitempty"` - // APE override for the target. - ApeOverride *BearerToken_Body_APEOverride `protobuf:"bytes,5,opt,name=ape_override,json=apeOverride,proto3" json:"ape_override,omitempty"` -} - -func (x *BearerToken_Body) Reset() { - *x = BearerToken_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_acl_grpc_types_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BearerToken_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BearerToken_Body) ProtoMessage() {} - -func (x *BearerToken_Body) ProtoReflect() protoreflect.Message { - mi := &file_acl_grpc_types_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BearerToken_Body.ProtoReflect.Descriptor instead. -func (*BearerToken_Body) Descriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *BearerToken_Body) GetEaclTable() *EACLTable { - if x != nil { - return x.EaclTable - } - return nil -} - -func (x *BearerToken_Body) GetOwnerId() *grpc.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} - -func (x *BearerToken_Body) GetLifetime() *BearerToken_Body_TokenLifetime { - if x != nil { - return x.Lifetime - } - return nil -} - -func (x *BearerToken_Body) GetAllowImpersonate() bool { - if x != nil { - return x.AllowImpersonate - } - return false -} - -func (x *BearerToken_Body) GetApeOverride() *BearerToken_Body_APEOverride { - if x != nil { - return x.ApeOverride - } - return nil -} - -// Lifetime parameters of the token. Field names taken from -// [rfc7519](https://tools.ietf.org/html/rfc7519). -type BearerToken_Body_TokenLifetime struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Expiration Epoch - Exp uint64 `protobuf:"varint,1,opt,name=exp,proto3" json:"exp,omitempty"` - // Not valid before Epoch - Nbf uint64 `protobuf:"varint,2,opt,name=nbf,proto3" json:"nbf,omitempty"` - // Issued at Epoch - Iat uint64 `protobuf:"varint,3,opt,name=iat,proto3" json:"iat,omitempty"` -} - -func (x *BearerToken_Body_TokenLifetime) Reset() { - *x = BearerToken_Body_TokenLifetime{} - if protoimpl.UnsafeEnabled { - mi := &file_acl_grpc_types_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BearerToken_Body_TokenLifetime) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BearerToken_Body_TokenLifetime) ProtoMessage() {} - -func (x *BearerToken_Body_TokenLifetime) ProtoReflect() protoreflect.Message { - mi := &file_acl_grpc_types_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BearerToken_Body_TokenLifetime.ProtoReflect.Descriptor instead. -func (*BearerToken_Body_TokenLifetime) Descriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{2, 0, 0} -} - -func (x *BearerToken_Body_TokenLifetime) GetExp() uint64 { - if x != nil { - return x.Exp - } - return 0 -} - -func (x *BearerToken_Body_TokenLifetime) GetNbf() uint64 { - if x != nil { - return x.Nbf - } - return 0 -} - -func (x *BearerToken_Body_TokenLifetime) GetIat() uint64 { - if x != nil { - return x.Iat - } - return 0 -} - -// APEOverride is the list of APE chains defined for a target. -// These chains are meant to serve as overrides to the already defined (or -// even undefined) APE chains for the target (see contract `Policy`). -// -// The server-side processing of the bearer token with set APE overrides -// must verify if a client is permitted to override chains for the target, -// preventing unauthorized access through the APE mechanism. -type BearerToken_Body_APEOverride struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Target for which chains are applied. - Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - // The list of APE chains. - Chains []*grpc1.Chain `protobuf:"bytes,2,rep,name=chains,proto3" json:"chains,omitempty"` -} - -func (x *BearerToken_Body_APEOverride) Reset() { - *x = BearerToken_Body_APEOverride{} - if protoimpl.UnsafeEnabled { - mi := &file_acl_grpc_types_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BearerToken_Body_APEOverride) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BearerToken_Body_APEOverride) ProtoMessage() {} - -func (x *BearerToken_Body_APEOverride) ProtoReflect() protoreflect.Message { - mi := &file_acl_grpc_types_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BearerToken_Body_APEOverride.ProtoReflect.Descriptor instead. -func (*BearerToken_Body_APEOverride) Descriptor() ([]byte, []int) { - return file_acl_grpc_types_proto_rawDescGZIP(), []int{2, 0, 1} -} - -func (x *BearerToken_Body_APEOverride) GetTarget() *grpc1.ChainTarget { - if x != nil { - return x.Target - } - return nil -} - -func (x *BearerToken_Body_APEOverride) GetChains() []*grpc1.Chain { - if x != nil { - return x.Chains - } - return nil -} - -var File_acl_grpc_types_proto protoreflect.FileDescriptor - -var file_acl_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x61, 0x70, - 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xda, 0x03, 0x0a, 0x0a, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x12, 0x36, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x06, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, - 0x1a, 0xa5, 0x01, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0b, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, - 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x45, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x12, 0x27, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x13, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, - 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, - 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, - 0xb3, 0x01, 0x0a, 0x09, 0x45, 0x41, 0x43, 0x4c, 0x54, 0x61, 0x62, 0x6c, 0x65, 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, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, - 0x12, 0x33, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, - 0x6c, 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0xf3, 0x04, 0x0a, 0x0b, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x33, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, - 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x1a, 0xf5, 0x03, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x37, 0x0a, 0x0a, - 0x65, 0x61, 0x63, 0x6c, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, - 0x2e, 0x45, 0x41, 0x43, 0x4c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x09, 0x65, 0x61, 0x63, 0x6c, - 0x54, 0x61, 0x62, 0x6c, 0x65, 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, 0x49, 0x0a, 0x08, 0x6c, 0x69, 0x66, - 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, - 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, - 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x6d, - 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x49, 0x6d, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x74, - 0x65, 0x12, 0x4e, 0x0a, 0x0c, 0x61, 0x70, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x41, 0x50, 0x45, 0x4f, 0x76, 0x65, 0x72, - 0x72, 0x69, 0x64, 0x65, 0x52, 0x0b, 0x61, 0x70, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, - 0x65, 0x1a, 0x45, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, - 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x62, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x03, 0x6e, 0x62, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x61, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x03, 0x69, 0x61, 0x74, 0x1a, 0x71, 0x0a, 0x0b, 0x41, 0x50, 0x45, 0x4f, - 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2d, 0x0a, 0x06, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x66, - 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x2e, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x52, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2a, 0x3e, 0x0a, 0x04, 0x52, - 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, - 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x02, 0x12, - 0x0a, 0x0a, 0x06, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x53, 0x10, 0x03, 0x2a, 0x4f, 0x0a, 0x09, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, - 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, - 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, - 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x2a, 0x7a, 0x0a, 0x09, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, - 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, - 0x04, 0x48, 0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x03, - 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, - 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x47, 0x45, 0x54, 0x52, - 0x41, 0x4e, 0x47, 0x45, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x45, 0x54, 0x52, 0x41, 0x4e, - 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, 0x10, 0x07, 0x2a, 0x35, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, - 0x4c, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x4e, 0x59, 0x10, 0x02, 0x2a, - 0x4a, 0x0a, 0x0a, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, - 0x12, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, - 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, 0x12, 0x0b, - 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x03, 0x42, 0x58, 0x5a, 0x3c, 0x67, - 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, - 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, - 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x61, - 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x63, 0x6c, 0xaa, 0x02, 0x17, 0x4e, 0x65, - 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, - 0x49, 0x2e, 0x41, 0x63, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_acl_grpc_types_proto_rawDescOnce sync.Once - file_acl_grpc_types_proto_rawDescData = file_acl_grpc_types_proto_rawDesc -) - -func file_acl_grpc_types_proto_rawDescGZIP() []byte { - file_acl_grpc_types_proto_rawDescOnce.Do(func() { - file_acl_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_acl_grpc_types_proto_rawDescData) - }) - return file_acl_grpc_types_proto_rawDescData -} - -var file_acl_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_acl_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_acl_grpc_types_proto_goTypes = []interface{}{ - (Role)(0), // 0: neo.fs.v2.acl.Role - (MatchType)(0), // 1: neo.fs.v2.acl.MatchType - (Operation)(0), // 2: neo.fs.v2.acl.Operation - (Action)(0), // 3: neo.fs.v2.acl.Action - (HeaderType)(0), // 4: neo.fs.v2.acl.HeaderType - (*EACLRecord)(nil), // 5: neo.fs.v2.acl.EACLRecord - (*EACLTable)(nil), // 6: neo.fs.v2.acl.EACLTable - (*BearerToken)(nil), // 7: neo.fs.v2.acl.BearerToken - (*EACLRecord_Filter)(nil), // 8: neo.fs.v2.acl.EACLRecord.Filter - (*EACLRecord_Target)(nil), // 9: neo.fs.v2.acl.EACLRecord.Target - (*BearerToken_Body)(nil), // 10: neo.fs.v2.acl.BearerToken.Body - (*BearerToken_Body_TokenLifetime)(nil), // 11: neo.fs.v2.acl.BearerToken.Body.TokenLifetime - (*BearerToken_Body_APEOverride)(nil), // 12: neo.fs.v2.acl.BearerToken.Body.APEOverride - (*grpc.Version)(nil), // 13: neo.fs.v2.refs.Version - (*grpc.ContainerID)(nil), // 14: neo.fs.v2.refs.ContainerID - (*grpc.Signature)(nil), // 15: neo.fs.v2.refs.Signature - (*grpc.OwnerID)(nil), // 16: neo.fs.v2.refs.OwnerID - (*grpc1.ChainTarget)(nil), // 17: frostfs.v2.ape.ChainTarget - (*grpc1.Chain)(nil), // 18: frostfs.v2.ape.Chain -} -var file_acl_grpc_types_proto_depIdxs = []int32{ - 2, // 0: neo.fs.v2.acl.EACLRecord.operation:type_name -> neo.fs.v2.acl.Operation - 3, // 1: neo.fs.v2.acl.EACLRecord.action:type_name -> neo.fs.v2.acl.Action - 8, // 2: neo.fs.v2.acl.EACLRecord.filters:type_name -> neo.fs.v2.acl.EACLRecord.Filter - 9, // 3: neo.fs.v2.acl.EACLRecord.targets:type_name -> neo.fs.v2.acl.EACLRecord.Target - 13, // 4: neo.fs.v2.acl.EACLTable.version:type_name -> neo.fs.v2.refs.Version - 14, // 5: neo.fs.v2.acl.EACLTable.container_id:type_name -> neo.fs.v2.refs.ContainerID - 5, // 6: neo.fs.v2.acl.EACLTable.records:type_name -> neo.fs.v2.acl.EACLRecord - 10, // 7: neo.fs.v2.acl.BearerToken.body:type_name -> neo.fs.v2.acl.BearerToken.Body - 15, // 8: neo.fs.v2.acl.BearerToken.signature:type_name -> neo.fs.v2.refs.Signature - 4, // 9: neo.fs.v2.acl.EACLRecord.Filter.header_type:type_name -> neo.fs.v2.acl.HeaderType - 1, // 10: neo.fs.v2.acl.EACLRecord.Filter.match_type:type_name -> neo.fs.v2.acl.MatchType - 0, // 11: neo.fs.v2.acl.EACLRecord.Target.role:type_name -> neo.fs.v2.acl.Role - 6, // 12: neo.fs.v2.acl.BearerToken.Body.eacl_table:type_name -> neo.fs.v2.acl.EACLTable - 16, // 13: neo.fs.v2.acl.BearerToken.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID - 11, // 14: neo.fs.v2.acl.BearerToken.Body.lifetime:type_name -> neo.fs.v2.acl.BearerToken.Body.TokenLifetime - 12, // 15: neo.fs.v2.acl.BearerToken.Body.ape_override:type_name -> neo.fs.v2.acl.BearerToken.Body.APEOverride - 17, // 16: neo.fs.v2.acl.BearerToken.Body.APEOverride.target:type_name -> frostfs.v2.ape.ChainTarget - 18, // 17: neo.fs.v2.acl.BearerToken.Body.APEOverride.chains:type_name -> frostfs.v2.ape.Chain - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name -} - -func init() { file_acl_grpc_types_proto_init() } -func file_acl_grpc_types_proto_init() { - if File_acl_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_acl_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EACLRecord); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_acl_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EACLTable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_acl_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BearerToken); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_acl_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EACLRecord_Filter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_acl_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EACLRecord_Target); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_acl_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BearerToken_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_acl_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BearerToken_Body_TokenLifetime); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_acl_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BearerToken_Body_APEOverride); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_acl_grpc_types_proto_rawDesc, - NumEnums: 5, - NumMessages: 8, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_acl_grpc_types_proto_goTypes, - DependencyIndexes: file_acl_grpc_types_proto_depIdxs, - EnumInfos: file_acl_grpc_types_proto_enumTypes, - MessageInfos: file_acl_grpc_types_proto_msgTypes, - }.Build() - File_acl_grpc_types_proto = out.File - file_acl_grpc_types_proto_rawDesc = nil - file_acl_grpc_types_proto_goTypes = nil - file_acl_grpc_types_proto_depIdxs = nil -} diff --git a/acl/grpc/types_frostfs.pb.go b/acl/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..e542a19 --- /dev/null +++ b/acl/grpc/types_frostfs.pb.go @@ -0,0 +1,1994 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package acl + +import ( + json "encoding/json" + fmt "fmt" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type Role int32 + +const ( + Role_ROLE_UNSPECIFIED Role = 0 + Role_USER Role = 1 + Role_SYSTEM Role = 2 + Role_OTHERS Role = 3 +) + +var ( + Role_name = map[int32]string{ + 0: "ROLE_UNSPECIFIED", + 1: "USER", + 2: "SYSTEM", + 3: "OTHERS", + } + Role_value = map[string]int32{ + "ROLE_UNSPECIFIED": 0, + "USER": 1, + "SYSTEM": 2, + "OTHERS": 3, + } +) + +func (x Role) String() string { + if v, ok := Role_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Role) FromString(s string) bool { + if v, ok := Role_value[s]; ok { + *x = Role(v) + return true + } + return false +} + +type MatchType int32 + +const ( + MatchType_MATCH_TYPE_UNSPECIFIED MatchType = 0 + MatchType_STRING_EQUAL MatchType = 1 + MatchType_STRING_NOT_EQUAL MatchType = 2 +) + +var ( + MatchType_name = map[int32]string{ + 0: "MATCH_TYPE_UNSPECIFIED", + 1: "STRING_EQUAL", + 2: "STRING_NOT_EQUAL", + } + MatchType_value = map[string]int32{ + "MATCH_TYPE_UNSPECIFIED": 0, + "STRING_EQUAL": 1, + "STRING_NOT_EQUAL": 2, + } +) + +func (x MatchType) String() string { + if v, ok := MatchType_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *MatchType) FromString(s string) bool { + if v, ok := MatchType_value[s]; ok { + *x = MatchType(v) + return true + } + return false +} + +type Operation int32 + +const ( + Operation_OPERATION_UNSPECIFIED Operation = 0 + Operation_GET Operation = 1 + Operation_HEAD Operation = 2 + Operation_PUT Operation = 3 + Operation_DELETE Operation = 4 + Operation_SEARCH Operation = 5 + Operation_GETRANGE Operation = 6 + Operation_GETRANGEHASH Operation = 7 +) + +var ( + Operation_name = map[int32]string{ + 0: "OPERATION_UNSPECIFIED", + 1: "GET", + 2: "HEAD", + 3: "PUT", + 4: "DELETE", + 5: "SEARCH", + 6: "GETRANGE", + 7: "GETRANGEHASH", + } + Operation_value = map[string]int32{ + "OPERATION_UNSPECIFIED": 0, + "GET": 1, + "HEAD": 2, + "PUT": 3, + "DELETE": 4, + "SEARCH": 5, + "GETRANGE": 6, + "GETRANGEHASH": 7, + } +) + +func (x Operation) String() string { + if v, ok := Operation_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Operation) FromString(s string) bool { + if v, ok := Operation_value[s]; ok { + *x = Operation(v) + return true + } + return false +} + +type Action int32 + +const ( + Action_ACTION_UNSPECIFIED Action = 0 + Action_ALLOW Action = 1 + Action_DENY Action = 2 +) + +var ( + Action_name = map[int32]string{ + 0: "ACTION_UNSPECIFIED", + 1: "ALLOW", + 2: "DENY", + } + Action_value = map[string]int32{ + "ACTION_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2, + } +) + +func (x Action) String() string { + if v, ok := Action_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Action) FromString(s string) bool { + if v, ok := Action_value[s]; ok { + *x = Action(v) + return true + } + return false +} + +type HeaderType int32 + +const ( + HeaderType_HEADER_UNSPECIFIED HeaderType = 0 + HeaderType_REQUEST HeaderType = 1 + HeaderType_OBJECT HeaderType = 2 + HeaderType_SERVICE HeaderType = 3 +) + +var ( + HeaderType_name = map[int32]string{ + 0: "HEADER_UNSPECIFIED", + 1: "REQUEST", + 2: "OBJECT", + 3: "SERVICE", + } + HeaderType_value = map[string]int32{ + "HEADER_UNSPECIFIED": 0, + "REQUEST": 1, + "OBJECT": 2, + "SERVICE": 3, + } +) + +func (x HeaderType) String() string { + if v, ok := HeaderType_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *HeaderType) FromString(s string) bool { + if v, ok := HeaderType_value[s]; ok { + *x = HeaderType(v) + return true + } + return false +} + +type EACLRecord_Filter struct { + HeaderType HeaderType `json:"headerType"` + MatchType MatchType `json:"matchType"` + Key string `json:"key"` + Value string `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*EACLRecord_Filter)(nil) + _ encoding.ProtoUnmarshaler = (*EACLRecord_Filter)(nil) + _ json.Marshaler = (*EACLRecord_Filter)(nil) + _ json.Unmarshaler = (*EACLRecord_Filter)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *EACLRecord_Filter) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.HeaderType)) + size += proto.EnumSize(2, int32(x.MatchType)) + size += proto.StringSize(3, x.Key) + size += proto.StringSize(4, x.Value) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *EACLRecord_Filter) 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 *EACLRecord_Filter) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.HeaderType) != 0 { + mm.AppendInt32(1, int32(x.HeaderType)) + } + if int32(x.MatchType) != 0 { + mm.AppendInt32(2, int32(x.MatchType)) + } + if len(x.Key) != 0 { + mm.AppendString(3, x.Key) + } + if len(x.Value) != 0 { + mm.AppendString(4, x.Value) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *EACLRecord_Filter) 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", "EACLRecord_Filter") + } + switch fc.FieldNum { + case 1: // HeaderType + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "HeaderType") + } + x.HeaderType = HeaderType(data) + case 2: // MatchType + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MatchType") + } + x.MatchType = MatchType(data) + case 3: // Key + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Key") + } + x.Key = data + case 4: // Value + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + } + } + return nil +} +func (x *EACLRecord_Filter) GetHeaderType() HeaderType { + if x != nil { + return x.HeaderType + } + return 0 +} +func (x *EACLRecord_Filter) SetHeaderType(v HeaderType) { + x.HeaderType = v +} +func (x *EACLRecord_Filter) GetMatchType() MatchType { + if x != nil { + return x.MatchType + } + return 0 +} +func (x *EACLRecord_Filter) SetMatchType(v MatchType) { + x.MatchType = v +} +func (x *EACLRecord_Filter) GetKey() string { + if x != nil { + return x.Key + } + return "" +} +func (x *EACLRecord_Filter) SetKey(v string) { + x.Key = v +} +func (x *EACLRecord_Filter) GetValue() string { + if x != nil { + return x.Value + } + return "" +} +func (x *EACLRecord_Filter) SetValue(v string) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *EACLRecord_Filter) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"headerType\":" + out.RawString(prefix[1:]) + out.Int32(int32(x.HeaderType)) + } + { + const prefix string = ",\"matchType\":" + out.RawString(prefix) + out.Int32(int32(x.MatchType)) + } + { + const prefix string = ",\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + { + const prefix string = ",\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *EACLRecord_Filter) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *EACLRecord_Filter) 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 "headerType": + { + var f HeaderType + var parsedValue HeaderType + switch v := in.Interface().(type) { + case string: + if vv, ok := HeaderType_value[v]; ok { + parsedValue = HeaderType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = HeaderType(vv) + case float64: + parsedValue = HeaderType(v) + } + f = parsedValue + x.HeaderType = f + } + case "matchType": + { + var f MatchType + var parsedValue MatchType + switch v := in.Interface().(type) { + case string: + if vv, ok := MatchType_value[v]; ok { + parsedValue = MatchType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = MatchType(vv) + case float64: + parsedValue = MatchType(v) + } + f = parsedValue + x.MatchType = f + } + 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 EACLRecord_Target struct { + Role Role `json:"role"` + Keys [][]byte `json:"keys"` +} + +var ( + _ encoding.ProtoMarshaler = (*EACLRecord_Target)(nil) + _ encoding.ProtoUnmarshaler = (*EACLRecord_Target)(nil) + _ json.Marshaler = (*EACLRecord_Target)(nil) + _ json.Unmarshaler = (*EACLRecord_Target)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *EACLRecord_Target) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.Role)) + size += proto.RepeatedBytesSize(2, x.Keys) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *EACLRecord_Target) 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 *EACLRecord_Target) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.Role) != 0 { + mm.AppendInt32(1, int32(x.Role)) + } + for j := range x.Keys { + mm.AppendBytes(2, x.Keys[j]) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *EACLRecord_Target) 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", "EACLRecord_Target") + } + switch fc.FieldNum { + case 1: // Role + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Role") + } + x.Role = Role(data) + case 2: // Keys + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Keys") + } + x.Keys = append(x.Keys, data) + } + } + return nil +} +func (x *EACLRecord_Target) GetRole() Role { + if x != nil { + return x.Role + } + return 0 +} +func (x *EACLRecord_Target) SetRole(v Role) { + x.Role = v +} +func (x *EACLRecord_Target) GetKeys() [][]byte { + if x != nil { + return x.Keys + } + return nil +} +func (x *EACLRecord_Target) SetKeys(v [][]byte) { + x.Keys = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *EACLRecord_Target) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *EACLRecord_Target) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"role\":" + out.RawString(prefix[1:]) + out.Int32(int32(x.Role)) + } + { + const prefix string = ",\"keys\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Keys { + if i != 0 { + out.RawByte(',') + } + out.Base64Bytes(x.Keys[i]) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *EACLRecord_Target) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *EACLRecord_Target) 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 "role": + { + var f Role + var parsedValue Role + switch v := in.Interface().(type) { + case string: + if vv, ok := Role_value[v]; ok { + parsedValue = Role(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = Role(vv) + case float64: + parsedValue = Role(v) + } + f = parsedValue + x.Role = f + } + case "keys": + { + var f []byte + var list [][]byte + in.Delim('[') + for !in.IsDelim(']') { + f = in.Bytes() + list = append(list, f) + in.WantComma() + } + x.Keys = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type EACLRecord struct { + Operation Operation `json:"operation"` + Action Action `json:"action"` + Filters []*EACLRecord_Filter `json:"filters"` + Targets []*EACLRecord_Target `json:"targets"` +} + +var ( + _ encoding.ProtoMarshaler = (*EACLRecord)(nil) + _ encoding.ProtoUnmarshaler = (*EACLRecord)(nil) + _ json.Marshaler = (*EACLRecord)(nil) + _ json.Unmarshaler = (*EACLRecord)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *EACLRecord) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.Operation)) + size += proto.EnumSize(2, int32(x.Action)) + for i := range x.Filters { + size += proto.NestedStructureSize(3, x.Filters[i]) + } + for i := range x.Targets { + size += proto.NestedStructureSize(4, x.Targets[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *EACLRecord) 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 *EACLRecord) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.Operation) != 0 { + mm.AppendInt32(1, int32(x.Operation)) + } + if int32(x.Action) != 0 { + mm.AppendInt32(2, int32(x.Action)) + } + for i := range x.Filters { + if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 { + x.Filters[i].EmitProtobuf(mm.AppendMessage(3)) + } + } + for i := range x.Targets { + if x.Targets[i] != nil && x.Targets[i].StableSize() != 0 { + x.Targets[i].EmitProtobuf(mm.AppendMessage(4)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *EACLRecord) 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", "EACLRecord") + } + switch fc.FieldNum { + case 1: // Operation + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Operation") + } + x.Operation = Operation(data) + case 2: // Action + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Action") + } + x.Action = Action(data) + case 3: // Filters + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Filters") + } + x.Filters = append(x.Filters, new(EACLRecord_Filter)) + ff := x.Filters[len(x.Filters)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 4: // Targets + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Targets") + } + x.Targets = append(x.Targets, new(EACLRecord_Target)) + ff := x.Targets[len(x.Targets)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *EACLRecord) GetOperation() Operation { + if x != nil { + return x.Operation + } + return 0 +} +func (x *EACLRecord) SetOperation(v Operation) { + x.Operation = v +} +func (x *EACLRecord) GetAction() Action { + if x != nil { + return x.Action + } + return 0 +} +func (x *EACLRecord) SetAction(v Action) { + x.Action = v +} +func (x *EACLRecord) GetFilters() []*EACLRecord_Filter { + if x != nil { + return x.Filters + } + return nil +} +func (x *EACLRecord) SetFilters(v []*EACLRecord_Filter) { + x.Filters = v +} +func (x *EACLRecord) GetTargets() []*EACLRecord_Target { + if x != nil { + return x.Targets + } + return nil +} +func (x *EACLRecord) SetTargets(v []*EACLRecord_Target) { + x.Targets = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *EACLRecord) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"operation\":" + out.RawString(prefix[1:]) + out.Int32(int32(x.Operation)) + } + { + const prefix string = ",\"action\":" + out.RawString(prefix) + out.Int32(int32(x.Action)) + } + { + const prefix string = ",\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"targets\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Targets { + if i != 0 { + out.RawByte(',') + } + x.Targets[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *EACLRecord) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *EACLRecord) 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 "operation": + { + var f Operation + var parsedValue Operation + switch v := in.Interface().(type) { + case string: + if vv, ok := Operation_value[v]; ok { + parsedValue = Operation(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = Operation(vv) + case float64: + parsedValue = Operation(v) + } + f = parsedValue + x.Operation = f + } + case "action": + { + var f Action + var parsedValue Action + switch v := in.Interface().(type) { + case string: + if vv, ok := Action_value[v]; ok { + parsedValue = Action(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = Action(vv) + case float64: + parsedValue = Action(v) + } + f = parsedValue + x.Action = f + } + case "filters": + { + var f *EACLRecord_Filter + var list []*EACLRecord_Filter + in.Delim('[') + for !in.IsDelim(']') { + f = new(EACLRecord_Filter) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Filters = list + in.Delim(']') + } + case "targets": + { + var f *EACLRecord_Target + var list []*EACLRecord_Target + in.Delim('[') + for !in.IsDelim(']') { + f = new(EACLRecord_Target) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Targets = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type EACLTable struct { + Version *grpc.Version `json:"version"` + ContainerId *grpc.ContainerID `json:"containerID"` + Records []*EACLRecord `json:"records"` +} + +var ( + _ encoding.ProtoMarshaler = (*EACLTable)(nil) + _ encoding.ProtoUnmarshaler = (*EACLTable)(nil) + _ json.Marshaler = (*EACLTable)(nil) + _ json.Unmarshaler = (*EACLTable)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *EACLTable) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Version) + size += proto.NestedStructureSize(2, x.ContainerId) + for i := range x.Records { + size += proto.NestedStructureSize(3, x.Records[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *EACLTable) 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 *EACLTable) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Version != nil && x.Version.StableSize() != 0 { + x.Version.EmitProtobuf(mm.AppendMessage(1)) + } + if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + x.ContainerId.EmitProtobuf(mm.AppendMessage(2)) + } + for i := range x.Records { + if x.Records[i] != nil && x.Records[i].StableSize() != 0 { + x.Records[i].EmitProtobuf(mm.AppendMessage(3)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *EACLTable) 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", "EACLTable") + } + 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: // ContainerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerId") + } + x.ContainerId = new(grpc.ContainerID) + if err := x.ContainerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // Records + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Records") + } + x.Records = append(x.Records, new(EACLRecord)) + ff := x.Records[len(x.Records)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *EACLTable) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} +func (x *EACLTable) SetVersion(v *grpc.Version) { + x.Version = v +} +func (x *EACLTable) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} +func (x *EACLTable) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} +func (x *EACLTable) GetRecords() []*EACLRecord { + if x != nil { + return x.Records + } + return nil +} +func (x *EACLTable) SetRecords(v []*EACLRecord) { + x.Records = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *EACLTable) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *EACLTable) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"version\":" + out.RawString(prefix[1:]) + x.Version.MarshalEasyJSON(out) + } + { + const prefix string = ",\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"records\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Records { + if i != 0 { + out.RawByte(',') + } + x.Records[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *EACLTable) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *EACLTable) 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 "containerID": + { + var f *grpc.ContainerID + f = new(grpc.ContainerID) + f.UnmarshalEasyJSON(in) + x.ContainerId = f + } + case "records": + { + var f *EACLRecord + var list []*EACLRecord + in.Delim('[') + for !in.IsDelim(']') { + f = new(EACLRecord) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Records = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type BearerToken_Body_TokenLifetime struct { + Exp uint64 `json:"exp"` + Nbf uint64 `json:"nbf"` + Iat uint64 `json:"iat"` +} + +var ( + _ encoding.ProtoMarshaler = (*BearerToken_Body_TokenLifetime)(nil) + _ encoding.ProtoUnmarshaler = (*BearerToken_Body_TokenLifetime)(nil) + _ json.Marshaler = (*BearerToken_Body_TokenLifetime)(nil) + _ json.Unmarshaler = (*BearerToken_Body_TokenLifetime)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BearerToken_Body_TokenLifetime) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt64Size(1, x.Exp) + size += proto.UInt64Size(2, x.Nbf) + size += proto.UInt64Size(3, x.Iat) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BearerToken_Body_TokenLifetime) 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 *BearerToken_Body_TokenLifetime) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Exp != 0 { + mm.AppendUint64(1, x.Exp) + } + if x.Nbf != 0 { + mm.AppendUint64(2, x.Nbf) + } + if x.Iat != 0 { + mm.AppendUint64(3, x.Iat) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BearerToken_Body_TokenLifetime) 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", "BearerToken_Body_TokenLifetime") + } + switch fc.FieldNum { + case 1: // Exp + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Exp") + } + x.Exp = data + case 2: // Nbf + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Nbf") + } + x.Nbf = data + case 3: // Iat + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Iat") + } + x.Iat = data + } + } + return nil +} +func (x *BearerToken_Body_TokenLifetime) GetExp() uint64 { + if x != nil { + return x.Exp + } + return 0 +} +func (x *BearerToken_Body_TokenLifetime) SetExp(v uint64) { + x.Exp = v +} +func (x *BearerToken_Body_TokenLifetime) GetNbf() uint64 { + if x != nil { + return x.Nbf + } + return 0 +} +func (x *BearerToken_Body_TokenLifetime) SetNbf(v uint64) { + x.Nbf = v +} +func (x *BearerToken_Body_TokenLifetime) GetIat() uint64 { + if x != nil { + return x.Iat + } + return 0 +} +func (x *BearerToken_Body_TokenLifetime) SetIat(v uint64) { + x.Iat = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BearerToken_Body_TokenLifetime) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"exp\":" + out.RawString(prefix[1:]) + out.Uint64(x.Exp) + } + { + const prefix string = ",\"nbf\":" + out.RawString(prefix) + out.Uint64(x.Nbf) + } + { + const prefix string = ",\"iat\":" + out.RawString(prefix) + out.Uint64(x.Iat) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BearerToken_Body_TokenLifetime) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BearerToken_Body_TokenLifetime) 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 "exp": + { + var f uint64 + f = in.Uint64() + x.Exp = f + } + case "nbf": + { + var f uint64 + f = in.Uint64() + x.Nbf = f + } + case "iat": + { + var f uint64 + f = in.Uint64() + x.Iat = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type BearerToken_Body_APEOverride struct { + Target *grpc1.ChainTarget `json:"target"` + Chains []*grpc1.Chain `json:"chains"` +} + +var ( + _ encoding.ProtoMarshaler = (*BearerToken_Body_APEOverride)(nil) + _ encoding.ProtoUnmarshaler = (*BearerToken_Body_APEOverride)(nil) + _ json.Marshaler = (*BearerToken_Body_APEOverride)(nil) + _ json.Unmarshaler = (*BearerToken_Body_APEOverride)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BearerToken_Body_APEOverride) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Target) + for i := range x.Chains { + size += proto.NestedStructureSize(2, x.Chains[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BearerToken_Body_APEOverride) 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 *BearerToken_Body_APEOverride) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Target != nil && x.Target.StableSize() != 0 { + x.Target.EmitProtobuf(mm.AppendMessage(1)) + } + for i := range x.Chains { + if x.Chains[i] != nil && x.Chains[i].StableSize() != 0 { + x.Chains[i].EmitProtobuf(mm.AppendMessage(2)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BearerToken_Body_APEOverride) 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", "BearerToken_Body_APEOverride") + } + switch fc.FieldNum { + case 1: // Target + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Target") + } + x.Target = new(grpc1.ChainTarget) + if err := x.Target.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Chains + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Chains") + } + x.Chains = append(x.Chains, new(grpc1.Chain)) + ff := x.Chains[len(x.Chains)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BearerToken_Body_APEOverride) GetTarget() *grpc1.ChainTarget { + if x != nil { + return x.Target + } + return nil +} +func (x *BearerToken_Body_APEOverride) SetTarget(v *grpc1.ChainTarget) { + x.Target = v +} +func (x *BearerToken_Body_APEOverride) GetChains() []*grpc1.Chain { + if x != nil { + return x.Chains + } + return nil +} +func (x *BearerToken_Body_APEOverride) SetChains(v []*grpc1.Chain) { + x.Chains = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BearerToken_Body_APEOverride) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BearerToken_Body_APEOverride) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"target\":" + out.RawString(prefix[1:]) + x.Target.MarshalEasyJSON(out) + } + { + const prefix string = ",\"chains\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Chains { + if i != 0 { + out.RawByte(',') + } + x.Chains[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BearerToken_Body_APEOverride) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BearerToken_Body_APEOverride) 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 "target": + { + var f *grpc1.ChainTarget + f = new(grpc1.ChainTarget) + f.UnmarshalEasyJSON(in) + x.Target = f + } + case "chains": + { + var f *grpc1.Chain + var list []*grpc1.Chain + in.Delim('[') + for !in.IsDelim(']') { + f = new(grpc1.Chain) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Chains = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type BearerToken_Body struct { + EaclTable *EACLTable `json:"eaclTable"` + OwnerId *grpc.OwnerID `json:"ownerID"` + Lifetime *BearerToken_Body_TokenLifetime `json:"lifetime"` + AllowImpersonate bool `json:"allowImpersonate"` + ApeOverride *BearerToken_Body_APEOverride `json:"apeOverride"` +} + +var ( + _ encoding.ProtoMarshaler = (*BearerToken_Body)(nil) + _ encoding.ProtoUnmarshaler = (*BearerToken_Body)(nil) + _ json.Marshaler = (*BearerToken_Body)(nil) + _ json.Unmarshaler = (*BearerToken_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BearerToken_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.EaclTable) + size += proto.NestedStructureSize(2, x.OwnerId) + size += proto.NestedStructureSize(3, x.Lifetime) + size += proto.BoolSize(4, x.AllowImpersonate) + size += proto.NestedStructureSize(5, x.ApeOverride) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BearerToken_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 *BearerToken_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.EaclTable != nil && x.EaclTable.StableSize() != 0 { + x.EaclTable.EmitProtobuf(mm.AppendMessage(1)) + } + if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + x.OwnerId.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Lifetime != nil && x.Lifetime.StableSize() != 0 { + x.Lifetime.EmitProtobuf(mm.AppendMessage(3)) + } + if x.AllowImpersonate { + mm.AppendBool(4, x.AllowImpersonate) + } + if x.ApeOverride != nil && x.ApeOverride.StableSize() != 0 { + x.ApeOverride.EmitProtobuf(mm.AppendMessage(5)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BearerToken_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", "BearerToken_Body") + } + switch fc.FieldNum { + case 1: // EaclTable + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "EaclTable") + } + x.EaclTable = new(EACLTable) + if err := x.EaclTable.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: // Lifetime + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Lifetime") + } + x.Lifetime = new(BearerToken_Body_TokenLifetime) + if err := x.Lifetime.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 4: // AllowImpersonate + data, ok := fc.Bool() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "AllowImpersonate") + } + x.AllowImpersonate = data + case 5: // ApeOverride + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ApeOverride") + } + x.ApeOverride = new(BearerToken_Body_APEOverride) + if err := x.ApeOverride.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BearerToken_Body) GetEaclTable() *EACLTable { + if x != nil { + return x.EaclTable + } + return nil +} +func (x *BearerToken_Body) SetEaclTable(v *EACLTable) { + x.EaclTable = v +} +func (x *BearerToken_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *BearerToken_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} +func (x *BearerToken_Body) GetLifetime() *BearerToken_Body_TokenLifetime { + if x != nil { + return x.Lifetime + } + return nil +} +func (x *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) { + x.Lifetime = v +} +func (x *BearerToken_Body) GetAllowImpersonate() bool { + if x != nil { + return x.AllowImpersonate + } + return false +} +func (x *BearerToken_Body) SetAllowImpersonate(v bool) { + x.AllowImpersonate = v +} +func (x *BearerToken_Body) GetApeOverride() *BearerToken_Body_APEOverride { + if x != nil { + return x.ApeOverride + } + return nil +} +func (x *BearerToken_Body) SetApeOverride(v *BearerToken_Body_APEOverride) { + x.ApeOverride = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BearerToken_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"eaclTable\":" + out.RawString(prefix[1:]) + x.EaclTable.MarshalEasyJSON(out) + } + { + const prefix string = ",\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"lifetime\":" + out.RawString(prefix) + x.Lifetime.MarshalEasyJSON(out) + } + { + const prefix string = ",\"allowImpersonate\":" + out.RawString(prefix) + out.Bool(x.AllowImpersonate) + } + { + const prefix string = ",\"apeOverride\":" + out.RawString(prefix) + x.ApeOverride.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BearerToken_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BearerToken_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 "eaclTable": + { + var f *EACLTable + f = new(EACLTable) + f.UnmarshalEasyJSON(in) + x.EaclTable = f + } + case "ownerID": + { + var f *grpc.OwnerID + f = new(grpc.OwnerID) + f.UnmarshalEasyJSON(in) + x.OwnerId = f + } + case "lifetime": + { + var f *BearerToken_Body_TokenLifetime + f = new(BearerToken_Body_TokenLifetime) + f.UnmarshalEasyJSON(in) + x.Lifetime = f + } + case "allowImpersonate": + { + var f bool + f = in.Bool() + x.AllowImpersonate = f + } + case "apeOverride": + { + var f *BearerToken_Body_APEOverride + f = new(BearerToken_Body_APEOverride) + f.UnmarshalEasyJSON(in) + x.ApeOverride = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type BearerToken struct { + Body *BearerToken_Body `json:"body"` + Signature *grpc.Signature `json:"signature"` +} + +var ( + _ encoding.ProtoMarshaler = (*BearerToken)(nil) + _ encoding.ProtoUnmarshaler = (*BearerToken)(nil) + _ json.Marshaler = (*BearerToken)(nil) + _ json.Unmarshaler = (*BearerToken)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *BearerToken) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *BearerToken) 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 *BearerToken) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil && x.Signature.StableSize() != 0 { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *BearerToken) 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", "BearerToken") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(BearerToken_Body) + if err := x.Body.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Signature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Signature") + } + x.Signature = new(grpc.Signature) + if err := x.Signature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *BearerToken) GetBody() *BearerToken_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *BearerToken) SetBody(v *BearerToken_Body) { + x.Body = v +} +func (x *BearerToken) GetSignature() *grpc.Signature { + if x != nil { + return x.Signature + } + return nil +} +func (x *BearerToken) SetSignature(v *grpc.Signature) { + x.Signature = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *BearerToken) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *BearerToken) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *BearerToken) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *BearerToken) 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 *BearerToken_Body + f = new(BearerToken_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "signature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.Signature = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/acl/grpc/types_frostfs_fuzz.go b/acl/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..5d5b763 --- /dev/null +++ b/acl/grpc/types_frostfs_fuzz.go @@ -0,0 +1,64 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package acl + +func DoFuzzProtoEACLRecord(data []byte) int { + msg := new(EACLRecord) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONEACLRecord(data []byte) int { + msg := new(EACLRecord) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoEACLTable(data []byte) int { + msg := new(EACLTable) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONEACLTable(data []byte) int { + msg := new(EACLTable) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoBearerToken(data []byte) int { + msg := new(BearerToken) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONBearerToken(data []byte) int { + msg := new(BearerToken) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/acl/grpc/types_frostfs_test.go b/acl/grpc/types_frostfs_test.go new file mode 100644 index 0000000..c6d1c43 --- /dev/null +++ b/acl/grpc/types_frostfs_test.go @@ -0,0 +1,41 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package acl + +import ( + testing "testing" +) + +func FuzzProtoEACLRecord(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoEACLRecord(data) + }) +} +func FuzzJSONEACLRecord(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONEACLRecord(data) + }) +} +func FuzzProtoEACLTable(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoEACLTable(data) + }) +} +func FuzzJSONEACLTable(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONEACLTable(data) + }) +} +func FuzzProtoBearerToken(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoBearerToken(data) + }) +} +func FuzzJSONBearerToken(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONBearerToken(data) + }) +} diff --git a/ape/grpc/types.go b/ape/grpc/types.go deleted file mode 100644 index 931b6a3..0000000 --- a/ape/grpc/types.go +++ /dev/null @@ -1,21 +0,0 @@ -package ape - -func (t *ChainTarget) SetType(typ TargetType) { - t.Type = typ -} - -func (t *ChainTarget) SetName(name string) { - t.Name = name -} - -func (c *Chain) SetKind(kind isChain_Kind) { - c.Kind = kind -} - -func (cr *Chain_Raw) SetRaw(raw []byte) { - cr.Raw = raw -} - -func (cr *Chain_Raw) GetRaw() []byte { - return cr.Raw -} diff --git a/ape/grpc/types.pb.go b/ape/grpc/types.pb.go deleted file mode 100644 index ee8e0a7..0000000 --- a/ape/grpc/types.pb.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: ape/grpc/types.proto - -package ape - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// TargetType is a type target to which a rule chain is defined. -type TargetType int32 - -const ( - TargetType_UNDEFINED TargetType = 0 - TargetType_NAMESPACE TargetType = 1 - TargetType_CONTAINER TargetType = 2 - TargetType_USER TargetType = 3 - TargetType_GROUP TargetType = 4 -) - -// Enum value maps for TargetType. -var ( - TargetType_name = map[int32]string{ - 0: "UNDEFINED", - 1: "NAMESPACE", - 2: "CONTAINER", - 3: "USER", - 4: "GROUP", - } - TargetType_value = map[string]int32{ - "UNDEFINED": 0, - "NAMESPACE": 1, - "CONTAINER": 2, - "USER": 3, - "GROUP": 4, - } -) - -func (x TargetType) Enum() *TargetType { - p := new(TargetType) - *p = x - return p -} - -func (x TargetType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TargetType) Descriptor() protoreflect.EnumDescriptor { - return file_ape_grpc_types_proto_enumTypes[0].Descriptor() -} - -func (TargetType) Type() protoreflect.EnumType { - return &file_ape_grpc_types_proto_enumTypes[0] -} - -func (x TargetType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TargetType.Descriptor instead. -func (TargetType) EnumDescriptor() ([]byte, []int) { - return file_ape_grpc_types_proto_rawDescGZIP(), []int{0} -} - -// ChainTarget is an object to which a rule chain is defined. -type ChainTarget struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type TargetType `protobuf:"varint,1,opt,name=type,proto3,enum=frostfs.v2.ape.TargetType" json:"type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *ChainTarget) Reset() { - *x = ChainTarget{} - if protoimpl.UnsafeEnabled { - mi := &file_ape_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChainTarget) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChainTarget) ProtoMessage() {} - -func (x *ChainTarget) ProtoReflect() protoreflect.Message { - mi := &file_ape_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChainTarget.ProtoReflect.Descriptor instead. -func (*ChainTarget) Descriptor() ([]byte, []int) { - return file_ape_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *ChainTarget) GetType() TargetType { - if x != nil { - return x.Type - } - return TargetType_UNDEFINED -} - -func (x *ChainTarget) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Chain is a chain of rules defined for a specific target. -type Chain struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Kind: - // - // *Chain_Raw - Kind isChain_Kind `protobuf_oneof:"kind"` -} - -func (x *Chain) Reset() { - *x = Chain{} - if protoimpl.UnsafeEnabled { - mi := &file_ape_grpc_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Chain) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Chain) ProtoMessage() {} - -func (x *Chain) ProtoReflect() protoreflect.Message { - mi := &file_ape_grpc_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Chain.ProtoReflect.Descriptor instead. -func (*Chain) Descriptor() ([]byte, []int) { - return file_ape_grpc_types_proto_rawDescGZIP(), []int{1} -} - -func (m *Chain) GetKind() isChain_Kind { - if m != nil { - return m.Kind - } - return nil -} - -func (x *Chain) GetRaw() []byte { - if x, ok := x.GetKind().(*Chain_Raw); ok { - return x.Raw - } - return nil -} - -type isChain_Kind interface { - isChain_Kind() -} - -type Chain_Raw struct { - // Raw representation of a serizalized rule chain. - Raw []byte `protobuf:"bytes,1,opt,name=raw,proto3,oneof"` -} - -func (*Chain_Raw) isChain_Kind() {} - -var File_ape_grpc_types_proto protoreflect.FileDescriptor - -var file_ape_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x22, 0x51, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x61, 0x70, 0x65, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x23, 0x0a, 0x05, 0x43, 0x68, 0x61, - 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, - 0x00, 0x52, 0x03, 0x72, 0x61, 0x77, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x2a, 0x4e, - 0x0a, 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, - 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4e, - 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, - 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, - 0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x04, 0x42, 0x3e, - 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, - 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, - 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, - 0x32, 0x2f, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x61, 0x70, 0x65, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_ape_grpc_types_proto_rawDescOnce sync.Once - file_ape_grpc_types_proto_rawDescData = file_ape_grpc_types_proto_rawDesc -) - -func file_ape_grpc_types_proto_rawDescGZIP() []byte { - file_ape_grpc_types_proto_rawDescOnce.Do(func() { - file_ape_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_ape_grpc_types_proto_rawDescData) - }) - return file_ape_grpc_types_proto_rawDescData -} - -var file_ape_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_ape_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_ape_grpc_types_proto_goTypes = []interface{}{ - (TargetType)(0), // 0: frostfs.v2.ape.TargetType - (*ChainTarget)(nil), // 1: frostfs.v2.ape.ChainTarget - (*Chain)(nil), // 2: frostfs.v2.ape.Chain -} -var file_ape_grpc_types_proto_depIdxs = []int32{ - 0, // 0: frostfs.v2.ape.ChainTarget.type:type_name -> frostfs.v2.ape.TargetType - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_ape_grpc_types_proto_init() } -func file_ape_grpc_types_proto_init() { - if File_ape_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_ape_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChainTarget); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ape_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Chain); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_ape_grpc_types_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*Chain_Raw)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_ape_grpc_types_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_ape_grpc_types_proto_goTypes, - DependencyIndexes: file_ape_grpc_types_proto_depIdxs, - EnumInfos: file_ape_grpc_types_proto_enumTypes, - MessageInfos: file_ape_grpc_types_proto_msgTypes, - }.Build() - File_ape_grpc_types_proto = out.File - file_ape_grpc_types_proto_rawDesc = nil - file_ape_grpc_types_proto_goTypes = nil - file_ape_grpc_types_proto_depIdxs = nil -} diff --git a/ape/grpc/types_frostfs.pb.go b/ape/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..1e92f22 --- /dev/null +++ b/ape/grpc/types_frostfs.pb.go @@ -0,0 +1,400 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package ape + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type TargetType int32 + +const ( + TargetType_UNDEFINED TargetType = 0 + TargetType_NAMESPACE TargetType = 1 + TargetType_CONTAINER TargetType = 2 + TargetType_USER TargetType = 3 + TargetType_GROUP TargetType = 4 +) + +var ( + TargetType_name = map[int32]string{ + 0: "UNDEFINED", + 1: "NAMESPACE", + 2: "CONTAINER", + 3: "USER", + 4: "GROUP", + } + TargetType_value = map[string]int32{ + "UNDEFINED": 0, + "NAMESPACE": 1, + "CONTAINER": 2, + "USER": 3, + "GROUP": 4, + } +) + +func (x TargetType) String() string { + if v, ok := TargetType_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *TargetType) FromString(s string) bool { + if v, ok := TargetType_value[s]; ok { + *x = TargetType(v) + return true + } + return false +} + +type ChainTarget struct { + Type TargetType `json:"type"` + Name string `json:"name"` +} + +var ( + _ encoding.ProtoMarshaler = (*ChainTarget)(nil) + _ encoding.ProtoUnmarshaler = (*ChainTarget)(nil) + _ json.Marshaler = (*ChainTarget)(nil) + _ json.Unmarshaler = (*ChainTarget)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ChainTarget) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.Type)) + size += proto.StringSize(2, x.Name) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ChainTarget) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *ChainTarget) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.Type) != 0 { + mm.AppendInt32(1, int32(x.Type)) + } + if len(x.Name) != 0 { + mm.AppendString(2, x.Name) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ChainTarget) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "ChainTarget") + } + switch fc.FieldNum { + case 1: // Type + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Type") + } + x.Type = TargetType(data) + case 2: // Name + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Name") + } + x.Name = data + } + } + return nil +} +func (x *ChainTarget) GetType() TargetType { + if x != nil { + return x.Type + } + return 0 +} +func (x *ChainTarget) SetType(v TargetType) { + x.Type = v +} +func (x *ChainTarget) GetName() string { + if x != nil { + return x.Name + } + return "" +} +func (x *ChainTarget) SetName(v string) { + x.Name = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ChainTarget) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"type\":" + out.RawString(prefix[1:]) + out.Int32(int32(x.Type)) + } + { + const prefix string = ",\"name\":" + out.RawString(prefix) + out.String(x.Name) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ChainTarget) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ChainTarget) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "type": + { + var f TargetType + var parsedValue TargetType + switch v := in.Interface().(type) { + case string: + if vv, ok := TargetType_value[v]; ok { + parsedValue = TargetType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = TargetType(vv) + case float64: + parsedValue = TargetType(v) + } + f = parsedValue + x.Type = f + } + case "name": + { + var f string + f = in.String() + x.Name = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Chain struct { + Kind isChain_Kind +} + +var ( + _ encoding.ProtoMarshaler = (*Chain)(nil) + _ encoding.ProtoUnmarshaler = (*Chain)(nil) + _ json.Marshaler = (*Chain)(nil) + _ json.Unmarshaler = (*Chain)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Chain) StableSize() (size int) { + if x == nil { + return 0 + } + if inner, ok := x.Kind.(*Chain_Raw); ok { + size += proto.BytesSize(1, inner.Raw) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Chain) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Chain) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if inner, ok := x.Kind.(*Chain_Raw); ok { + if len(inner.Raw) != 0 { + mm.AppendBytes(1, inner.Raw) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Chain) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Chain") + } + switch fc.FieldNum { + case 1: // Raw + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Raw") + } + x.Kind = &Chain_Raw{Raw: data} + } + } + return nil +} +func (x *Chain) GetKind() isChain_Kind { + if x != nil { + return x.Kind + } + return nil +} +func (x *Chain) SetKind(v isChain_Kind) { + x.Kind = v +} +func (x *Chain) GetRaw() *Chain_Raw { + if xx, ok := x.GetKind().(*Chain_Raw); ok { + return xx + } + return nil +} +func (x *Chain) SetRaw(v *Chain_Raw) { + x.Kind = v +} +func (x *Chain_Raw) GetRaw() []byte { + if x != nil { + return x.Raw + } + return nil +} +func (x *Chain_Raw) SetRaw(v []byte) { + x.Raw = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Chain) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + switch xx := x.Kind.(type) { + case *Chain_Raw: + { + const prefix string = ",\"raw\":" + out.RawString(prefix[1:]) + out.Base64Bytes(xx.Raw) + } + default: + out.RawString("null") + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Chain) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Chain) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "raw": + xx := new(Chain_Raw) + x.Kind = xx + { + var f []byte + f = in.Bytes() + xx.Raw = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type isChain_Kind interface { + isChain_Kind() +} + +type Chain_Raw struct { + Raw []byte +} + +func (*Chain_Raw) isChain_Kind() {} diff --git a/ape/grpc/types_frostfs_fuzz.go b/ape/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..b7bf367 --- /dev/null +++ b/ape/grpc/types_frostfs_fuzz.go @@ -0,0 +1,45 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package ape + +func DoFuzzProtoChainTarget(data []byte) int { + msg := new(ChainTarget) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONChainTarget(data []byte) int { + msg := new(ChainTarget) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoChain(data []byte) int { + msg := new(Chain) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONChain(data []byte) int { + msg := new(Chain) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/ape/grpc/types_frostfs_test.go b/ape/grpc/types_frostfs_test.go new file mode 100644 index 0000000..93d7eea --- /dev/null +++ b/ape/grpc/types_frostfs_test.go @@ -0,0 +1,31 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package ape + +import ( + testing "testing" +) + +func FuzzProtoChainTarget(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoChainTarget(data) + }) +} +func FuzzJSONChainTarget(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONChainTarget(data) + }) +} +func FuzzProtoChain(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoChain(data) + }) +} +func FuzzJSONChain(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONChain(data) + }) +} diff --git a/apemanager/grpc/service.go b/apemanager/grpc/service.go deleted file mode 100644 index bd77db0..0000000 --- a/apemanager/grpc/service.go +++ /dev/null @@ -1,106 +0,0 @@ -package apemanager - -import ( - ape "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" - session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" -) - -func (rb *AddChainRequest_Body) SetTarget(t *ape.ChainTarget) { - rb.Target = t -} - -func (rb *AddChainRequest_Body) SetChain(chain *ape.Chain) { - rb.Chain = chain -} - -func (r *AddChainRequest) SetBody(rb *AddChainRequest_Body) { - r.Body = rb -} - -func (r *AddChainRequest) SetMetaHeader(mh *session.RequestMetaHeader) { - r.MetaHeader = mh -} - -func (r *AddChainRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) { - r.VerifyHeader = vh -} - -func (rb *AddChainResponse_Body) SetChainId(chainID []byte) { - rb.ChainId = chainID -} - -func (r *AddChainResponse) SetBody(rb *AddChainResponse_Body) { - r.Body = rb -} - -func (r *AddChainResponse) SetMetaHeader(mh *session.ResponseMetaHeader) { - r.MetaHeader = mh -} - -func (r *AddChainResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) { - r.VerifyHeader = vh -} - -func (rb *RemoveChainRequest_Body) SetTarget(t *ape.ChainTarget) { - rb.Target = t -} - -func (rb *RemoveChainRequest_Body) SetChainId(chainID []byte) { - rb.ChainId = chainID -} - -func (r *RemoveChainRequest) SetBody(rb *RemoveChainRequest_Body) { - r.Body = rb -} - -func (r *RemoveChainRequest) SetMetaHeader(mh *session.RequestMetaHeader) { - r.MetaHeader = mh -} - -func (r *RemoveChainRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) { - r.VerifyHeader = vh -} - -func (r *RemoveChainResponse) SetBody(rb *RemoveChainResponse_Body) { - r.Body = rb -} - -func (r *RemoveChainResponse) SetMetaHeader(mh *session.ResponseMetaHeader) { - r.MetaHeader = mh -} - -func (r *RemoveChainResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) { - r.VerifyHeader = vh -} - -func (r *ListChainsRequest_Body) SetTarget(t *ape.ChainTarget) { - r.Target = t -} - -func (r *ListChainsRequest) SetBody(rb *ListChainsRequest_Body) { - r.Body = rb -} - -func (r *ListChainsRequest) SetMetaHeader(mh *session.RequestMetaHeader) { - r.MetaHeader = mh -} - -func (r *ListChainsRequest) SetVerifyHeader(vh *session.RequestVerificationHeader) { - r.VerifyHeader = vh -} - -func (rb *ListChainsResponse_Body) SetChains(chains []*ape.Chain) { - rb.Chains = chains -} - -func (r *ListChainsResponse) SetBody(rb *ListChainsResponse_Body) { - r.Body = rb -} - -func (r *ListChainsResponse) SetMetaHeader(mh *session.ResponseMetaHeader) { - r.MetaHeader = mh -} - -func (r *ListChainsResponse) SetVerifyHeader(vh *session.ResponseVerificationHeader) { - r.VerifyHeader = vh -} diff --git a/apemanager/grpc/service.pb.go b/apemanager/grpc/service.pb.go deleted file mode 100644 index 3baf193..0000000 --- a/apemanager/grpc/service.pb.go +++ /dev/null @@ -1,1129 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: apemanager/grpc/service.proto - -package apemanager - -import ( - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AddChainRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The request's body. - Body *AddChainRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *AddChainRequest) Reset() { - *x = AddChainRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddChainRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddChainRequest) ProtoMessage() {} - -func (x *AddChainRequest) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddChainRequest.ProtoReflect.Descriptor instead. -func (*AddChainRequest) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{0} -} - -func (x *AddChainRequest) GetBody() *AddChainRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *AddChainRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *AddChainRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -type AddChainResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The response's body. - Body *AddChainResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *AddChainResponse) Reset() { - *x = AddChainResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddChainResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddChainResponse) ProtoMessage() {} - -func (x *AddChainResponse) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddChainResponse.ProtoReflect.Descriptor instead. -func (*AddChainResponse) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{1} -} - -func (x *AddChainResponse) GetBody() *AddChainResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *AddChainResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *AddChainResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -type RemoveChainRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The request's body. - Body *RemoveChainRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *RemoveChainRequest) Reset() { - *x = RemoveChainRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveChainRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveChainRequest) ProtoMessage() {} - -func (x *RemoveChainRequest) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveChainRequest.ProtoReflect.Descriptor instead. -func (*RemoveChainRequest) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{2} -} - -func (x *RemoveChainRequest) GetBody() *RemoveChainRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *RemoveChainRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *RemoveChainRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -type RemoveChainResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The response's body. - Body *RemoveChainResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *RemoveChainResponse) Reset() { - *x = RemoveChainResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveChainResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveChainResponse) ProtoMessage() {} - -func (x *RemoveChainResponse) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveChainResponse.ProtoReflect.Descriptor instead. -func (*RemoveChainResponse) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{3} -} - -func (x *RemoveChainResponse) GetBody() *RemoveChainResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *RemoveChainResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *RemoveChainResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -type ListChainsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The request's body. - Body *ListChainsRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *ListChainsRequest) Reset() { - *x = ListChainsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListChainsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListChainsRequest) ProtoMessage() {} - -func (x *ListChainsRequest) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListChainsRequest.ProtoReflect.Descriptor instead. -func (*ListChainsRequest) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{4} -} - -func (x *ListChainsRequest) GetBody() *ListChainsRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *ListChainsRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *ListChainsRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -type ListChainsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The response's body. - Body *ListChainsResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *ListChainsResponse) Reset() { - *x = ListChainsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListChainsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListChainsResponse) ProtoMessage() {} - -func (x *ListChainsResponse) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListChainsResponse.ProtoReflect.Descriptor instead. -func (*ListChainsResponse) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{5} -} - -func (x *ListChainsResponse) GetBody() *ListChainsResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *ListChainsResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *ListChainsResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -type AddChainRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A target for which a rule chain is added. - Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - // The chain to set for the target. - Chain *grpc1.Chain `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"` -} - -func (x *AddChainRequest_Body) Reset() { - *x = AddChainRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddChainRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddChainRequest_Body) ProtoMessage() {} - -func (x *AddChainRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddChainRequest_Body.ProtoReflect.Descriptor instead. -func (*AddChainRequest_Body) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *AddChainRequest_Body) GetTarget() *grpc1.ChainTarget { - if x != nil { - return x.Target - } - return nil -} - -func (x *AddChainRequest_Body) GetChain() *grpc1.Chain { - if x != nil { - return x.Chain - } - return nil -} - -type AddChainResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Chain ID assigned for the added rule chain. - // If chain ID is left empty in the request, then - // it will be generated. - ChainId []byte `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (x *AddChainResponse_Body) Reset() { - *x = AddChainResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddChainResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddChainResponse_Body) ProtoMessage() {} - -func (x *AddChainResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddChainResponse_Body.ProtoReflect.Descriptor instead. -func (*AddChainResponse_Body) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *AddChainResponse_Body) GetChainId() []byte { - if x != nil { - return x.ChainId - } - return nil -} - -type RemoveChainRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Target for which a rule chain is removed. - Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - // Chain ID assigned for the rule chain. - ChainId []byte `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (x *RemoveChainRequest_Body) Reset() { - *x = RemoveChainRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveChainRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveChainRequest_Body) ProtoMessage() {} - -func (x *RemoveChainRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveChainRequest_Body.ProtoReflect.Descriptor instead. -func (*RemoveChainRequest_Body) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *RemoveChainRequest_Body) GetTarget() *grpc1.ChainTarget { - if x != nil { - return x.Target - } - return nil -} - -func (x *RemoveChainRequest_Body) GetChainId() []byte { - if x != nil { - return x.ChainId - } - return nil -} - -// Since RemoveChain is an idempotent operation, then the only indicator that -// operation could not be performed is an error returning to a client. -type RemoveChainResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RemoveChainResponse_Body) Reset() { - *x = RemoveChainResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveChainResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveChainResponse_Body) ProtoMessage() {} - -func (x *RemoveChainResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveChainResponse_Body.ProtoReflect.Descriptor instead. -func (*RemoveChainResponse_Body) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{3, 0} -} - -type ListChainsRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Target for which rule chains are listed. - Target *grpc1.ChainTarget `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` -} - -func (x *ListChainsRequest_Body) Reset() { - *x = ListChainsRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListChainsRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListChainsRequest_Body) ProtoMessage() {} - -func (x *ListChainsRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListChainsRequest_Body.ProtoReflect.Descriptor instead. -func (*ListChainsRequest_Body) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{4, 0} -} - -func (x *ListChainsRequest_Body) GetTarget() *grpc1.ChainTarget { - if x != nil { - return x.Target - } - return nil -} - -type ListChainsResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of chains defined for the reqeusted target. - Chains []*grpc1.Chain `protobuf:"bytes,1,rep,name=chains,proto3" json:"chains,omitempty"` -} - -func (x *ListChainsResponse_Body) Reset() { - *x = ListChainsResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_apemanager_grpc_service_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListChainsResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListChainsResponse_Body) ProtoMessage() {} - -func (x *ListChainsResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_apemanager_grpc_service_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListChainsResponse_Body.ProtoReflect.Descriptor instead. -func (*ListChainsResponse_Body) Descriptor() ([]byte, []int) { - return file_apemanager_grpc_service_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *ListChainsResponse_Body) GetChains() []*grpc1.Chain { - if x != nil { - return x.Chains - } - return nil -} - -var File_apemanager_grpc_service_proto protoreflect.FileDescriptor - -var file_apemanager_grpc_service_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x15, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x1a, 0x14, 0x61, 0x70, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x02, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 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, 0x68, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x33, 0x0a, - 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x2e, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, - 0x70, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x05, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x22, - 0x93, 0x02, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, - 0x61, 0x69, 0x6e, 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, 0x21, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x49, 0x64, 0x22, 0xca, 0x02, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x66, 0x72, 0x6f, - 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 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, 0x56, 0x0a, 0x04, 0x42, 0x6f, - 0x64, 0x79, 0x12, 0x33, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x61, 0x70, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, - 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x49, 0x64, 0x22, 0xfe, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, - 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 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, 0x06, 0x0a, 0x04, 0x42, - 0x6f, 0x64, 0x79, 0x22, 0xad, 0x02, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 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, 0x3b, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x33, - 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x2e, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x22, 0xab, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 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, 0x35, 0x0a, 0x04, 0x42, 0x6f, - 0x64, 0x79, 0x12, 0x2d, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x61, 0x70, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x06, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x73, 0x32, 0xb9, 0x02, 0x0a, 0x11, 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5b, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x12, 0x26, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x12, 0x29, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, - 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, - 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x28, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, - 0x4a, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, - 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, - 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, - 0x2f, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x3b, 0x61, 0x70, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_apemanager_grpc_service_proto_rawDescOnce sync.Once - file_apemanager_grpc_service_proto_rawDescData = file_apemanager_grpc_service_proto_rawDesc -) - -func file_apemanager_grpc_service_proto_rawDescGZIP() []byte { - file_apemanager_grpc_service_proto_rawDescOnce.Do(func() { - file_apemanager_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_apemanager_grpc_service_proto_rawDescData) - }) - return file_apemanager_grpc_service_proto_rawDescData -} - -var file_apemanager_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_apemanager_grpc_service_proto_goTypes = []interface{}{ - (*AddChainRequest)(nil), // 0: frostfs.v2.apemanager.AddChainRequest - (*AddChainResponse)(nil), // 1: frostfs.v2.apemanager.AddChainResponse - (*RemoveChainRequest)(nil), // 2: frostfs.v2.apemanager.RemoveChainRequest - (*RemoveChainResponse)(nil), // 3: frostfs.v2.apemanager.RemoveChainResponse - (*ListChainsRequest)(nil), // 4: frostfs.v2.apemanager.ListChainsRequest - (*ListChainsResponse)(nil), // 5: frostfs.v2.apemanager.ListChainsResponse - (*AddChainRequest_Body)(nil), // 6: frostfs.v2.apemanager.AddChainRequest.Body - (*AddChainResponse_Body)(nil), // 7: frostfs.v2.apemanager.AddChainResponse.Body - (*RemoveChainRequest_Body)(nil), // 8: frostfs.v2.apemanager.RemoveChainRequest.Body - (*RemoveChainResponse_Body)(nil), // 9: frostfs.v2.apemanager.RemoveChainResponse.Body - (*ListChainsRequest_Body)(nil), // 10: frostfs.v2.apemanager.ListChainsRequest.Body - (*ListChainsResponse_Body)(nil), // 11: frostfs.v2.apemanager.ListChainsResponse.Body - (*grpc.RequestMetaHeader)(nil), // 12: neo.fs.v2.session.RequestMetaHeader - (*grpc.RequestVerificationHeader)(nil), // 13: neo.fs.v2.session.RequestVerificationHeader - (*grpc.ResponseMetaHeader)(nil), // 14: neo.fs.v2.session.ResponseMetaHeader - (*grpc.ResponseVerificationHeader)(nil), // 15: neo.fs.v2.session.ResponseVerificationHeader - (*grpc1.ChainTarget)(nil), // 16: frostfs.v2.ape.ChainTarget - (*grpc1.Chain)(nil), // 17: frostfs.v2.ape.Chain -} -var file_apemanager_grpc_service_proto_depIdxs = []int32{ - 6, // 0: frostfs.v2.apemanager.AddChainRequest.body:type_name -> frostfs.v2.apemanager.AddChainRequest.Body - 12, // 1: frostfs.v2.apemanager.AddChainRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 13, // 2: frostfs.v2.apemanager.AddChainRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 7, // 3: frostfs.v2.apemanager.AddChainResponse.body:type_name -> frostfs.v2.apemanager.AddChainResponse.Body - 14, // 4: frostfs.v2.apemanager.AddChainResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 15, // 5: frostfs.v2.apemanager.AddChainResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 8, // 6: frostfs.v2.apemanager.RemoveChainRequest.body:type_name -> frostfs.v2.apemanager.RemoveChainRequest.Body - 12, // 7: frostfs.v2.apemanager.RemoveChainRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 13, // 8: frostfs.v2.apemanager.RemoveChainRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 9, // 9: frostfs.v2.apemanager.RemoveChainResponse.body:type_name -> frostfs.v2.apemanager.RemoveChainResponse.Body - 14, // 10: frostfs.v2.apemanager.RemoveChainResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 15, // 11: frostfs.v2.apemanager.RemoveChainResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 10, // 12: frostfs.v2.apemanager.ListChainsRequest.body:type_name -> frostfs.v2.apemanager.ListChainsRequest.Body - 12, // 13: frostfs.v2.apemanager.ListChainsRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 13, // 14: frostfs.v2.apemanager.ListChainsRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 11, // 15: frostfs.v2.apemanager.ListChainsResponse.body:type_name -> frostfs.v2.apemanager.ListChainsResponse.Body - 14, // 16: frostfs.v2.apemanager.ListChainsResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 15, // 17: frostfs.v2.apemanager.ListChainsResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 16, // 18: frostfs.v2.apemanager.AddChainRequest.Body.target:type_name -> frostfs.v2.ape.ChainTarget - 17, // 19: frostfs.v2.apemanager.AddChainRequest.Body.chain:type_name -> frostfs.v2.ape.Chain - 16, // 20: frostfs.v2.apemanager.RemoveChainRequest.Body.target:type_name -> frostfs.v2.ape.ChainTarget - 16, // 21: frostfs.v2.apemanager.ListChainsRequest.Body.target:type_name -> frostfs.v2.ape.ChainTarget - 17, // 22: frostfs.v2.apemanager.ListChainsResponse.Body.chains:type_name -> frostfs.v2.ape.Chain - 0, // 23: frostfs.v2.apemanager.APEManagerService.AddChain:input_type -> frostfs.v2.apemanager.AddChainRequest - 2, // 24: frostfs.v2.apemanager.APEManagerService.RemoveChain:input_type -> frostfs.v2.apemanager.RemoveChainRequest - 4, // 25: frostfs.v2.apemanager.APEManagerService.ListChains:input_type -> frostfs.v2.apemanager.ListChainsRequest - 1, // 26: frostfs.v2.apemanager.APEManagerService.AddChain:output_type -> frostfs.v2.apemanager.AddChainResponse - 3, // 27: frostfs.v2.apemanager.APEManagerService.RemoveChain:output_type -> frostfs.v2.apemanager.RemoveChainResponse - 5, // 28: frostfs.v2.apemanager.APEManagerService.ListChains:output_type -> frostfs.v2.apemanager.ListChainsResponse - 26, // [26:29] is the sub-list for method output_type - 23, // [23:26] is the sub-list for method input_type - 23, // [23:23] is the sub-list for extension type_name - 23, // [23:23] is the sub-list for extension extendee - 0, // [0:23] is the sub-list for field type_name -} - -func init() { file_apemanager_grpc_service_proto_init() } -func file_apemanager_grpc_service_proto_init() { - if File_apemanager_grpc_service_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_apemanager_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddChainRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddChainResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveChainRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveChainResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListChainsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListChainsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddChainRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddChainResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveChainRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveChainResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListChainsRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_apemanager_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListChainsResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_apemanager_grpc_service_proto_rawDesc, - NumEnums: 0, - NumMessages: 12, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_apemanager_grpc_service_proto_goTypes, - DependencyIndexes: file_apemanager_grpc_service_proto_depIdxs, - MessageInfos: file_apemanager_grpc_service_proto_msgTypes, - }.Build() - File_apemanager_grpc_service_proto = out.File - file_apemanager_grpc_service_proto_rawDesc = nil - file_apemanager_grpc_service_proto_goTypes = nil - file_apemanager_grpc_service_proto_depIdxs = nil -} diff --git a/apemanager/grpc/service_frostfs.pb.go b/apemanager/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..380ba30 --- /dev/null +++ b/apemanager/grpc/service_frostfs.pb.go @@ -0,0 +1,2183 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package apemanager + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type AddChainRequest_Body struct { + Target *grpc.ChainTarget `json:"target"` + Chain *grpc.Chain `json:"chain"` +} + +var ( + _ encoding.ProtoMarshaler = (*AddChainRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*AddChainRequest_Body)(nil) + _ json.Marshaler = (*AddChainRequest_Body)(nil) + _ json.Unmarshaler = (*AddChainRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddChainRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Target) + size += proto.NestedStructureSize(2, x.Chain) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *AddChainRequest_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 *AddChainRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Target != nil && x.Target.StableSize() != 0 { + x.Target.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Chain != nil && x.Chain.StableSize() != 0 { + x.Chain.EmitProtobuf(mm.AppendMessage(2)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *AddChainRequest_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", "AddChainRequest_Body") + } + switch fc.FieldNum { + case 1: // Target + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Target") + } + x.Target = new(grpc.ChainTarget) + if err := x.Target.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Chain + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Chain") + } + x.Chain = new(grpc.Chain) + if err := x.Chain.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *AddChainRequest_Body) GetTarget() *grpc.ChainTarget { + if x != nil { + return x.Target + } + return nil +} +func (x *AddChainRequest_Body) SetTarget(v *grpc.ChainTarget) { + x.Target = v +} +func (x *AddChainRequest_Body) GetChain() *grpc.Chain { + if x != nil { + return x.Chain + } + return nil +} +func (x *AddChainRequest_Body) SetChain(v *grpc.Chain) { + x.Chain = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *AddChainRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *AddChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"target\":" + out.RawString(prefix[1:]) + x.Target.MarshalEasyJSON(out) + } + { + const prefix string = ",\"chain\":" + out.RawString(prefix) + x.Chain.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *AddChainRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *AddChainRequest_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 "target": + { + var f *grpc.ChainTarget + f = new(grpc.ChainTarget) + f.UnmarshalEasyJSON(in) + x.Target = f + } + case "chain": + { + var f *grpc.Chain + f = new(grpc.Chain) + f.UnmarshalEasyJSON(in) + x.Chain = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type AddChainRequest struct { + Body *AddChainRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*AddChainRequest)(nil) + _ encoding.ProtoUnmarshaler = (*AddChainRequest)(nil) + _ json.Marshaler = (*AddChainRequest)(nil) + _ json.Unmarshaler = (*AddChainRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddChainRequest) 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 *AddChainRequest) 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 *AddChainRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *AddChainRequest) 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 *AddChainRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *AddChainRequest) 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", "AddChainRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(AddChainRequest_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 *AddChainRequest) GetBody() *AddChainRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *AddChainRequest) SetBody(v *AddChainRequest_Body) { + x.Body = v +} +func (x *AddChainRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *AddChainRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *AddChainRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *AddChainRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *AddChainRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *AddChainRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *AddChainRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *AddChainRequest) 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 *AddChainRequest_Body + f = new(AddChainRequest_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 AddChainResponse_Body struct { + ChainId []byte `json:"chainId"` +} + +var ( + _ encoding.ProtoMarshaler = (*AddChainResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*AddChainResponse_Body)(nil) + _ json.Marshaler = (*AddChainResponse_Body)(nil) + _ json.Unmarshaler = (*AddChainResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddChainResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.ChainId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *AddChainResponse_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 *AddChainResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.ChainId) != 0 { + mm.AppendBytes(1, x.ChainId) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *AddChainResponse_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", "AddChainResponse_Body") + } + switch fc.FieldNum { + case 1: // ChainId + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ChainId") + } + x.ChainId = data + } + } + return nil +} +func (x *AddChainResponse_Body) GetChainId() []byte { + if x != nil { + return x.ChainId + } + return nil +} +func (x *AddChainResponse_Body) SetChainId(v []byte) { + x.ChainId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *AddChainResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *AddChainResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"chainId\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.ChainId) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *AddChainResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *AddChainResponse_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 "chainId": + { + var f []byte + f = in.Bytes() + x.ChainId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type AddChainResponse struct { + Body *AddChainResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*AddChainResponse)(nil) + _ encoding.ProtoUnmarshaler = (*AddChainResponse)(nil) + _ json.Marshaler = (*AddChainResponse)(nil) + _ json.Unmarshaler = (*AddChainResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *AddChainResponse) 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 *AddChainResponse) 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 *AddChainResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *AddChainResponse) 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 *AddChainResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *AddChainResponse) 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", "AddChainResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(AddChainResponse_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 *AddChainResponse) GetBody() *AddChainResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *AddChainResponse) SetBody(v *AddChainResponse_Body) { + x.Body = v +} +func (x *AddChainResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *AddChainResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *AddChainResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *AddChainResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *AddChainResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *AddChainResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *AddChainResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *AddChainResponse) 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 *AddChainResponse_Body + f = new(AddChainResponse_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() + } +} + +type RemoveChainRequest_Body struct { + Target *grpc.ChainTarget `json:"target"` + ChainId []byte `json:"chainId"` +} + +var ( + _ encoding.ProtoMarshaler = (*RemoveChainRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*RemoveChainRequest_Body)(nil) + _ json.Marshaler = (*RemoveChainRequest_Body)(nil) + _ json.Unmarshaler = (*RemoveChainRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RemoveChainRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Target) + size += proto.BytesSize(2, x.ChainId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *RemoveChainRequest_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 *RemoveChainRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Target != nil && x.Target.StableSize() != 0 { + x.Target.EmitProtobuf(mm.AppendMessage(1)) + } + if len(x.ChainId) != 0 { + mm.AppendBytes(2, x.ChainId) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *RemoveChainRequest_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", "RemoveChainRequest_Body") + } + switch fc.FieldNum { + case 1: // Target + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Target") + } + x.Target = new(grpc.ChainTarget) + if err := x.Target.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // ChainId + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ChainId") + } + x.ChainId = data + } + } + return nil +} +func (x *RemoveChainRequest_Body) GetTarget() *grpc.ChainTarget { + if x != nil { + return x.Target + } + return nil +} +func (x *RemoveChainRequest_Body) SetTarget(v *grpc.ChainTarget) { + x.Target = v +} +func (x *RemoveChainRequest_Body) GetChainId() []byte { + if x != nil { + return x.ChainId + } + return nil +} +func (x *RemoveChainRequest_Body) SetChainId(v []byte) { + x.ChainId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *RemoveChainRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *RemoveChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"target\":" + out.RawString(prefix[1:]) + x.Target.MarshalEasyJSON(out) + } + { + const prefix string = ",\"chainId\":" + out.RawString(prefix) + out.Base64Bytes(x.ChainId) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *RemoveChainRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *RemoveChainRequest_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 "target": + { + var f *grpc.ChainTarget + f = new(grpc.ChainTarget) + f.UnmarshalEasyJSON(in) + x.Target = f + } + case "chainId": + { + var f []byte + f = in.Bytes() + x.ChainId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type RemoveChainRequest struct { + Body *RemoveChainRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*RemoveChainRequest)(nil) + _ encoding.ProtoUnmarshaler = (*RemoveChainRequest)(nil) + _ json.Marshaler = (*RemoveChainRequest)(nil) + _ json.Unmarshaler = (*RemoveChainRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RemoveChainRequest) 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 *RemoveChainRequest) 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 *RemoveChainRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *RemoveChainRequest) 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 *RemoveChainRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *RemoveChainRequest) 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", "RemoveChainRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(RemoveChainRequest_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 *RemoveChainRequest) GetBody() *RemoveChainRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *RemoveChainRequest) SetBody(v *RemoveChainRequest_Body) { + x.Body = v +} +func (x *RemoveChainRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *RemoveChainRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *RemoveChainRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *RemoveChainRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *RemoveChainRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *RemoveChainRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *RemoveChainRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *RemoveChainRequest) 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 *RemoveChainRequest_Body + f = new(RemoveChainRequest_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 RemoveChainResponse_Body struct { +} + +var ( + _ encoding.ProtoMarshaler = (*RemoveChainResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*RemoveChainResponse_Body)(nil) + _ json.Marshaler = (*RemoveChainResponse_Body)(nil) + _ json.Unmarshaler = (*RemoveChainResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RemoveChainResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *RemoveChainResponse_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 *RemoveChainResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *RemoveChainResponse_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", "RemoveChainResponse_Body") + } + switch fc.FieldNum { + } + } + return nil +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *RemoveChainResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *RemoveChainResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *RemoveChainResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *RemoveChainResponse_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 { + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type RemoveChainResponse struct { + Body *RemoveChainResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*RemoveChainResponse)(nil) + _ encoding.ProtoUnmarshaler = (*RemoveChainResponse)(nil) + _ json.Marshaler = (*RemoveChainResponse)(nil) + _ json.Unmarshaler = (*RemoveChainResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RemoveChainResponse) 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 *RemoveChainResponse) 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 *RemoveChainResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *RemoveChainResponse) 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 *RemoveChainResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *RemoveChainResponse) 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", "RemoveChainResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(RemoveChainResponse_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 *RemoveChainResponse) GetBody() *RemoveChainResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *RemoveChainResponse) SetBody(v *RemoveChainResponse_Body) { + x.Body = v +} +func (x *RemoveChainResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *RemoveChainResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *RemoveChainResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *RemoveChainResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *RemoveChainResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *RemoveChainResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *RemoveChainResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *RemoveChainResponse) 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 *RemoveChainResponse_Body + f = new(RemoveChainResponse_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() + } +} + +type ListChainsRequest_Body struct { + Target *grpc.ChainTarget `json:"target"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListChainsRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*ListChainsRequest_Body)(nil) + _ json.Marshaler = (*ListChainsRequest_Body)(nil) + _ json.Unmarshaler = (*ListChainsRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListChainsRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Target) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ListChainsRequest_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 *ListChainsRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Target != nil && x.Target.StableSize() != 0 { + x.Target.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ListChainsRequest_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", "ListChainsRequest_Body") + } + switch fc.FieldNum { + case 1: // Target + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Target") + } + x.Target = new(grpc.ChainTarget) + if err := x.Target.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *ListChainsRequest_Body) GetTarget() *grpc.ChainTarget { + if x != nil { + return x.Target + } + return nil +} +func (x *ListChainsRequest_Body) SetTarget(v *grpc.ChainTarget) { + x.Target = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListChainsRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListChainsRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"target\":" + out.RawString(prefix[1:]) + x.Target.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListChainsRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListChainsRequest_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 "target": + { + var f *grpc.ChainTarget + f = new(grpc.ChainTarget) + f.UnmarshalEasyJSON(in) + x.Target = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ListChainsRequest struct { + Body *ListChainsRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListChainsRequest)(nil) + _ encoding.ProtoUnmarshaler = (*ListChainsRequest)(nil) + _ json.Marshaler = (*ListChainsRequest)(nil) + _ json.Unmarshaler = (*ListChainsRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListChainsRequest) 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 *ListChainsRequest) 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 *ListChainsRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ListChainsRequest) 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 *ListChainsRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ListChainsRequest) 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", "ListChainsRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(ListChainsRequest_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 *ListChainsRequest) GetBody() *ListChainsRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *ListChainsRequest) SetBody(v *ListChainsRequest_Body) { + x.Body = v +} +func (x *ListChainsRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *ListChainsRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *ListChainsRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *ListChainsRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListChainsRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListChainsRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListChainsRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListChainsRequest) 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 *ListChainsRequest_Body + f = new(ListChainsRequest_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 ListChainsResponse_Body struct { + Chains []*grpc.Chain `json:"chains"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListChainsResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*ListChainsResponse_Body)(nil) + _ json.Marshaler = (*ListChainsResponse_Body)(nil) + _ json.Unmarshaler = (*ListChainsResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListChainsResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.Chains { + size += proto.NestedStructureSize(1, x.Chains[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ListChainsResponse_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 *ListChainsResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + for i := range x.Chains { + if x.Chains[i] != nil && x.Chains[i].StableSize() != 0 { + x.Chains[i].EmitProtobuf(mm.AppendMessage(1)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ListChainsResponse_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", "ListChainsResponse_Body") + } + switch fc.FieldNum { + case 1: // Chains + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Chains") + } + x.Chains = append(x.Chains, new(grpc.Chain)) + ff := x.Chains[len(x.Chains)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *ListChainsResponse_Body) GetChains() []*grpc.Chain { + if x != nil { + return x.Chains + } + return nil +} +func (x *ListChainsResponse_Body) SetChains(v []*grpc.Chain) { + x.Chains = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListChainsResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListChainsResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"chains\":" + out.RawString(prefix[1:]) + out.RawByte('[') + for i := range x.Chains { + if i != 0 { + out.RawByte(',') + } + x.Chains[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListChainsResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListChainsResponse_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 "chains": + { + var f *grpc.Chain + var list []*grpc.Chain + in.Delim('[') + for !in.IsDelim(']') { + f = new(grpc.Chain) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Chains = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ListChainsResponse struct { + Body *ListChainsResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListChainsResponse)(nil) + _ encoding.ProtoUnmarshaler = (*ListChainsResponse)(nil) + _ json.Marshaler = (*ListChainsResponse)(nil) + _ json.Unmarshaler = (*ListChainsResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListChainsResponse) 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 *ListChainsResponse) 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 *ListChainsResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ListChainsResponse) 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 *ListChainsResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ListChainsResponse) 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", "ListChainsResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(ListChainsResponse_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 *ListChainsResponse) GetBody() *ListChainsResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *ListChainsResponse) SetBody(v *ListChainsResponse_Body) { + x.Body = v +} +func (x *ListChainsResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *ListChainsResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *ListChainsResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *ListChainsResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListChainsResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListChainsResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListChainsResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListChainsResponse) 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 *ListChainsResponse_Body + f = new(ListChainsResponse_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() + } +} diff --git a/apemanager/grpc/service_frostfs_fuzz.go b/apemanager/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..08af63e --- /dev/null +++ b/apemanager/grpc/service_frostfs_fuzz.go @@ -0,0 +1,121 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package apemanager + +func DoFuzzProtoAddChainRequest(data []byte) int { + msg := new(AddChainRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONAddChainRequest(data []byte) int { + msg := new(AddChainRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoAddChainResponse(data []byte) int { + msg := new(AddChainResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONAddChainResponse(data []byte) int { + msg := new(AddChainResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoRemoveChainRequest(data []byte) int { + msg := new(RemoveChainRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONRemoveChainRequest(data []byte) int { + msg := new(RemoveChainRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoRemoveChainResponse(data []byte) int { + msg := new(RemoveChainResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONRemoveChainResponse(data []byte) int { + msg := new(RemoveChainResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoListChainsRequest(data []byte) int { + msg := new(ListChainsRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONListChainsRequest(data []byte) int { + msg := new(ListChainsRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoListChainsResponse(data []byte) int { + msg := new(ListChainsResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONListChainsResponse(data []byte) int { + msg := new(ListChainsResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/apemanager/grpc/service_frostfs_test.go b/apemanager/grpc/service_frostfs_test.go new file mode 100644 index 0000000..5c4653c --- /dev/null +++ b/apemanager/grpc/service_frostfs_test.go @@ -0,0 +1,71 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package apemanager + +import ( + testing "testing" +) + +func FuzzProtoAddChainRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoAddChainRequest(data) + }) +} +func FuzzJSONAddChainRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONAddChainRequest(data) + }) +} +func FuzzProtoAddChainResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoAddChainResponse(data) + }) +} +func FuzzJSONAddChainResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONAddChainResponse(data) + }) +} +func FuzzProtoRemoveChainRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoRemoveChainRequest(data) + }) +} +func FuzzJSONRemoveChainRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONRemoveChainRequest(data) + }) +} +func FuzzProtoRemoveChainResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoRemoveChainResponse(data) + }) +} +func FuzzJSONRemoveChainResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONRemoveChainResponse(data) + }) +} +func FuzzProtoListChainsRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoListChainsRequest(data) + }) +} +func FuzzJSONListChainsRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONListChainsRequest(data) + }) +} +func FuzzProtoListChainsResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoListChainsResponse(data) + }) +} +func FuzzJSONListChainsResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONListChainsResponse(data) + }) +} diff --git a/container/grpc/service.go b/container/grpc/service.go deleted file mode 100644 index d19add1..0000000 --- a/container/grpc/service.go +++ /dev/null @@ -1,234 +0,0 @@ -package container - -import ( - acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" -) - -// SetContainer sets container of the request. -func (m *PutRequest_Body) SetContainer(v *Container) { - m.Container = v -} - -// SetSignature sets signature of the container structure. -func (m *PutRequest_Body) SetSignature(v *refs.SignatureRFC6979) { - m.Signature = v -} - -// SetBody sets body of the request. -func (m *PutRequest) SetBody(v *PutRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *PutRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *PutRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetContainerId sets identifier of the container. -func (m *PutResponse_Body) SetContainerId(v *refs.ContainerID) { - m.ContainerId = v -} - -// SetBody sets body of the response. -func (m *PutResponse) SetBody(v *PutResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *PutResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *PutResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetContainerId sets identifier of the container. -func (m *DeleteRequest_Body) SetContainerId(v *refs.ContainerID) { - m.ContainerId = v -} - -// SetSignature sets signature of the container identifier. -func (m *DeleteRequest_Body) SetSignature(v *refs.SignatureRFC6979) { - m.Signature = v -} - -// SetBody sets body of the request. -func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *DeleteRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *DeleteRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetBody sets body of the response. -func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *DeleteResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *DeleteResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetContainerId sets identifier of the container. -func (m *GetRequest_Body) SetContainerId(v *refs.ContainerID) { - m.ContainerId = v -} - -// SetBody sets body of the request. -func (m *GetRequest) SetBody(v *GetRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *GetRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *GetRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetContainer sets the container structure. -func (m *GetResponse_Body) SetContainer(v *Container) { - m.Container = v -} - -// SetSessionToken sets token of the session within which requested -// container was created. -func (m *GetResponse_Body) SetSessionToken(v *session.SessionToken) { - m.SessionToken = v -} - -// SetSignature sets signature of the container structure. -func (m *GetResponse_Body) SetSignature(v *refs.SignatureRFC6979) { - m.Signature = v -} - -// SetBody sets body of the response. -func (m *GetResponse) SetBody(v *GetResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *GetResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *GetResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetOwnerId sets identifier of the container owner. -func (m *ListRequest_Body) SetOwnerId(v *refs.OwnerID) { - m.OwnerId = v -} - -// SetBody sets body of the request. -func (m *ListRequest) SetBody(v *ListRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *ListRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *ListRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetContainerIds sets list of the container identifiers. -func (m *ListResponse_Body) SetContainerIds(v []*refs.ContainerID) { - m.ContainerIds = v -} - -// SetBody sets body of the response. -func (m *ListResponse) SetBody(v *ListResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *ListResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *ListResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetContainerId sets identifier of the container. -func (m *GetExtendedACLRequest_Body) SetContainerId(v *refs.ContainerID) { - m.ContainerId = v -} - -// SetBody sets body of the request. -func (m *GetExtendedACLRequest) SetBody(v *GetExtendedACLRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *GetExtendedACLRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *GetExtendedACLRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetEacl sets eACL table structure. -func (m *GetExtendedACLResponse_Body) SetEacl(v *acl.EACLTable) { - m.Eacl = v -} - -// SetSignature sets signature of the eACL table structure. -func (m *GetExtendedACLResponse_Body) SetSignature(v *refs.SignatureRFC6979) { - m.Signature = v -} - -// SetSessionToken sets token of the session within which requested -// eACl table was set. -func (m *GetExtendedACLResponse_Body) SetSessionToken(v *session.SessionToken) { - m.SessionToken = v -} - -// SetBody sets body of the response. -func (m *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *GetExtendedACLResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *GetExtendedACLResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} diff --git a/container/grpc/service.pb.go b/container/grpc/service.pb.go deleted file mode 100644 index 3bf1e14..0000000 --- a/container/grpc/service.pb.go +++ /dev/null @@ -1,1909 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: container/grpc/service.proto - -package container - -import ( - grpc2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// New NeoFS Container creation request -type PutRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of container put request message. - Body *PutRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *PutRequest) Reset() { - *x = PutRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutRequest) ProtoMessage() {} - -func (x *PutRequest) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutRequest.ProtoReflect.Descriptor instead. -func (*PutRequest) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{0} -} - -func (x *PutRequest) GetBody() *PutRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *PutRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *PutRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// New NeoFS Container creation response -type PutResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of container put response message. - Body *PutResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *PutResponse) Reset() { - *x = PutResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutResponse) ProtoMessage() {} - -func (x *PutResponse) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutResponse.ProtoReflect.Descriptor instead. -func (*PutResponse) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{1} -} - -func (x *PutResponse) GetBody() *PutResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *PutResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *PutResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Container removal request -type DeleteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of container delete request message. - Body *DeleteRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *DeleteRequest) Reset() { - *x = DeleteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRequest) ProtoMessage() {} - -func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{2} -} - -func (x *DeleteRequest) GetBody() *DeleteRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *DeleteRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *DeleteRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// `DeleteResponse` has an empty body because delete operation is asynchronous -// and done via consensus in Inner Ring nodes. -type DeleteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of container delete response message. - Body *DeleteResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *DeleteResponse) Reset() { - *x = DeleteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteResponse) ProtoMessage() {} - -func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. -func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{3} -} - -func (x *DeleteResponse) GetBody() *DeleteResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *DeleteResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *DeleteResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Get container structure -type GetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of container get request message. - Body *GetRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *GetRequest) Reset() { - *x = GetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest) ProtoMessage() {} - -func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. -func (*GetRequest) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{4} -} - -func (x *GetRequest) GetBody() *GetRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *GetRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Get container structure -type GetResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of container get response message. - Body *GetResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *GetResponse) Reset() { - *x = GetResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse) ProtoMessage() {} - -func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. -func (*GetResponse) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{5} -} - -func (x *GetResponse) GetBody() *GetResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *GetResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// List containers -type ListRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of list containers request message - Body *ListRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *ListRequest) Reset() { - *x = ListRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRequest) ProtoMessage() {} - -func (x *ListRequest) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. -func (*ListRequest) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{6} -} - -func (x *ListRequest) GetBody() *ListRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *ListRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *ListRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// List containers -type ListResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of list containers response message. - Body *ListResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *ListResponse) Reset() { - *x = ListResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResponse) ProtoMessage() {} - -func (x *ListResponse) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. -func (*ListResponse) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{7} -} - -func (x *ListResponse) GetBody() *ListResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *ListResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *ListResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Get Extended ACL -type GetExtendedACLRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of get extended acl request message. - Body *GetExtendedACLRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *GetExtendedACLRequest) Reset() { - *x = GetExtendedACLRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExtendedACLRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExtendedACLRequest) ProtoMessage() {} - -func (x *GetExtendedACLRequest) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExtendedACLRequest.ProtoReflect.Descriptor instead. -func (*GetExtendedACLRequest) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{8} -} - -func (x *GetExtendedACLRequest) GetBody() *GetExtendedACLRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetExtendedACLRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *GetExtendedACLRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Get Extended ACL -type GetExtendedACLResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of get extended acl response message. - Body *GetExtendedACLResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *GetExtendedACLResponse) Reset() { - *x = GetExtendedACLResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExtendedACLResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExtendedACLResponse) ProtoMessage() {} - -func (x *GetExtendedACLResponse) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExtendedACLResponse.ProtoReflect.Descriptor instead. -func (*GetExtendedACLResponse) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{9} -} - -func (x *GetExtendedACLResponse) GetBody() *GetExtendedACLResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetExtendedACLResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *GetExtendedACLResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Container creation request has container structure's signature as a -// separate field. It's not stored in sidechain, just verified on container -// creation by `Container` smart contract. `ContainerID` is a SHA256 hash of -// the stable-marshalled container strucutre, hence there is no need for -// additional signature checks. -type PutRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Container structure to register in NeoFS - Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` - // Signature of a stable-marshalled container according to RFC-6979. - Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *PutRequest_Body) Reset() { - *x = PutRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutRequest_Body) ProtoMessage() {} - -func (x *PutRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutRequest_Body.ProtoReflect.Descriptor instead. -func (*PutRequest_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *PutRequest_Body) GetContainer() *Container { - if x != nil { - return x.Container - } - return nil -} - -func (x *PutRequest_Body) GetSignature() *grpc1.SignatureRFC6979 { - if x != nil { - return x.Signature - } - return nil -} - -// Container put response body contains information about the newly registered -// container as seen by `Container` smart contract. `ContainerID` can be -// calculated beforehand from the container structure and compared to the one -// returned here to make sure everything has been done as expected. -type PutResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Unique identifier of the newly created container - ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` -} - -func (x *PutResponse_Body) Reset() { - *x = PutResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutResponse_Body) ProtoMessage() {} - -func (x *PutResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutResponse_Body.ProtoReflect.Descriptor instead. -func (*PutResponse_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *PutResponse_Body) GetContainerId() *grpc1.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -// Container removal request body has signed `ContainerID` as a proof of -// the container owner's intent. The signature will be verified by `Container` -// smart contract, so signing algorithm must be supported by NeoVM. -type DeleteRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the container to delete from NeoFS - ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // `ContainerID` signed with the container owner's key according to - // RFC-6979. - Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *DeleteRequest_Body) Reset() { - *x = DeleteRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRequest_Body) ProtoMessage() {} - -func (x *DeleteRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRequest_Body.ProtoReflect.Descriptor instead. -func (*DeleteRequest_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *DeleteRequest_Body) GetContainerId() *grpc1.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -func (x *DeleteRequest_Body) GetSignature() *grpc1.SignatureRFC6979 { - if x != nil { - return x.Signature - } - return nil -} - -// `DeleteResponse` has an empty body because delete operation is asynchronous -// and done via consensus in Inner Ring nodes. -type DeleteResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteResponse_Body) Reset() { - *x = DeleteResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteResponse_Body) ProtoMessage() {} - -func (x *DeleteResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteResponse_Body.ProtoReflect.Descriptor instead. -func (*DeleteResponse_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{3, 0} -} - -// Get container structure request body. -type GetRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the container to get - ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` -} - -func (x *GetRequest_Body) Reset() { - *x = GetRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest_Body) ProtoMessage() {} - -func (x *GetRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRequest_Body.ProtoReflect.Descriptor instead. -func (*GetRequest_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{4, 0} -} - -func (x *GetRequest_Body) GetContainerId() *grpc1.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -// Get container response body does not have container structure signature. It -// has been already verified upon container creation. -type GetResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Requested container structure - Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` - // Signature of a stable-marshalled container according to RFC-6979. - Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - // Session token if the container has been created within the session - SessionToken *grpc.SessionToken `protobuf:"bytes,3,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` -} - -func (x *GetResponse_Body) Reset() { - *x = GetResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse_Body) ProtoMessage() {} - -func (x *GetResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResponse_Body.ProtoReflect.Descriptor instead. -func (*GetResponse_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *GetResponse_Body) GetContainer() *Container { - if x != nil { - return x.Container - } - return nil -} - -func (x *GetResponse_Body) GetSignature() *grpc1.SignatureRFC6979 { - if x != nil { - return x.Signature - } - return nil -} - -func (x *GetResponse_Body) GetSessionToken() *grpc.SessionToken { - if x != nil { - return x.SessionToken - } - return nil -} - -// List containers request body. -type ListRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the container owner - OwnerId *grpc1.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` -} - -func (x *ListRequest_Body) Reset() { - *x = ListRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRequest_Body) ProtoMessage() {} - -func (x *ListRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRequest_Body.ProtoReflect.Descriptor instead. -func (*ListRequest_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{6, 0} -} - -func (x *ListRequest_Body) GetOwnerId() *grpc1.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} - -// List containers response body. -type ListResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of `ContainerID`s belonging to the requested `OwnerID` - ContainerIds []*grpc1.ContainerID `protobuf:"bytes,1,rep,name=container_ids,json=containerIds,proto3" json:"container_ids,omitempty"` -} - -func (x *ListResponse_Body) Reset() { - *x = ListResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResponse_Body) ProtoMessage() {} - -func (x *ListResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListResponse_Body.ProtoReflect.Descriptor instead. -func (*ListResponse_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *ListResponse_Body) GetContainerIds() []*grpc1.ContainerID { - if x != nil { - return x.ContainerIds - } - return nil -} - -// Get Extended ACL request body -type GetExtendedACLRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the container having Extended ACL - ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` -} - -func (x *GetExtendedACLRequest_Body) Reset() { - *x = GetExtendedACLRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExtendedACLRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExtendedACLRequest_Body) ProtoMessage() {} - -func (x *GetExtendedACLRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExtendedACLRequest_Body.ProtoReflect.Descriptor instead. -func (*GetExtendedACLRequest_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{8, 0} -} - -func (x *GetExtendedACLRequest_Body) GetContainerId() *grpc1.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -// Get Extended ACL Response body can be empty if the requested container does -// not have Extended ACL Table attached or Extended ACL has not been allowed -// at the time of container creation. -type GetExtendedACLResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Extended ACL requested, if available - Eacl *grpc2.EACLTable `protobuf:"bytes,1,opt,name=eacl,proto3" json:"eacl,omitempty"` - // Signature of stable-marshalled Extended ACL according to RFC-6979. - Signature *grpc1.SignatureRFC6979 `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - // Session token if Extended ACL was set within a session - SessionToken *grpc.SessionToken `protobuf:"bytes,3,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` -} - -func (x *GetExtendedACLResponse_Body) Reset() { - *x = GetExtendedACLResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_service_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExtendedACLResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExtendedACLResponse_Body) ProtoMessage() {} - -func (x *GetExtendedACLResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_service_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExtendedACLResponse_Body.ProtoReflect.Descriptor instead. -func (*GetExtendedACLResponse_Body) Descriptor() ([]byte, []int) { - return file_container_grpc_service_proto_rawDescGZIP(), []int{9, 0} -} - -func (x *GetExtendedACLResponse_Body) GetEacl() *grpc2.EACLTable { - if x != nil { - return x.Eacl - } - return nil -} - -func (x *GetExtendedACLResponse_Body) GetSignature() *grpc1.SignatureRFC6979 { - if x != nil { - return x.Signature - } - return nil -} - -func (x *GetExtendedACLResponse_Body) GetSessionToken() *grpc.SessionToken { - if x != nil { - return x.SessionToken - } - return nil -} - -var File_container_grpc_service_proto protoreflect.FileDescriptor - -var file_container_grpc_service_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 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, 0x14, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe7, 0x02, 0x0a, 0x0a, 0x50, 0x75, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 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, 0x84, 0x01, 0x0a, 0x04, 0x42, 0x6f, - 0x64, 0x79, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 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, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, - 0x43, 0x36, 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x22, 0xac, 0x02, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 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, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 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, 0x46, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, - 0xef, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 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, 0x86, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, - 0x79, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, - 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x22, 0xf2, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, - 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, 0x44, 0x65, 0x6c, 0x65, 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, 0x06, - 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xa8, 0x02, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 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, 0x46, 0x0a, 0x04, 0x42, 0x6f, 0x64, - 0x79, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, - 0x64, 0x22, 0xb1, 0x03, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 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, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 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, 0xca, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, - 0x79, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 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, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, - 0x3e, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, - 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, - 0x36, 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, - 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9e, 0x02, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 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, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 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, 0xb0, 0x02, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 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, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 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, - 0x48, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x40, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0c, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0xbe, 0x02, 0x0a, 0x15, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 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, 0x46, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, - 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xb7, 0x03, 0x0a, 0x16, 0x47, - 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 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, 0xba, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, - 0x12, 0x2c, 0x0a, 0x04, 0x65, 0x61, 0x63, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x45, - 0x41, 0x43, 0x4c, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x04, 0x65, 0x61, 0x63, 0x6c, 0x12, 0x3e, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, - 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, - 0x39, 0x37, 0x39, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, - 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xb1, 0x03, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x03, 0x50, 0x75, 0x74, - 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x22, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1f, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, - 0x0e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, 0x12, - 0x2a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x64, 0x41, 0x43, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x41, 0x43, 0x4c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6a, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x2e, - 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, - 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_container_grpc_service_proto_rawDescOnce sync.Once - file_container_grpc_service_proto_rawDescData = file_container_grpc_service_proto_rawDesc -) - -func file_container_grpc_service_proto_rawDescGZIP() []byte { - file_container_grpc_service_proto_rawDescOnce.Do(func() { - file_container_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_container_grpc_service_proto_rawDescData) - }) - return file_container_grpc_service_proto_rawDescData -} - -var file_container_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 20) -var file_container_grpc_service_proto_goTypes = []interface{}{ - (*PutRequest)(nil), // 0: neo.fs.v2.container.PutRequest - (*PutResponse)(nil), // 1: neo.fs.v2.container.PutResponse - (*DeleteRequest)(nil), // 2: neo.fs.v2.container.DeleteRequest - (*DeleteResponse)(nil), // 3: neo.fs.v2.container.DeleteResponse - (*GetRequest)(nil), // 4: neo.fs.v2.container.GetRequest - (*GetResponse)(nil), // 5: neo.fs.v2.container.GetResponse - (*ListRequest)(nil), // 6: neo.fs.v2.container.ListRequest - (*ListResponse)(nil), // 7: neo.fs.v2.container.ListResponse - (*GetExtendedACLRequest)(nil), // 8: neo.fs.v2.container.GetExtendedACLRequest - (*GetExtendedACLResponse)(nil), // 9: neo.fs.v2.container.GetExtendedACLResponse - (*PutRequest_Body)(nil), // 10: neo.fs.v2.container.PutRequest.Body - (*PutResponse_Body)(nil), // 11: neo.fs.v2.container.PutResponse.Body - (*DeleteRequest_Body)(nil), // 12: neo.fs.v2.container.DeleteRequest.Body - (*DeleteResponse_Body)(nil), // 13: neo.fs.v2.container.DeleteResponse.Body - (*GetRequest_Body)(nil), // 14: neo.fs.v2.container.GetRequest.Body - (*GetResponse_Body)(nil), // 15: neo.fs.v2.container.GetResponse.Body - (*ListRequest_Body)(nil), // 16: neo.fs.v2.container.ListRequest.Body - (*ListResponse_Body)(nil), // 17: neo.fs.v2.container.ListResponse.Body - (*GetExtendedACLRequest_Body)(nil), // 18: neo.fs.v2.container.GetExtendedACLRequest.Body - (*GetExtendedACLResponse_Body)(nil), // 19: neo.fs.v2.container.GetExtendedACLResponse.Body - (*grpc.RequestMetaHeader)(nil), // 20: neo.fs.v2.session.RequestMetaHeader - (*grpc.RequestVerificationHeader)(nil), // 21: neo.fs.v2.session.RequestVerificationHeader - (*grpc.ResponseMetaHeader)(nil), // 22: neo.fs.v2.session.ResponseMetaHeader - (*grpc.ResponseVerificationHeader)(nil), // 23: neo.fs.v2.session.ResponseVerificationHeader - (*Container)(nil), // 24: neo.fs.v2.container.Container - (*grpc1.SignatureRFC6979)(nil), // 25: neo.fs.v2.refs.SignatureRFC6979 - (*grpc1.ContainerID)(nil), // 26: neo.fs.v2.refs.ContainerID - (*grpc.SessionToken)(nil), // 27: neo.fs.v2.session.SessionToken - (*grpc1.OwnerID)(nil), // 28: neo.fs.v2.refs.OwnerID - (*grpc2.EACLTable)(nil), // 29: neo.fs.v2.acl.EACLTable -} -var file_container_grpc_service_proto_depIdxs = []int32{ - 10, // 0: neo.fs.v2.container.PutRequest.body:type_name -> neo.fs.v2.container.PutRequest.Body - 20, // 1: neo.fs.v2.container.PutRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 21, // 2: neo.fs.v2.container.PutRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 11, // 3: neo.fs.v2.container.PutResponse.body:type_name -> neo.fs.v2.container.PutResponse.Body - 22, // 4: neo.fs.v2.container.PutResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 23, // 5: neo.fs.v2.container.PutResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 12, // 6: neo.fs.v2.container.DeleteRequest.body:type_name -> neo.fs.v2.container.DeleteRequest.Body - 20, // 7: neo.fs.v2.container.DeleteRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 21, // 8: neo.fs.v2.container.DeleteRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 13, // 9: neo.fs.v2.container.DeleteResponse.body:type_name -> neo.fs.v2.container.DeleteResponse.Body - 22, // 10: neo.fs.v2.container.DeleteResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 23, // 11: neo.fs.v2.container.DeleteResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 14, // 12: neo.fs.v2.container.GetRequest.body:type_name -> neo.fs.v2.container.GetRequest.Body - 20, // 13: neo.fs.v2.container.GetRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 21, // 14: neo.fs.v2.container.GetRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 15, // 15: neo.fs.v2.container.GetResponse.body:type_name -> neo.fs.v2.container.GetResponse.Body - 22, // 16: neo.fs.v2.container.GetResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 23, // 17: neo.fs.v2.container.GetResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 16, // 18: neo.fs.v2.container.ListRequest.body:type_name -> neo.fs.v2.container.ListRequest.Body - 20, // 19: neo.fs.v2.container.ListRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 21, // 20: neo.fs.v2.container.ListRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 17, // 21: neo.fs.v2.container.ListResponse.body:type_name -> neo.fs.v2.container.ListResponse.Body - 22, // 22: neo.fs.v2.container.ListResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 23, // 23: neo.fs.v2.container.ListResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 18, // 24: neo.fs.v2.container.GetExtendedACLRequest.body:type_name -> neo.fs.v2.container.GetExtendedACLRequest.Body - 20, // 25: neo.fs.v2.container.GetExtendedACLRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 21, // 26: neo.fs.v2.container.GetExtendedACLRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 19, // 27: neo.fs.v2.container.GetExtendedACLResponse.body:type_name -> neo.fs.v2.container.GetExtendedACLResponse.Body - 22, // 28: neo.fs.v2.container.GetExtendedACLResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 23, // 29: neo.fs.v2.container.GetExtendedACLResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 24, // 30: neo.fs.v2.container.PutRequest.Body.container:type_name -> neo.fs.v2.container.Container - 25, // 31: neo.fs.v2.container.PutRequest.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 - 26, // 32: neo.fs.v2.container.PutResponse.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 26, // 33: neo.fs.v2.container.DeleteRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 25, // 34: neo.fs.v2.container.DeleteRequest.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 - 26, // 35: neo.fs.v2.container.GetRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 24, // 36: neo.fs.v2.container.GetResponse.Body.container:type_name -> neo.fs.v2.container.Container - 25, // 37: neo.fs.v2.container.GetResponse.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 - 27, // 38: neo.fs.v2.container.GetResponse.Body.session_token:type_name -> neo.fs.v2.session.SessionToken - 28, // 39: neo.fs.v2.container.ListRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID - 26, // 40: neo.fs.v2.container.ListResponse.Body.container_ids:type_name -> neo.fs.v2.refs.ContainerID - 26, // 41: neo.fs.v2.container.GetExtendedACLRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 29, // 42: neo.fs.v2.container.GetExtendedACLResponse.Body.eacl:type_name -> neo.fs.v2.acl.EACLTable - 25, // 43: neo.fs.v2.container.GetExtendedACLResponse.Body.signature:type_name -> neo.fs.v2.refs.SignatureRFC6979 - 27, // 44: neo.fs.v2.container.GetExtendedACLResponse.Body.session_token:type_name -> neo.fs.v2.session.SessionToken - 0, // 45: neo.fs.v2.container.ContainerService.Put:input_type -> neo.fs.v2.container.PutRequest - 2, // 46: neo.fs.v2.container.ContainerService.Delete:input_type -> neo.fs.v2.container.DeleteRequest - 4, // 47: neo.fs.v2.container.ContainerService.Get:input_type -> neo.fs.v2.container.GetRequest - 6, // 48: neo.fs.v2.container.ContainerService.List:input_type -> neo.fs.v2.container.ListRequest - 8, // 49: neo.fs.v2.container.ContainerService.GetExtendedACL:input_type -> neo.fs.v2.container.GetExtendedACLRequest - 1, // 50: neo.fs.v2.container.ContainerService.Put:output_type -> neo.fs.v2.container.PutResponse - 3, // 51: neo.fs.v2.container.ContainerService.Delete:output_type -> neo.fs.v2.container.DeleteResponse - 5, // 52: neo.fs.v2.container.ContainerService.Get:output_type -> neo.fs.v2.container.GetResponse - 7, // 53: neo.fs.v2.container.ContainerService.List:output_type -> neo.fs.v2.container.ListResponse - 9, // 54: neo.fs.v2.container.ContainerService.GetExtendedACL:output_type -> neo.fs.v2.container.GetExtendedACLResponse - 50, // [50:55] is the sub-list for method output_type - 45, // [45:50] is the sub-list for method input_type - 45, // [45:45] is the sub-list for extension type_name - 45, // [45:45] is the sub-list for extension extendee - 0, // [0:45] is the sub-list for field type_name -} - -func init() { file_container_grpc_service_proto_init() } -func file_container_grpc_service_proto_init() { - if File_container_grpc_service_proto != nil { - return - } - file_container_grpc_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_container_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExtendedACLRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExtendedACLResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExtendedACLRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExtendedACLResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_container_grpc_service_proto_rawDesc, - NumEnums: 0, - NumMessages: 20, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_container_grpc_service_proto_goTypes, - DependencyIndexes: file_container_grpc_service_proto_depIdxs, - MessageInfos: file_container_grpc_service_proto_msgTypes, - }.Build() - File_container_grpc_service_proto = out.File - file_container_grpc_service_proto_rawDesc = nil - file_container_grpc_service_proto_goTypes = nil - file_container_grpc_service_proto_depIdxs = nil -} diff --git a/container/grpc/service_frostfs.pb.go b/container/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..7590435 --- /dev/null +++ b/container/grpc/service_frostfs.pb.go @@ -0,0 +1,3748 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package container + +import ( + json "encoding/json" + fmt "fmt" + grpc2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type PutRequest_Body struct { + Container *Container `json:"container"` + Signature *grpc.SignatureRFC6979 `json:"signature"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*PutRequest_Body)(nil) + _ json.Marshaler = (*PutRequest_Body)(nil) + _ json.Unmarshaler = (*PutRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Container) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutRequest_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 *PutRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Container != nil && x.Container.StableSize() != 0 { + x.Container.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil && x.Signature.StableSize() != 0 { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutRequest_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", "PutRequest_Body") + } + switch fc.FieldNum { + case 1: // Container + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Container") + } + x.Container = new(Container) + if err := x.Container.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Signature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Signature") + } + x.Signature = new(grpc.SignatureRFC6979) + if err := x.Signature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *PutRequest_Body) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} +func (x *PutRequest_Body) SetContainer(v *Container) { + x.Container = v +} +func (x *PutRequest_Body) GetSignature() *grpc.SignatureRFC6979 { + if x != nil { + return x.Signature + } + return nil +} +func (x *PutRequest_Body) SetSignature(v *grpc.SignatureRFC6979) { + x.Signature = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"container\":" + out.RawString(prefix[1:]) + x.Container.MarshalEasyJSON(out) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutRequest_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 "container": + { + var f *Container + f = new(Container) + f.UnmarshalEasyJSON(in) + x.Container = f + } + case "signature": + { + var f *grpc.SignatureRFC6979 + f = new(grpc.SignatureRFC6979) + f.UnmarshalEasyJSON(in) + x.Signature = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type PutRequest struct { + Body *PutRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutRequest)(nil) + _ encoding.ProtoUnmarshaler = (*PutRequest)(nil) + _ json.Marshaler = (*PutRequest)(nil) + _ json.Unmarshaler = (*PutRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutRequest) 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 *PutRequest) 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 *PutRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutRequest) 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 *PutRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutRequest) 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", "PutRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(PutRequest_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 *PutRequest) GetBody() *PutRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *PutRequest) SetBody(v *PutRequest_Body) { + x.Body = v +} +func (x *PutRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *PutRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *PutRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *PutRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutRequest) 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 *PutRequest_Body + f = new(PutRequest_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 PutResponse_Body struct { + ContainerId *grpc.ContainerID `json:"containerId"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*PutResponse_Body)(nil) + _ json.Marshaler = (*PutResponse_Body)(nil) + _ json.Unmarshaler = (*PutResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.ContainerId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutResponse_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 *PutResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutResponse_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", "PutResponse_Body") + } + switch fc.FieldNum { + case 1: // ContainerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerId") + } + x.ContainerId = new(grpc.ContainerID) + if err := x.ContainerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *PutResponse_Body) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} +func (x *PutResponse_Body) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"containerId\":" + out.RawString(prefix[1:]) + x.ContainerId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutResponse_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 "containerId": + { + var f *grpc.ContainerID + f = new(grpc.ContainerID) + f.UnmarshalEasyJSON(in) + x.ContainerId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type PutResponse struct { + Body *PutResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutResponse)(nil) + _ encoding.ProtoUnmarshaler = (*PutResponse)(nil) + _ json.Marshaler = (*PutResponse)(nil) + _ json.Unmarshaler = (*PutResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutResponse) 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 *PutResponse) 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 *PutResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutResponse) 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 *PutResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutResponse) 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", "PutResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(PutResponse_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 *PutResponse) GetBody() *PutResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *PutResponse) SetBody(v *PutResponse_Body) { + x.Body = v +} +func (x *PutResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *PutResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *PutResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *PutResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutResponse) 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 *PutResponse_Body + f = new(PutResponse_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() + } +} + +type DeleteRequest_Body struct { + ContainerId *grpc.ContainerID `json:"containerId"` + Signature *grpc.SignatureRFC6979 `json:"signature"` +} + +var ( + _ encoding.ProtoMarshaler = (*DeleteRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*DeleteRequest_Body)(nil) + _ json.Marshaler = (*DeleteRequest_Body)(nil) + _ json.Unmarshaler = (*DeleteRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *DeleteRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.ContainerId) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *DeleteRequest_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 *DeleteRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil && x.Signature.StableSize() != 0 { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *DeleteRequest_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", "DeleteRequest_Body") + } + switch fc.FieldNum { + case 1: // ContainerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerId") + } + x.ContainerId = new(grpc.ContainerID) + if err := x.ContainerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Signature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Signature") + } + x.Signature = new(grpc.SignatureRFC6979) + if err := x.Signature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *DeleteRequest_Body) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} +func (x *DeleteRequest_Body) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} +func (x *DeleteRequest_Body) GetSignature() *grpc.SignatureRFC6979 { + if x != nil { + return x.Signature + } + return nil +} +func (x *DeleteRequest_Body) SetSignature(v *grpc.SignatureRFC6979) { + x.Signature = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *DeleteRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *DeleteRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"containerId\":" + out.RawString(prefix[1:]) + x.ContainerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *DeleteRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *DeleteRequest_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 "containerId": + { + var f *grpc.ContainerID + f = new(grpc.ContainerID) + f.UnmarshalEasyJSON(in) + x.ContainerId = f + } + case "signature": + { + var f *grpc.SignatureRFC6979 + f = new(grpc.SignatureRFC6979) + f.UnmarshalEasyJSON(in) + x.Signature = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type DeleteRequest struct { + Body *DeleteRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*DeleteRequest)(nil) + _ encoding.ProtoUnmarshaler = (*DeleteRequest)(nil) + _ json.Marshaler = (*DeleteRequest)(nil) + _ json.Unmarshaler = (*DeleteRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *DeleteRequest) 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 *DeleteRequest) 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 *DeleteRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *DeleteRequest) 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 *DeleteRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *DeleteRequest) 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", "DeleteRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(DeleteRequest_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 *DeleteRequest) GetBody() *DeleteRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *DeleteRequest) SetBody(v *DeleteRequest_Body) { + x.Body = v +} +func (x *DeleteRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *DeleteRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *DeleteRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *DeleteRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *DeleteRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *DeleteRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *DeleteRequest) 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 *DeleteRequest_Body + f = new(DeleteRequest_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 DeleteResponse_Body struct { +} + +var ( + _ encoding.ProtoMarshaler = (*DeleteResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*DeleteResponse_Body)(nil) + _ json.Marshaler = (*DeleteResponse_Body)(nil) + _ json.Unmarshaler = (*DeleteResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *DeleteResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *DeleteResponse_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 *DeleteResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *DeleteResponse_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", "DeleteResponse_Body") + } + switch fc.FieldNum { + } + } + return nil +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *DeleteResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *DeleteResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *DeleteResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *DeleteResponse_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 { + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type DeleteResponse struct { + Body *DeleteResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*DeleteResponse)(nil) + _ encoding.ProtoUnmarshaler = (*DeleteResponse)(nil) + _ json.Marshaler = (*DeleteResponse)(nil) + _ json.Unmarshaler = (*DeleteResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *DeleteResponse) 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 *DeleteResponse) 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 *DeleteResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *DeleteResponse) 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 *DeleteResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *DeleteResponse) 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", "DeleteResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(DeleteResponse_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 *DeleteResponse) GetBody() *DeleteResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *DeleteResponse) SetBody(v *DeleteResponse_Body) { + x.Body = v +} +func (x *DeleteResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *DeleteResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *DeleteResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *DeleteResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *DeleteResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *DeleteResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *DeleteResponse) 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 *DeleteResponse_Body + f = new(DeleteResponse_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() + } +} + +type GetRequest_Body struct { + ContainerId *grpc.ContainerID `json:"containerId"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*GetRequest_Body)(nil) + _ json.Marshaler = (*GetRequest_Body)(nil) + _ json.Unmarshaler = (*GetRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.ContainerId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRequest_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 *GetRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRequest_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", "GetRequest_Body") + } + switch fc.FieldNum { + case 1: // ContainerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerId") + } + x.ContainerId = new(grpc.ContainerID) + if err := x.ContainerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *GetRequest_Body) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} +func (x *GetRequest_Body) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"containerId\":" + out.RawString(prefix[1:]) + x.ContainerId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRequest_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 "containerId": + { + var f *grpc.ContainerID + f = new(grpc.ContainerID) + f.UnmarshalEasyJSON(in) + x.ContainerId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type GetRequest struct { + Body *GetRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRequest)(nil) + _ encoding.ProtoUnmarshaler = (*GetRequest)(nil) + _ json.Marshaler = (*GetRequest)(nil) + _ json.Unmarshaler = (*GetRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRequest) 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 *GetRequest) 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 *GetRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRequest) 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 *GetRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRequest) 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", "GetRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(GetRequest_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 *GetRequest) GetBody() *GetRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *GetRequest) SetBody(v *GetRequest_Body) { + x.Body = v +} +func (x *GetRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *GetRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *GetRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *GetRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRequest) 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 *GetRequest_Body + f = new(GetRequest_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 GetResponse_Body struct { + Container *Container `json:"container"` + Signature *grpc.SignatureRFC6979 `json:"signature"` + SessionToken *grpc1.SessionToken `json:"sessionToken"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*GetResponse_Body)(nil) + _ json.Marshaler = (*GetResponse_Body)(nil) + _ json.Unmarshaler = (*GetResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Container) + size += proto.NestedStructureSize(2, x.Signature) + size += proto.NestedStructureSize(3, x.SessionToken) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetResponse_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 *GetResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Container != nil && x.Container.StableSize() != 0 { + x.Container.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil && x.Signature.StableSize() != 0 { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.SessionToken != nil && x.SessionToken.StableSize() != 0 { + x.SessionToken.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetResponse_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", "GetResponse_Body") + } + switch fc.FieldNum { + case 1: // Container + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Container") + } + x.Container = new(Container) + if err := x.Container.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Signature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Signature") + } + x.Signature = new(grpc.SignatureRFC6979) + if err := x.Signature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // SessionToken + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SessionToken") + } + x.SessionToken = new(grpc1.SessionToken) + if err := x.SessionToken.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *GetResponse_Body) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} +func (x *GetResponse_Body) SetContainer(v *Container) { + x.Container = v +} +func (x *GetResponse_Body) GetSignature() *grpc.SignatureRFC6979 { + if x != nil { + return x.Signature + } + return nil +} +func (x *GetResponse_Body) SetSignature(v *grpc.SignatureRFC6979) { + x.Signature = v +} +func (x *GetResponse_Body) GetSessionToken() *grpc1.SessionToken { + if x != nil { + return x.SessionToken + } + return nil +} +func (x *GetResponse_Body) SetSessionToken(v *grpc1.SessionToken) { + x.SessionToken = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"container\":" + out.RawString(prefix[1:]) + x.Container.MarshalEasyJSON(out) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetResponse_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 "container": + { + var f *Container + f = new(Container) + f.UnmarshalEasyJSON(in) + x.Container = f + } + case "signature": + { + var f *grpc.SignatureRFC6979 + f = new(grpc.SignatureRFC6979) + f.UnmarshalEasyJSON(in) + x.Signature = f + } + case "sessionToken": + { + var f *grpc1.SessionToken + f = new(grpc1.SessionToken) + f.UnmarshalEasyJSON(in) + x.SessionToken = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type GetResponse struct { + Body *GetResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetResponse)(nil) + _ encoding.ProtoUnmarshaler = (*GetResponse)(nil) + _ json.Marshaler = (*GetResponse)(nil) + _ json.Unmarshaler = (*GetResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetResponse) 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 *GetResponse) 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 *GetResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetResponse) 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 *GetResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetResponse) 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", "GetResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(GetResponse_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 *GetResponse) GetBody() *GetResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *GetResponse) SetBody(v *GetResponse_Body) { + x.Body = v +} +func (x *GetResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *GetResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *GetResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *GetResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetResponse) 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 *GetResponse_Body + f = new(GetResponse_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() + } +} + +type ListRequest_Body struct { + OwnerId *grpc.OwnerID `json:"ownerId"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*ListRequest_Body)(nil) + _ json.Marshaler = (*ListRequest_Body)(nil) + _ json.Unmarshaler = (*ListRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListRequest_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 *ListRequest_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 *ListRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ListRequest_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", "ListRequest_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 *ListRequest_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *ListRequest_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"ownerId\":" + out.RawString(prefix[1:]) + x.OwnerId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListRequest_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 ListRequest struct { + Body *ListRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListRequest)(nil) + _ encoding.ProtoUnmarshaler = (*ListRequest)(nil) + _ json.Marshaler = (*ListRequest)(nil) + _ json.Unmarshaler = (*ListRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListRequest) 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 *ListRequest) 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 *ListRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ListRequest) 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 *ListRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ListRequest) 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", "ListRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(ListRequest_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 *ListRequest) GetBody() *ListRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *ListRequest) SetBody(v *ListRequest_Body) { + x.Body = v +} +func (x *ListRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *ListRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *ListRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *ListRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListRequest) 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 *ListRequest_Body + f = new(ListRequest_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 ListResponse_Body struct { + ContainerIds []*grpc.ContainerID `json:"containerIds"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*ListResponse_Body)(nil) + _ json.Marshaler = (*ListResponse_Body)(nil) + _ json.Unmarshaler = (*ListResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.ContainerIds { + size += proto.NestedStructureSize(1, x.ContainerIds[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ListResponse_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 *ListResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + for i := range x.ContainerIds { + if x.ContainerIds[i] != nil && x.ContainerIds[i].StableSize() != 0 { + x.ContainerIds[i].EmitProtobuf(mm.AppendMessage(1)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ListResponse_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", "ListResponse_Body") + } + switch fc.FieldNum { + case 1: // ContainerIds + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerIds") + } + x.ContainerIds = append(x.ContainerIds, new(grpc.ContainerID)) + ff := x.ContainerIds[len(x.ContainerIds)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *ListResponse_Body) GetContainerIds() []*grpc.ContainerID { + if x != nil { + return x.ContainerIds + } + return nil +} +func (x *ListResponse_Body) SetContainerIds(v []*grpc.ContainerID) { + x.ContainerIds = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"containerIds\":" + out.RawString(prefix[1:]) + out.RawByte('[') + for i := range x.ContainerIds { + if i != 0 { + out.RawByte(',') + } + x.ContainerIds[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListResponse_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 "containerIds": + { + var f *grpc.ContainerID + var list []*grpc.ContainerID + in.Delim('[') + for !in.IsDelim(']') { + f = new(grpc.ContainerID) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.ContainerIds = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ListResponse struct { + Body *ListResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*ListResponse)(nil) + _ encoding.ProtoUnmarshaler = (*ListResponse)(nil) + _ json.Marshaler = (*ListResponse)(nil) + _ json.Unmarshaler = (*ListResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ListResponse) 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 *ListResponse) 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 *ListResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ListResponse) 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 *ListResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ListResponse) 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", "ListResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(ListResponse_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 *ListResponse) GetBody() *ListResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *ListResponse) SetBody(v *ListResponse_Body) { + x.Body = v +} +func (x *ListResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *ListResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *ListResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *ListResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ListResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ListResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ListResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ListResponse) 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 *ListResponse_Body + f = new(ListResponse_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() + } +} + +type GetExtendedACLRequest_Body struct { + ContainerId *grpc.ContainerID `json:"containerId"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetExtendedACLRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*GetExtendedACLRequest_Body)(nil) + _ json.Marshaler = (*GetExtendedACLRequest_Body)(nil) + _ json.Unmarshaler = (*GetExtendedACLRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetExtendedACLRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.ContainerId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetExtendedACLRequest_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 *GetExtendedACLRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetExtendedACLRequest_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", "GetExtendedACLRequest_Body") + } + switch fc.FieldNum { + case 1: // ContainerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerId") + } + x.ContainerId = new(grpc.ContainerID) + if err := x.ContainerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *GetExtendedACLRequest_Body) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} +func (x *GetExtendedACLRequest_Body) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetExtendedACLRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetExtendedACLRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"containerId\":" + out.RawString(prefix[1:]) + x.ContainerId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetExtendedACLRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetExtendedACLRequest_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 "containerId": + { + var f *grpc.ContainerID + f = new(grpc.ContainerID) + f.UnmarshalEasyJSON(in) + x.ContainerId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type GetExtendedACLRequest struct { + Body *GetExtendedACLRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetExtendedACLRequest)(nil) + _ encoding.ProtoUnmarshaler = (*GetExtendedACLRequest)(nil) + _ json.Marshaler = (*GetExtendedACLRequest)(nil) + _ json.Unmarshaler = (*GetExtendedACLRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetExtendedACLRequest) 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 *GetExtendedACLRequest) 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 *GetExtendedACLRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetExtendedACLRequest) 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 *GetExtendedACLRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetExtendedACLRequest) 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", "GetExtendedACLRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(GetExtendedACLRequest_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 *GetExtendedACLRequest) GetBody() *GetExtendedACLRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *GetExtendedACLRequest) SetBody(v *GetExtendedACLRequest_Body) { + x.Body = v +} +func (x *GetExtendedACLRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *GetExtendedACLRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *GetExtendedACLRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *GetExtendedACLRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetExtendedACLRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetExtendedACLRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetExtendedACLRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetExtendedACLRequest) 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 *GetExtendedACLRequest_Body + f = new(GetExtendedACLRequest_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 GetExtendedACLResponse_Body struct { + Eacl *grpc2.EACLTable `json:"eacl"` + Signature *grpc.SignatureRFC6979 `json:"signature"` + SessionToken *grpc1.SessionToken `json:"sessionToken"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetExtendedACLResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*GetExtendedACLResponse_Body)(nil) + _ json.Marshaler = (*GetExtendedACLResponse_Body)(nil) + _ json.Unmarshaler = (*GetExtendedACLResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetExtendedACLResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Eacl) + size += proto.NestedStructureSize(2, x.Signature) + size += proto.NestedStructureSize(3, x.SessionToken) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetExtendedACLResponse_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 *GetExtendedACLResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Eacl != nil && x.Eacl.StableSize() != 0 { + x.Eacl.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil && x.Signature.StableSize() != 0 { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.SessionToken != nil && x.SessionToken.StableSize() != 0 { + x.SessionToken.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetExtendedACLResponse_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", "GetExtendedACLResponse_Body") + } + switch fc.FieldNum { + case 1: // Eacl + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Eacl") + } + x.Eacl = new(grpc2.EACLTable) + if err := x.Eacl.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Signature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Signature") + } + x.Signature = new(grpc.SignatureRFC6979) + if err := x.Signature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // SessionToken + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SessionToken") + } + x.SessionToken = new(grpc1.SessionToken) + if err := x.SessionToken.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *GetExtendedACLResponse_Body) GetEacl() *grpc2.EACLTable { + if x != nil { + return x.Eacl + } + return nil +} +func (x *GetExtendedACLResponse_Body) SetEacl(v *grpc2.EACLTable) { + x.Eacl = v +} +func (x *GetExtendedACLResponse_Body) GetSignature() *grpc.SignatureRFC6979 { + if x != nil { + return x.Signature + } + return nil +} +func (x *GetExtendedACLResponse_Body) SetSignature(v *grpc.SignatureRFC6979) { + x.Signature = v +} +func (x *GetExtendedACLResponse_Body) GetSessionToken() *grpc1.SessionToken { + if x != nil { + return x.SessionToken + } + return nil +} +func (x *GetExtendedACLResponse_Body) SetSessionToken(v *grpc1.SessionToken) { + x.SessionToken = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetExtendedACLResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetExtendedACLResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"eacl\":" + out.RawString(prefix[1:]) + x.Eacl.MarshalEasyJSON(out) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetExtendedACLResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetExtendedACLResponse_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 "eacl": + { + var f *grpc2.EACLTable + f = new(grpc2.EACLTable) + f.UnmarshalEasyJSON(in) + x.Eacl = f + } + case "signature": + { + var f *grpc.SignatureRFC6979 + f = new(grpc.SignatureRFC6979) + f.UnmarshalEasyJSON(in) + x.Signature = f + } + case "sessionToken": + { + var f *grpc1.SessionToken + f = new(grpc1.SessionToken) + f.UnmarshalEasyJSON(in) + x.SessionToken = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type GetExtendedACLResponse struct { + Body *GetExtendedACLResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetExtendedACLResponse)(nil) + _ encoding.ProtoUnmarshaler = (*GetExtendedACLResponse)(nil) + _ json.Marshaler = (*GetExtendedACLResponse)(nil) + _ json.Unmarshaler = (*GetExtendedACLResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetExtendedACLResponse) 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 *GetExtendedACLResponse) 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 *GetExtendedACLResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetExtendedACLResponse) 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 *GetExtendedACLResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetExtendedACLResponse) 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", "GetExtendedACLResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(GetExtendedACLResponse_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 *GetExtendedACLResponse) GetBody() *GetExtendedACLResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponse_Body) { + x.Body = v +} +func (x *GetExtendedACLResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *GetExtendedACLResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *GetExtendedACLResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *GetExtendedACLResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetExtendedACLResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetExtendedACLResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetExtendedACLResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetExtendedACLResponse) 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 *GetExtendedACLResponse_Body + f = new(GetExtendedACLResponse_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() + } +} diff --git a/container/grpc/service_frostfs_fuzz.go b/container/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..496a2d6 --- /dev/null +++ b/container/grpc/service_frostfs_fuzz.go @@ -0,0 +1,197 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package container + +func DoFuzzProtoPutRequest(data []byte) int { + msg := new(PutRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONPutRequest(data []byte) int { + msg := new(PutRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoPutResponse(data []byte) int { + msg := new(PutResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONPutResponse(data []byte) int { + msg := new(PutResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoDeleteRequest(data []byte) int { + msg := new(DeleteRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONDeleteRequest(data []byte) int { + msg := new(DeleteRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoDeleteResponse(data []byte) int { + msg := new(DeleteResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONDeleteResponse(data []byte) int { + msg := new(DeleteResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoGetRequest(data []byte) int { + msg := new(GetRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONGetRequest(data []byte) int { + msg := new(GetRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoGetResponse(data []byte) int { + msg := new(GetResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONGetResponse(data []byte) int { + msg := new(GetResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoListRequest(data []byte) int { + msg := new(ListRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONListRequest(data []byte) int { + msg := new(ListRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoListResponse(data []byte) int { + msg := new(ListResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONListResponse(data []byte) int { + msg := new(ListResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoGetExtendedACLRequest(data []byte) int { + msg := new(GetExtendedACLRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONGetExtendedACLRequest(data []byte) int { + msg := new(GetExtendedACLRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoGetExtendedACLResponse(data []byte) int { + msg := new(GetExtendedACLResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONGetExtendedACLResponse(data []byte) int { + msg := new(GetExtendedACLResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/container/grpc/service_frostfs_test.go b/container/grpc/service_frostfs_test.go new file mode 100644 index 0000000..05eb48a --- /dev/null +++ b/container/grpc/service_frostfs_test.go @@ -0,0 +1,111 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package container + +import ( + testing "testing" +) + +func FuzzProtoPutRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoPutRequest(data) + }) +} +func FuzzJSONPutRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONPutRequest(data) + }) +} +func FuzzProtoPutResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoPutResponse(data) + }) +} +func FuzzJSONPutResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONPutResponse(data) + }) +} +func FuzzProtoDeleteRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoDeleteRequest(data) + }) +} +func FuzzJSONDeleteRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONDeleteRequest(data) + }) +} +func FuzzProtoDeleteResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoDeleteResponse(data) + }) +} +func FuzzJSONDeleteResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONDeleteResponse(data) + }) +} +func FuzzProtoGetRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoGetRequest(data) + }) +} +func FuzzJSONGetRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONGetRequest(data) + }) +} +func FuzzProtoGetResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoGetResponse(data) + }) +} +func FuzzJSONGetResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONGetResponse(data) + }) +} +func FuzzProtoListRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoListRequest(data) + }) +} +func FuzzJSONListRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONListRequest(data) + }) +} +func FuzzProtoListResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoListResponse(data) + }) +} +func FuzzJSONListResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONListResponse(data) + }) +} +func FuzzProtoGetExtendedACLRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoGetExtendedACLRequest(data) + }) +} +func FuzzJSONGetExtendedACLRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONGetExtendedACLRequest(data) + }) +} +func FuzzProtoGetExtendedACLResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoGetExtendedACLResponse(data) + }) +} +func FuzzJSONGetExtendedACLResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONGetExtendedACLResponse(data) + }) +} diff --git a/container/grpc/types.go b/container/grpc/types.go deleted file mode 100644 index 7308f9e..0000000 --- a/container/grpc/types.go +++ /dev/null @@ -1,46 +0,0 @@ -package container - -import ( - netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" -) - -// SetKey sets key to the container attribute. -func (m *Container_Attribute) SetKey(v string) { - m.Key = v -} - -// SetValue sets value of the container attribute. -func (m *Container_Attribute) SetValue(v string) { - m.Value = v -} - -// SetOwnerId sets identifier of the container owner, -func (m *Container) SetOwnerId(v *refs.OwnerID) { - m.OwnerId = v -} - -// SetNonce sets nonce of the container structure. -func (m *Container) SetNonce(v []byte) { - m.Nonce = v -} - -// SetBasicAcl sets basic ACL of the container. -func (m *Container) SetBasicAcl(v uint32) { - m.BasicAcl = v -} - -// SetAttributes sets list of the container attributes. -func (m *Container) SetAttributes(v []*Container_Attribute) { - m.Attributes = v -} - -// SetPlacementPolicy sets placement policy of the container. -func (m *Container) SetPlacementPolicy(v *netmap.PlacementPolicy) { - m.PlacementPolicy = v -} - -// SetVersion sets version of the container. -func (m *Container) SetVersion(v *refs.Version) { - m.Version = v -} diff --git a/container/grpc/types.pb.go b/container/grpc/types.pb.go deleted file mode 100644 index d0e19ec..0000000 --- a/container/grpc/types.pb.go +++ /dev/null @@ -1,337 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: container/grpc/types.proto - -package container - -import ( - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Container is a structure that defines object placement behaviour. Objects can -// be stored only within containers. They define placement rule, attributes and -// access control information. An ID of a container is a 32 byte long SHA256 -// hash of stable-marshalled container message. -type Container struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Container format version. Effectively, the version of API library used to - // create the container. - Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Identifier of the container owner - OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` - // Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s - Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` - // `BasicACL` contains access control rules for the owner, system and others - // groups, as well as permission bits for `BearerToken` and `Extended ACL` - BasicAcl uint32 `protobuf:"varint,4,opt,name=basic_acl,json=basicACL,proto3" json:"basic_acl,omitempty"` - // Attributes represent immutable container's meta data - Attributes []*Container_Attribute `protobuf:"bytes,5,rep,name=attributes,proto3" json:"attributes,omitempty"` - // Placement policy for the object inside the container - PlacementPolicy *grpc1.PlacementPolicy `protobuf:"bytes,6,opt,name=placement_policy,json=placementPolicy,proto3" json:"placement_policy,omitempty"` -} - -func (x *Container) Reset() { - *x = Container{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Container) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Container) ProtoMessage() {} - -func (x *Container) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Container.ProtoReflect.Descriptor instead. -func (*Container) Descriptor() ([]byte, []int) { - return file_container_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *Container) GetVersion() *grpc.Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *Container) GetOwnerId() *grpc.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} - -func (x *Container) GetNonce() []byte { - if x != nil { - return x.Nonce - } - return nil -} - -func (x *Container) GetBasicAcl() uint32 { - if x != nil { - return x.BasicAcl - } - return 0 -} - -func (x *Container) GetAttributes() []*Container_Attribute { - if x != nil { - return x.Attributes - } - return nil -} - -func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { - if x != nil { - return x.PlacementPolicy - } - return nil -} - -// `Attribute` is a user-defined Key-Value metadata pair attached to the -// container. Container attributes are immutable. They are set at the moment -// of container creation and can never be added or updated. -// -// Key name must be a container-unique valid UTF-8 string. Value can't be -// empty. Containers with duplicated attribute names or attributes with empty -// values will be considered invalid. -// -// There are some "well-known" attributes affecting system behaviour: -// -// - [ __SYSTEM__NAME ] \ -// (`__NEOFS__NAME` is deprecated) \ -// String of a human-friendly container name registered as a domain in -// NNS contract. -// - [ __SYSTEM__ZONE ] \ -// (`__NEOFS__ZONE` is deprecated) \ -// String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). -// Used as a TLD of a domain name in NNS contract. If no zone is specified, -// use default zone: `container`. -// - [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \ -// (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ -// Disables homomorphic hashing for the container if the value equals "true" -// string. Any other values are interpreted as missing attribute. Container -// could be accepted in a NeoFS network only if the global network hashing -// configuration value corresponds with that attribute's value. After -// container inclusion, network setting is ignored. -// -// And some well-known attributes used by applications only: -// -// - Name \ -// Human-friendly name -// - Timestamp \ -// User-defined local time of container creation in Unix Timestamp format -type Container_Attribute struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Attribute name key - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Attribute value - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Container_Attribute) Reset() { - *x = Container_Attribute{} - if protoimpl.UnsafeEnabled { - mi := &file_container_grpc_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Container_Attribute) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Container_Attribute) ProtoMessage() {} - -func (x *Container_Attribute) ProtoReflect() protoreflect.Message { - mi := &file_container_grpc_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Container_Attribute.ProtoReflect.Descriptor instead. -func (*Container_Attribute) Descriptor() ([]byte, []int) { - return file_container_grpc_types_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *Container_Attribute) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Container_Attribute) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -var File_container_grpc_types_proto protoreflect.FileDescriptor - -var file_container_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x1a, 0x17, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xf2, 0x02, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, - 0x31, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, - 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x08, 0x62, 0x61, 0x73, 0x69, 0x63, 0x41, 0x43, 0x4c, 0x12, 0x48, 0x0a, 0x0a, 0x61, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x1a, 0x33, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x6a, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, - 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0xaa, 0x02, 0x1d, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_container_grpc_types_proto_rawDescOnce sync.Once - file_container_grpc_types_proto_rawDescData = file_container_grpc_types_proto_rawDesc -) - -func file_container_grpc_types_proto_rawDescGZIP() []byte { - file_container_grpc_types_proto_rawDescOnce.Do(func() { - file_container_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_container_grpc_types_proto_rawDescData) - }) - return file_container_grpc_types_proto_rawDescData -} - -var file_container_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_container_grpc_types_proto_goTypes = []interface{}{ - (*Container)(nil), // 0: neo.fs.v2.container.Container - (*Container_Attribute)(nil), // 1: neo.fs.v2.container.Container.Attribute - (*grpc.Version)(nil), // 2: neo.fs.v2.refs.Version - (*grpc.OwnerID)(nil), // 3: neo.fs.v2.refs.OwnerID - (*grpc1.PlacementPolicy)(nil), // 4: neo.fs.v2.netmap.PlacementPolicy -} -var file_container_grpc_types_proto_depIdxs = []int32{ - 2, // 0: neo.fs.v2.container.Container.version:type_name -> neo.fs.v2.refs.Version - 3, // 1: neo.fs.v2.container.Container.owner_id:type_name -> neo.fs.v2.refs.OwnerID - 1, // 2: neo.fs.v2.container.Container.attributes:type_name -> neo.fs.v2.container.Container.Attribute - 4, // 3: neo.fs.v2.container.Container.placement_policy:type_name -> neo.fs.v2.netmap.PlacementPolicy - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_container_grpc_types_proto_init() } -func file_container_grpc_types_proto_init() { - if File_container_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_container_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Container); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_container_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Container_Attribute); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_container_grpc_types_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_container_grpc_types_proto_goTypes, - DependencyIndexes: file_container_grpc_types_proto_depIdxs, - MessageInfos: file_container_grpc_types_proto_msgTypes, - }.Build() - File_container_grpc_types_proto = out.File - file_container_grpc_types_proto_rawDesc = nil - file_container_grpc_types_proto_goTypes = nil - file_container_grpc_types_proto_depIdxs = nil -} diff --git a/container/grpc/types_frostfs.pb.go b/container/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..3e0d882 --- /dev/null +++ b/container/grpc/types_frostfs.pb.go @@ -0,0 +1,495 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package container + +import ( + json "encoding/json" + fmt "fmt" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type Container_Attribute struct { + Key string `json:"key"` + Value string `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*Container_Attribute)(nil) + _ encoding.ProtoUnmarshaler = (*Container_Attribute)(nil) + _ json.Marshaler = (*Container_Attribute)(nil) + _ json.Unmarshaler = (*Container_Attribute)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Container_Attribute) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.StringSize(1, x.Key) + size += proto.StringSize(2, x.Value) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Container_Attribute) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Container_Attribute) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Key) != 0 { + mm.AppendString(1, x.Key) + } + if len(x.Value) != 0 { + mm.AppendString(2, x.Value) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Container_Attribute) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Container_Attribute") + } + switch fc.FieldNum { + case 1: // Key + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Key") + } + x.Key = data + case 2: // Value + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + } + } + return nil +} +func (x *Container_Attribute) GetKey() string { + if x != nil { + return x.Key + } + return "" +} +func (x *Container_Attribute) SetKey(v string) { + x.Key = v +} +func (x *Container_Attribute) GetValue() string { + if x != nil { + return x.Value + } + return "" +} +func (x *Container_Attribute) SetValue(v string) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Container_Attribute) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"key\":" + out.RawString(prefix[1:]) + out.String(x.Key) + } + { + const prefix string = ",\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Container_Attribute) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Container_Attribute) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "key": + { + var f string + f = in.String() + x.Key = f + } + case "value": + { + var f string + f = in.String() + x.Value = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Container struct { + Version *grpc.Version `json:"version"` + OwnerId *grpc.OwnerID `json:"ownerID"` + Nonce []byte `json:"nonce"` + BasicAcl uint32 `json:"basicACL"` + Attributes []*Container_Attribute `json:"attributes"` + PlacementPolicy *grpc1.PlacementPolicy `json:"placementPolicy"` +} + +var ( + _ encoding.ProtoMarshaler = (*Container)(nil) + _ encoding.ProtoUnmarshaler = (*Container)(nil) + _ json.Marshaler = (*Container)(nil) + _ json.Unmarshaler = (*Container)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Container) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Version) + size += proto.NestedStructureSize(2, x.OwnerId) + size += proto.BytesSize(3, x.Nonce) + size += proto.UInt32Size(4, x.BasicAcl) + for i := range x.Attributes { + size += proto.NestedStructureSize(5, x.Attributes[i]) + } + size += proto.NestedStructureSize(6, x.PlacementPolicy) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Container) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Container) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Version != nil && x.Version.StableSize() != 0 { + x.Version.EmitProtobuf(mm.AppendMessage(1)) + } + if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + x.OwnerId.EmitProtobuf(mm.AppendMessage(2)) + } + if len(x.Nonce) != 0 { + mm.AppendBytes(3, x.Nonce) + } + if x.BasicAcl != 0 { + mm.AppendUint32(4, x.BasicAcl) + } + for i := range x.Attributes { + if x.Attributes[i] != nil && x.Attributes[i].StableSize() != 0 { + x.Attributes[i].EmitProtobuf(mm.AppendMessage(5)) + } + } + if x.PlacementPolicy != nil && x.PlacementPolicy.StableSize() != 0 { + x.PlacementPolicy.EmitProtobuf(mm.AppendMessage(6)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Container) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Container") + } + switch fc.FieldNum { + case 1: // Version + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Version") + } + x.Version = new(grpc.Version) + if err := x.Version.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // OwnerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "OwnerId") + } + x.OwnerId = new(grpc.OwnerID) + if err := x.OwnerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // Nonce + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Nonce") + } + x.Nonce = data + case 4: // BasicAcl + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "BasicAcl") + } + x.BasicAcl = data + case 5: // Attributes + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Attributes") + } + x.Attributes = append(x.Attributes, new(Container_Attribute)) + ff := x.Attributes[len(x.Attributes)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 6: // PlacementPolicy + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "PlacementPolicy") + } + x.PlacementPolicy = new(grpc1.PlacementPolicy) + if err := x.PlacementPolicy.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Container) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} +func (x *Container) SetVersion(v *grpc.Version) { + x.Version = v +} +func (x *Container) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *Container) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} +func (x *Container) GetNonce() []byte { + if x != nil { + return x.Nonce + } + return nil +} +func (x *Container) SetNonce(v []byte) { + x.Nonce = v +} +func (x *Container) GetBasicAcl() uint32 { + if x != nil { + return x.BasicAcl + } + return 0 +} +func (x *Container) SetBasicAcl(v uint32) { + x.BasicAcl = v +} +func (x *Container) GetAttributes() []*Container_Attribute { + if x != nil { + return x.Attributes + } + return nil +} +func (x *Container) SetAttributes(v []*Container_Attribute) { + x.Attributes = v +} +func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { + if x != nil { + return x.PlacementPolicy + } + return nil +} +func (x *Container) SetPlacementPolicy(v *grpc1.PlacementPolicy) { + x.PlacementPolicy = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Container) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Container) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"version\":" + out.RawString(prefix[1:]) + x.Version.MarshalEasyJSON(out) + } + { + const prefix string = ",\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"nonce\":" + out.RawString(prefix) + out.Base64Bytes(x.Nonce) + } + { + const prefix string = ",\"basicACL\":" + out.RawString(prefix) + out.Uint32(x.BasicAcl) + } + { + const prefix string = ",\"attributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Attributes { + if i != 0 { + out.RawByte(',') + } + x.Attributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"placementPolicy\":" + out.RawString(prefix) + x.PlacementPolicy.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Container) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Container) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "version": + { + var f *grpc.Version + f = new(grpc.Version) + f.UnmarshalEasyJSON(in) + x.Version = f + } + case "ownerID": + { + var f *grpc.OwnerID + f = new(grpc.OwnerID) + f.UnmarshalEasyJSON(in) + x.OwnerId = f + } + case "nonce": + { + var f []byte + f = in.Bytes() + x.Nonce = f + } + case "basicACL": + { + var f uint32 + f = in.Uint32() + x.BasicAcl = f + } + case "attributes": + { + var f *Container_Attribute + var list []*Container_Attribute + in.Delim('[') + for !in.IsDelim(']') { + f = new(Container_Attribute) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Attributes = list + in.Delim(']') + } + case "placementPolicy": + { + var f *grpc1.PlacementPolicy + f = new(grpc1.PlacementPolicy) + f.UnmarshalEasyJSON(in) + x.PlacementPolicy = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/container/grpc/types_frostfs_fuzz.go b/container/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..5551978 --- /dev/null +++ b/container/grpc/types_frostfs_fuzz.go @@ -0,0 +1,26 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package container + +func DoFuzzProtoContainer(data []byte) int { + msg := new(Container) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONContainer(data []byte) int { + msg := new(Container) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/container/grpc/types_frostfs_test.go b/container/grpc/types_frostfs_test.go new file mode 100644 index 0000000..64d840e --- /dev/null +++ b/container/grpc/types_frostfs_test.go @@ -0,0 +1,21 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package container + +import ( + testing "testing" +) + +func FuzzProtoContainer(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoContainer(data) + }) +} +func FuzzJSONContainer(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONContainer(data) + }) +} diff --git a/go.mod b/go.mod index e00f012..13fa1b7 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,8 @@ go 1.20 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 + github.com/VictoriaMetrics/easyproto v0.1.4 + github.com/mailru/easyjson v0.7.7 github.com/stretchr/testify v1.8.3 golang.org/x/sync v0.6.0 google.golang.org/grpc v1.63.2 @@ -13,6 +15,7 @@ require ( require ( git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/kr/pretty v0.1.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/go.sum b/go.sum index 6ce46f7..620642f 100644 --- a/go.sum +++ b/go.sum @@ -2,15 +2,21 @@ git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSV git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0/go.mod h1:RUIKZATQLJ+TaYQa60X2fTDwfuhMfm8Ar60bQ5fr+vU= git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9mwVfJ+SjT3HA= git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc= +github.com/VictoriaMetrics/easyproto v0.1.4 h1:r8cNvo8o6sR4QShBXQd1bKw/VVLSQma/V2KhTBPf+Sc= +github.com/VictoriaMetrics/easyproto v0.1.4/go.mod h1:QlGlzaJnDfFd8Lk6Ci/fuLxfTo3/GThPs2KH23mv710= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/lock/grpc/types.go b/lock/grpc/types.go deleted file mode 100644 index 9d5719f..0000000 --- a/lock/grpc/types.go +++ /dev/null @@ -1,8 +0,0 @@ -package lock - -import refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - -// SetMembers sets `members` field. -func (x *Lock) SetMembers(ids []*refs.ObjectID) { - x.Members = ids -} diff --git a/lock/grpc/types.pb.go b/lock/grpc/types.pb.go deleted file mode 100644 index 38b62fe..0000000 --- a/lock/grpc/types.pb.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: lock/grpc/types.proto - -package lock - -import ( - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Lock objects protects a list of objects from being deleted. The lifetime of a -// lock object is limited similar to regular objects in -// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) -// attribute. Lock object MUST have expiration epoch. It is impossible to delete -// a lock object via ObjectService.Delete RPC call. -type Lock struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of objects to lock. Must not be empty or carry empty IDs. - // All members must be of the `REGULAR` type. - Members []*grpc.ObjectID `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"` -} - -func (x *Lock) Reset() { - *x = Lock{} - if protoimpl.UnsafeEnabled { - mi := &file_lock_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Lock) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Lock) ProtoMessage() {} - -func (x *Lock) ProtoReflect() protoreflect.Message { - mi := &file_lock_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Lock.ProtoReflect.Descriptor instead. -func (*Lock) Descriptor() ([]byte, []int) { - return file_lock_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *Lock) GetMembers() []*grpc.ObjectID { - if x != nil { - return x.Members - } - return nil -} - -var File_lock_grpc_types_proto protoreflect.FileDescriptor - -var file_lock_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, - 0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, - 0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69, - 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, - 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, - 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6c, 0x6f, - 0x63, 0x6b, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0xaa, 0x02, 0x18, 0x4e, - 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, - 0x50, 0x49, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_lock_grpc_types_proto_rawDescOnce sync.Once - file_lock_grpc_types_proto_rawDescData = file_lock_grpc_types_proto_rawDesc -) - -func file_lock_grpc_types_proto_rawDescGZIP() []byte { - file_lock_grpc_types_proto_rawDescOnce.Do(func() { - file_lock_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_lock_grpc_types_proto_rawDescData) - }) - return file_lock_grpc_types_proto_rawDescData -} - -var file_lock_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_lock_grpc_types_proto_goTypes = []interface{}{ - (*Lock)(nil), // 0: neo.fs.v2.lock.Lock - (*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID -} -var file_lock_grpc_types_proto_depIdxs = []int32{ - 1, // 0: neo.fs.v2.lock.Lock.members:type_name -> neo.fs.v2.refs.ObjectID - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_lock_grpc_types_proto_init() } -func file_lock_grpc_types_proto_init() { - if File_lock_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_lock_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Lock); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_lock_grpc_types_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_lock_grpc_types_proto_goTypes, - DependencyIndexes: file_lock_grpc_types_proto_depIdxs, - MessageInfos: file_lock_grpc_types_proto_msgTypes, - }.Build() - File_lock_grpc_types_proto = out.File - file_lock_grpc_types_proto_rawDesc = nil - file_lock_grpc_types_proto_goTypes = nil - file_lock_grpc_types_proto_depIdxs = nil -} diff --git a/lock/grpc/types_frostfs.pb.go b/lock/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..3012111 --- /dev/null +++ b/lock/grpc/types_frostfs.pb.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package lock + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type Lock struct { + Members []*grpc.ObjectID `json:"members"` +} + +var ( + _ encoding.ProtoMarshaler = (*Lock)(nil) + _ encoding.ProtoUnmarshaler = (*Lock)(nil) + _ json.Marshaler = (*Lock)(nil) + _ json.Unmarshaler = (*Lock)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Lock) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.Members { + size += proto.NestedStructureSize(1, x.Members[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Lock) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Lock) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + for i := range x.Members { + if x.Members[i] != nil && x.Members[i].StableSize() != 0 { + x.Members[i].EmitProtobuf(mm.AppendMessage(1)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Lock) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Lock") + } + switch fc.FieldNum { + case 1: // Members + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Members") + } + x.Members = append(x.Members, new(grpc.ObjectID)) + ff := x.Members[len(x.Members)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Lock) GetMembers() []*grpc.ObjectID { + if x != nil { + return x.Members + } + return nil +} +func (x *Lock) SetMembers(v []*grpc.ObjectID) { + x.Members = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Lock) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"members\":" + out.RawString(prefix[1:]) + out.RawByte('[') + for i := range x.Members { + if i != 0 { + out.RawByte(',') + } + x.Members[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Lock) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Lock) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "members": + { + var f *grpc.ObjectID + var list []*grpc.ObjectID + in.Delim('[') + for !in.IsDelim(']') { + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Members = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/lock/grpc/types_frostfs_fuzz.go b/lock/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..cb55151 --- /dev/null +++ b/lock/grpc/types_frostfs_fuzz.go @@ -0,0 +1,26 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package lock + +func DoFuzzProtoLock(data []byte) int { + msg := new(Lock) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONLock(data []byte) int { + msg := new(Lock) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/lock/grpc/types_frostfs_test.go b/lock/grpc/types_frostfs_test.go new file mode 100644 index 0000000..7c69064 --- /dev/null +++ b/lock/grpc/types_frostfs_test.go @@ -0,0 +1,21 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package lock + +import ( + testing "testing" +) + +func FuzzProtoLock(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoLock(data) + }) +} +func FuzzJSONLock(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONLock(data) + }) +} diff --git a/netmap/grpc/service.go b/netmap/grpc/service.go deleted file mode 100644 index 882db6b..0000000 --- a/netmap/grpc/service.go +++ /dev/null @@ -1,116 +0,0 @@ -package netmap - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" -) - -// SetBody sets body of the request. -func (m *LocalNodeInfoRequest) SetBody(v *LocalNodeInfoRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *LocalNodeInfoRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *LocalNodeInfoRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetVersion sets version of response body. -func (m *LocalNodeInfoResponse_Body) SetVersion(v *refs.Version) { - m.Version = v -} - -// SetNodeInfo sets node info of response body. -func (m *LocalNodeInfoResponse_Body) SetNodeInfo(v *NodeInfo) { - m.NodeInfo = v -} - -// SetBody sets body of the response. -func (m *LocalNodeInfoResponse) SetBody(v *LocalNodeInfoResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *LocalNodeInfoResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *LocalNodeInfoResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetBody sets body of the request. -func (x *NetworkInfoRequest) SetBody(v *NetworkInfoRequest_Body) { - x.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (x *NetworkInfoRequest) SetMetaHeader(v *session.RequestMetaHeader) { - x.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (x *NetworkInfoRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - x.VerifyHeader = v -} - -// SetNetworkInfo sets information about the network. -func (x *NetworkInfoResponse_Body) SetNetworkInfo(v *NetworkInfo) { - x.NetworkInfo = v -} - -// SetBody sets body of the response. -func (x *NetworkInfoResponse) SetBody(v *NetworkInfoResponse_Body) { - x.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (x *NetworkInfoResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - x.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (x *NetworkInfoResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - x.VerifyHeader = v -} - -// SetBody sets body of the request. -func (x *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) { - x.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (x *NetmapSnapshotRequest) SetMetaHeader(v *session.RequestMetaHeader) { - x.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (x *NetmapSnapshotRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - x.VerifyHeader = v -} - -// SetNetmap sets current Netmap. -func (x *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) { - x.Netmap = v -} - -// SetBody sets body of the response. -func (x *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) { - x.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (x *NetmapSnapshotResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - x.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (x *NetmapSnapshotResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - x.VerifyHeader = v -} diff --git a/netmap/grpc/service.pb.go b/netmap/grpc/service.pb.go deleted file mode 100644 index eb91862..0000000 --- a/netmap/grpc/service.pb.go +++ /dev/null @@ -1,1108 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: netmap/grpc/service.proto - -package netmap - -import ( - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Get NodeInfo structure directly from a particular node -type LocalNodeInfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of the LocalNodeInfo request message - Body *LocalNodeInfoRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *LocalNodeInfoRequest) Reset() { - *x = LocalNodeInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LocalNodeInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LocalNodeInfoRequest) ProtoMessage() {} - -func (x *LocalNodeInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LocalNodeInfoRequest.ProtoReflect.Descriptor instead. -func (*LocalNodeInfoRequest) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{0} -} - -func (x *LocalNodeInfoRequest) GetBody() *LocalNodeInfoRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *LocalNodeInfoRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *LocalNodeInfoRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Local Node Info, including API Version in use -type LocalNodeInfoResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of the balance response message. - Body *LocalNodeInfoResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect response execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *LocalNodeInfoResponse) Reset() { - *x = LocalNodeInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LocalNodeInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LocalNodeInfoResponse) ProtoMessage() {} - -func (x *LocalNodeInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LocalNodeInfoResponse.ProtoReflect.Descriptor instead. -func (*LocalNodeInfoResponse) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{1} -} - -func (x *LocalNodeInfoResponse) GetBody() *LocalNodeInfoResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *LocalNodeInfoResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *LocalNodeInfoResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Get NetworkInfo structure with the network view from a particular node. -type NetworkInfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of the NetworkInfo request message - Body *NetworkInfoRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *NetworkInfoRequest) Reset() { - *x = NetworkInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetworkInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetworkInfoRequest) ProtoMessage() {} - -func (x *NetworkInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetworkInfoRequest.ProtoReflect.Descriptor instead. -func (*NetworkInfoRequest) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{2} -} - -func (x *NetworkInfoRequest) GetBody() *NetworkInfoRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *NetworkInfoRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *NetworkInfoRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Response with NetworkInfo structure including current epoch and -// sidechain magic number. -type NetworkInfoResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of the NetworkInfo response message. - Body *NetworkInfoResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect response execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *NetworkInfoResponse) Reset() { - *x = NetworkInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetworkInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetworkInfoResponse) ProtoMessage() {} - -func (x *NetworkInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetworkInfoResponse.ProtoReflect.Descriptor instead. -func (*NetworkInfoResponse) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{3} -} - -func (x *NetworkInfoResponse) GetBody() *NetworkInfoResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *NetworkInfoResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *NetworkInfoResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Get netmap snapshot request -type NetmapSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of get netmap snapshot request message. - Body *NetmapSnapshotRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *NetmapSnapshotRequest) Reset() { - *x = NetmapSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetmapSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetmapSnapshotRequest) ProtoMessage() {} - -func (x *NetmapSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetmapSnapshotRequest.ProtoReflect.Descriptor instead. -func (*NetmapSnapshotRequest) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{4} -} - -func (x *NetmapSnapshotRequest) GetBody() *NetmapSnapshotRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *NetmapSnapshotRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *NetmapSnapshotRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Response with current netmap snapshot -type NetmapSnapshotResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of get netmap snapshot response message. - Body *NetmapSnapshotResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect response execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *NetmapSnapshotResponse) Reset() { - *x = NetmapSnapshotResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetmapSnapshotResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetmapSnapshotResponse) ProtoMessage() {} - -func (x *NetmapSnapshotResponse) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetmapSnapshotResponse.ProtoReflect.Descriptor instead. -func (*NetmapSnapshotResponse) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{5} -} - -func (x *NetmapSnapshotResponse) GetBody() *NetmapSnapshotResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *NetmapSnapshotResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *NetmapSnapshotResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// LocalNodeInfo request body is empty. -type LocalNodeInfoRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *LocalNodeInfoRequest_Body) Reset() { - *x = LocalNodeInfoRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LocalNodeInfoRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LocalNodeInfoRequest_Body) ProtoMessage() {} - -func (x *LocalNodeInfoRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LocalNodeInfoRequest_Body.ProtoReflect.Descriptor instead. -func (*LocalNodeInfoRequest_Body) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{0, 0} -} - -// Local Node Info, including API Version in use. -type LocalNodeInfoResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Latest NeoFS API version in use - Version *grpc1.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // NodeInfo structure with recent information from node itself - NodeInfo *NodeInfo `protobuf:"bytes,2,opt,name=node_info,json=nodeInfo,proto3" json:"node_info,omitempty"` -} - -func (x *LocalNodeInfoResponse_Body) Reset() { - *x = LocalNodeInfoResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LocalNodeInfoResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LocalNodeInfoResponse_Body) ProtoMessage() {} - -func (x *LocalNodeInfoResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LocalNodeInfoResponse_Body.ProtoReflect.Descriptor instead. -func (*LocalNodeInfoResponse_Body) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *LocalNodeInfoResponse_Body) GetVersion() *grpc1.Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *LocalNodeInfoResponse_Body) GetNodeInfo() *NodeInfo { - if x != nil { - return x.NodeInfo - } - return nil -} - -// NetworkInfo request body is empty. -type NetworkInfoRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *NetworkInfoRequest_Body) Reset() { - *x = NetworkInfoRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetworkInfoRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetworkInfoRequest_Body) ProtoMessage() {} - -func (x *NetworkInfoRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetworkInfoRequest_Body.ProtoReflect.Descriptor instead. -func (*NetworkInfoRequest_Body) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{2, 0} -} - -// Information about the network. -type NetworkInfoResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // NetworkInfo structure with recent information. - NetworkInfo *NetworkInfo `protobuf:"bytes,1,opt,name=network_info,json=networkInfo,proto3" json:"network_info,omitempty"` -} - -func (x *NetworkInfoResponse_Body) Reset() { - *x = NetworkInfoResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetworkInfoResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetworkInfoResponse_Body) ProtoMessage() {} - -func (x *NetworkInfoResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetworkInfoResponse_Body.ProtoReflect.Descriptor instead. -func (*NetworkInfoResponse_Body) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *NetworkInfoResponse_Body) GetNetworkInfo() *NetworkInfo { - if x != nil { - return x.NetworkInfo - } - return nil -} - -// Get netmap snapshot request body. -type NetmapSnapshotRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *NetmapSnapshotRequest_Body) Reset() { - *x = NetmapSnapshotRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetmapSnapshotRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetmapSnapshotRequest_Body) ProtoMessage() {} - -func (x *NetmapSnapshotRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetmapSnapshotRequest_Body.ProtoReflect.Descriptor instead. -func (*NetmapSnapshotRequest_Body) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{4, 0} -} - -// Get netmap snapshot response body -type NetmapSnapshotResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Structure of the requested network map. - Netmap *Netmap `protobuf:"bytes,1,opt,name=netmap,proto3" json:"netmap,omitempty"` -} - -func (x *NetmapSnapshotResponse_Body) Reset() { - *x = NetmapSnapshotResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_service_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetmapSnapshotResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetmapSnapshotResponse_Body) ProtoMessage() {} - -func (x *NetmapSnapshotResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_service_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetmapSnapshotResponse_Body.ProtoReflect.Descriptor instead. -func (*NetmapSnapshotResponse_Body) Descriptor() ([]byte, []int) { - return file_netmap_grpc_service_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *NetmapSnapshotResponse_Body) GetNetmap() *Netmap { - if x != nil { - return x.Netmap - } - return nil -} - -var File_netmap_grpc_service_proto protoreflect.FileDescriptor - -var file_netmap_grpc_service_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x1a, 0x17, 0x6e, - 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf9, 0x01, 0x0a, 0x14, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3f, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, - 0x70, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 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, 0x06, 0x0a, 0x04, 0x42, - 0x6f, 0x64, 0x79, 0x22, 0xe9, 0x02, 0x0a, 0x15, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4e, 0x6f, 0x64, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4c, - 0x6f, 0x63, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 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, 0x72, 0x0a, 0x04, 0x42, - 0x6f, 0x64, 0x79, 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, 0x37, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, - 0xf5, 0x01, 0x0a, 0x12, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 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, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, - 0x6e, 0x66, 0x6f, 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, - 0x06, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xbb, 0x02, 0x0a, 0x13, 0x4e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 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, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 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, 0x48, 0x0a, 0x04, 0x42, - 0x6f, 0x64, 0x79, 0x12, 0x40, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xfb, 0x01, 0x0a, 0x15, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x40, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 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, 0x06, 0x0a, 0x04, 0x42, - 0x6f, 0x64, 0x79, 0x22, 0xb1, 0x02, 0x0a, 0x16, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, - 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, - 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 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, 0x38, 0x0a, - 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x06, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x52, - 0x06, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x32, 0xb2, 0x02, 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x6d, - 0x61, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x0d, 0x4c, 0x6f, 0x63, - 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4c, 0x6f, - 0x63, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, - 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0b, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, - 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0e, 0x4e, 0x65, 0x74, 0x6d, 0x61, - 0x70, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, - 0x6d, 0x61, 0x70, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, - 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x61, 0x5a, 0x42, - 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, - 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, - 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, - 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_netmap_grpc_service_proto_rawDescOnce sync.Once - file_netmap_grpc_service_proto_rawDescData = file_netmap_grpc_service_proto_rawDesc -) - -func file_netmap_grpc_service_proto_rawDescGZIP() []byte { - file_netmap_grpc_service_proto_rawDescOnce.Do(func() { - file_netmap_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_netmap_grpc_service_proto_rawDescData) - }) - return file_netmap_grpc_service_proto_rawDescData -} - -var file_netmap_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_netmap_grpc_service_proto_goTypes = []interface{}{ - (*LocalNodeInfoRequest)(nil), // 0: neo.fs.v2.netmap.LocalNodeInfoRequest - (*LocalNodeInfoResponse)(nil), // 1: neo.fs.v2.netmap.LocalNodeInfoResponse - (*NetworkInfoRequest)(nil), // 2: neo.fs.v2.netmap.NetworkInfoRequest - (*NetworkInfoResponse)(nil), // 3: neo.fs.v2.netmap.NetworkInfoResponse - (*NetmapSnapshotRequest)(nil), // 4: neo.fs.v2.netmap.NetmapSnapshotRequest - (*NetmapSnapshotResponse)(nil), // 5: neo.fs.v2.netmap.NetmapSnapshotResponse - (*LocalNodeInfoRequest_Body)(nil), // 6: neo.fs.v2.netmap.LocalNodeInfoRequest.Body - (*LocalNodeInfoResponse_Body)(nil), // 7: neo.fs.v2.netmap.LocalNodeInfoResponse.Body - (*NetworkInfoRequest_Body)(nil), // 8: neo.fs.v2.netmap.NetworkInfoRequest.Body - (*NetworkInfoResponse_Body)(nil), // 9: neo.fs.v2.netmap.NetworkInfoResponse.Body - (*NetmapSnapshotRequest_Body)(nil), // 10: neo.fs.v2.netmap.NetmapSnapshotRequest.Body - (*NetmapSnapshotResponse_Body)(nil), // 11: neo.fs.v2.netmap.NetmapSnapshotResponse.Body - (*grpc.RequestMetaHeader)(nil), // 12: neo.fs.v2.session.RequestMetaHeader - (*grpc.RequestVerificationHeader)(nil), // 13: neo.fs.v2.session.RequestVerificationHeader - (*grpc.ResponseMetaHeader)(nil), // 14: neo.fs.v2.session.ResponseMetaHeader - (*grpc.ResponseVerificationHeader)(nil), // 15: neo.fs.v2.session.ResponseVerificationHeader - (*grpc1.Version)(nil), // 16: neo.fs.v2.refs.Version - (*NodeInfo)(nil), // 17: neo.fs.v2.netmap.NodeInfo - (*NetworkInfo)(nil), // 18: neo.fs.v2.netmap.NetworkInfo - (*Netmap)(nil), // 19: neo.fs.v2.netmap.Netmap -} -var file_netmap_grpc_service_proto_depIdxs = []int32{ - 6, // 0: neo.fs.v2.netmap.LocalNodeInfoRequest.body:type_name -> neo.fs.v2.netmap.LocalNodeInfoRequest.Body - 12, // 1: neo.fs.v2.netmap.LocalNodeInfoRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 13, // 2: neo.fs.v2.netmap.LocalNodeInfoRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 7, // 3: neo.fs.v2.netmap.LocalNodeInfoResponse.body:type_name -> neo.fs.v2.netmap.LocalNodeInfoResponse.Body - 14, // 4: neo.fs.v2.netmap.LocalNodeInfoResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 15, // 5: neo.fs.v2.netmap.LocalNodeInfoResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 8, // 6: neo.fs.v2.netmap.NetworkInfoRequest.body:type_name -> neo.fs.v2.netmap.NetworkInfoRequest.Body - 12, // 7: neo.fs.v2.netmap.NetworkInfoRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 13, // 8: neo.fs.v2.netmap.NetworkInfoRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 9, // 9: neo.fs.v2.netmap.NetworkInfoResponse.body:type_name -> neo.fs.v2.netmap.NetworkInfoResponse.Body - 14, // 10: neo.fs.v2.netmap.NetworkInfoResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 15, // 11: neo.fs.v2.netmap.NetworkInfoResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 10, // 12: neo.fs.v2.netmap.NetmapSnapshotRequest.body:type_name -> neo.fs.v2.netmap.NetmapSnapshotRequest.Body - 12, // 13: neo.fs.v2.netmap.NetmapSnapshotRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 13, // 14: neo.fs.v2.netmap.NetmapSnapshotRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 11, // 15: neo.fs.v2.netmap.NetmapSnapshotResponse.body:type_name -> neo.fs.v2.netmap.NetmapSnapshotResponse.Body - 14, // 16: neo.fs.v2.netmap.NetmapSnapshotResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 15, // 17: neo.fs.v2.netmap.NetmapSnapshotResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 16, // 18: neo.fs.v2.netmap.LocalNodeInfoResponse.Body.version:type_name -> neo.fs.v2.refs.Version - 17, // 19: neo.fs.v2.netmap.LocalNodeInfoResponse.Body.node_info:type_name -> neo.fs.v2.netmap.NodeInfo - 18, // 20: neo.fs.v2.netmap.NetworkInfoResponse.Body.network_info:type_name -> neo.fs.v2.netmap.NetworkInfo - 19, // 21: neo.fs.v2.netmap.NetmapSnapshotResponse.Body.netmap:type_name -> neo.fs.v2.netmap.Netmap - 0, // 22: neo.fs.v2.netmap.NetmapService.LocalNodeInfo:input_type -> neo.fs.v2.netmap.LocalNodeInfoRequest - 2, // 23: neo.fs.v2.netmap.NetmapService.NetworkInfo:input_type -> neo.fs.v2.netmap.NetworkInfoRequest - 4, // 24: neo.fs.v2.netmap.NetmapService.NetmapSnapshot:input_type -> neo.fs.v2.netmap.NetmapSnapshotRequest - 1, // 25: neo.fs.v2.netmap.NetmapService.LocalNodeInfo:output_type -> neo.fs.v2.netmap.LocalNodeInfoResponse - 3, // 26: neo.fs.v2.netmap.NetmapService.NetworkInfo:output_type -> neo.fs.v2.netmap.NetworkInfoResponse - 5, // 27: neo.fs.v2.netmap.NetmapService.NetmapSnapshot:output_type -> neo.fs.v2.netmap.NetmapSnapshotResponse - 25, // [25:28] is the sub-list for method output_type - 22, // [22:25] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name -} - -func init() { file_netmap_grpc_service_proto_init() } -func file_netmap_grpc_service_proto_init() { - if File_netmap_grpc_service_proto != nil { - return - } - file_netmap_grpc_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_netmap_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocalNodeInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocalNodeInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetworkInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetworkInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetmapSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetmapSnapshotResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocalNodeInfoRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocalNodeInfoResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetworkInfoRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetworkInfoResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetmapSnapshotRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetmapSnapshotResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_netmap_grpc_service_proto_rawDesc, - NumEnums: 0, - NumMessages: 12, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_netmap_grpc_service_proto_goTypes, - DependencyIndexes: file_netmap_grpc_service_proto_depIdxs, - MessageInfos: file_netmap_grpc_service_proto_msgTypes, - }.Build() - File_netmap_grpc_service_proto = out.File - file_netmap_grpc_service_proto_rawDesc = nil - file_netmap_grpc_service_proto_goTypes = nil - file_netmap_grpc_service_proto_depIdxs = nil -} diff --git a/netmap/grpc/service_frostfs.pb.go b/netmap/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..1ce80ff --- /dev/null +++ b/netmap/grpc/service_frostfs.pb.go @@ -0,0 +1,2061 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package netmap + +import ( + json "encoding/json" + fmt "fmt" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type LocalNodeInfoRequest_Body struct { +} + +var ( + _ encoding.ProtoMarshaler = (*LocalNodeInfoRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*LocalNodeInfoRequest_Body)(nil) + _ json.Marshaler = (*LocalNodeInfoRequest_Body)(nil) + _ json.Unmarshaler = (*LocalNodeInfoRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *LocalNodeInfoRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *LocalNodeInfoRequest_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 *LocalNodeInfoRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *LocalNodeInfoRequest_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", "LocalNodeInfoRequest_Body") + } + switch fc.FieldNum { + } + } + return nil +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *LocalNodeInfoRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *LocalNodeInfoRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *LocalNodeInfoRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *LocalNodeInfoRequest_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 { + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type LocalNodeInfoRequest struct { + Body *LocalNodeInfoRequest_Body `json:"body"` + MetaHeader *grpc.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*LocalNodeInfoRequest)(nil) + _ encoding.ProtoUnmarshaler = (*LocalNodeInfoRequest)(nil) + _ json.Marshaler = (*LocalNodeInfoRequest)(nil) + _ json.Unmarshaler = (*LocalNodeInfoRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *LocalNodeInfoRequest) 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 *LocalNodeInfoRequest) 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 *LocalNodeInfoRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *LocalNodeInfoRequest) 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 *LocalNodeInfoRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *LocalNodeInfoRequest) 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", "LocalNodeInfoRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(LocalNodeInfoRequest_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(grpc.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(grpc.RequestVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *LocalNodeInfoRequest) GetBody() *LocalNodeInfoRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *LocalNodeInfoRequest) SetBody(v *LocalNodeInfoRequest_Body) { + x.Body = v +} +func (x *LocalNodeInfoRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *LocalNodeInfoRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *LocalNodeInfoRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *LocalNodeInfoRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *LocalNodeInfoRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *LocalNodeInfoRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *LocalNodeInfoRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *LocalNodeInfoRequest) 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 *LocalNodeInfoRequest_Body + f = new(LocalNodeInfoRequest_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *grpc.RequestMetaHeader + f = new(grpc.RequestMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *grpc.RequestVerificationHeader + f = new(grpc.RequestVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type LocalNodeInfoResponse_Body struct { + Version *grpc1.Version `json:"version"` + NodeInfo *NodeInfo `json:"nodeInfo"` +} + +var ( + _ encoding.ProtoMarshaler = (*LocalNodeInfoResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*LocalNodeInfoResponse_Body)(nil) + _ json.Marshaler = (*LocalNodeInfoResponse_Body)(nil) + _ json.Unmarshaler = (*LocalNodeInfoResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *LocalNodeInfoResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Version) + size += proto.NestedStructureSize(2, x.NodeInfo) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *LocalNodeInfoResponse_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 *LocalNodeInfoResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Version != nil && x.Version.StableSize() != 0 { + x.Version.EmitProtobuf(mm.AppendMessage(1)) + } + if x.NodeInfo != nil && x.NodeInfo.StableSize() != 0 { + x.NodeInfo.EmitProtobuf(mm.AppendMessage(2)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *LocalNodeInfoResponse_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", "LocalNodeInfoResponse_Body") + } + switch fc.FieldNum { + case 1: // Version + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Version") + } + x.Version = new(grpc1.Version) + if err := x.Version.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // NodeInfo + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "NodeInfo") + } + x.NodeInfo = new(NodeInfo) + if err := x.NodeInfo.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *LocalNodeInfoResponse_Body) GetVersion() *grpc1.Version { + if x != nil { + return x.Version + } + return nil +} +func (x *LocalNodeInfoResponse_Body) SetVersion(v *grpc1.Version) { + x.Version = v +} +func (x *LocalNodeInfoResponse_Body) GetNodeInfo() *NodeInfo { + if x != nil { + return x.NodeInfo + } + return nil +} +func (x *LocalNodeInfoResponse_Body) SetNodeInfo(v *NodeInfo) { + x.NodeInfo = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *LocalNodeInfoResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *LocalNodeInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"version\":" + out.RawString(prefix[1:]) + x.Version.MarshalEasyJSON(out) + } + { + const prefix string = ",\"nodeInfo\":" + out.RawString(prefix) + x.NodeInfo.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *LocalNodeInfoResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *LocalNodeInfoResponse_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 "version": + { + var f *grpc1.Version + f = new(grpc1.Version) + f.UnmarshalEasyJSON(in) + x.Version = f + } + case "nodeInfo": + { + var f *NodeInfo + f = new(NodeInfo) + f.UnmarshalEasyJSON(in) + x.NodeInfo = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type LocalNodeInfoResponse struct { + Body *LocalNodeInfoResponse_Body `json:"body"` + MetaHeader *grpc.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*LocalNodeInfoResponse)(nil) + _ encoding.ProtoUnmarshaler = (*LocalNodeInfoResponse)(nil) + _ json.Marshaler = (*LocalNodeInfoResponse)(nil) + _ json.Unmarshaler = (*LocalNodeInfoResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *LocalNodeInfoResponse) 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 *LocalNodeInfoResponse) 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 *LocalNodeInfoResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *LocalNodeInfoResponse) 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 *LocalNodeInfoResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *LocalNodeInfoResponse) 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", "LocalNodeInfoResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(LocalNodeInfoResponse_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(grpc.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(grpc.ResponseVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *LocalNodeInfoResponse) GetBody() *LocalNodeInfoResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *LocalNodeInfoResponse) SetBody(v *LocalNodeInfoResponse_Body) { + x.Body = v +} +func (x *LocalNodeInfoResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *LocalNodeInfoResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *LocalNodeInfoResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *LocalNodeInfoResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *LocalNodeInfoResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *LocalNodeInfoResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *LocalNodeInfoResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *LocalNodeInfoResponse) 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 *LocalNodeInfoResponse_Body + f = new(LocalNodeInfoResponse_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *grpc.ResponseMetaHeader + f = new(grpc.ResponseMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *grpc.ResponseVerificationHeader + f = new(grpc.ResponseVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetworkInfoRequest_Body struct { +} + +var ( + _ encoding.ProtoMarshaler = (*NetworkInfoRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*NetworkInfoRequest_Body)(nil) + _ json.Marshaler = (*NetworkInfoRequest_Body)(nil) + _ json.Unmarshaler = (*NetworkInfoRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetworkInfoRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetworkInfoRequest_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 *NetworkInfoRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetworkInfoRequest_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", "NetworkInfoRequest_Body") + } + switch fc.FieldNum { + } + } + return nil +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetworkInfoRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetworkInfoRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetworkInfoRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetworkInfoRequest_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 { + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetworkInfoRequest struct { + Body *NetworkInfoRequest_Body `json:"body"` + MetaHeader *grpc.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*NetworkInfoRequest)(nil) + _ encoding.ProtoUnmarshaler = (*NetworkInfoRequest)(nil) + _ json.Marshaler = (*NetworkInfoRequest)(nil) + _ json.Unmarshaler = (*NetworkInfoRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetworkInfoRequest) 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 *NetworkInfoRequest) 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 *NetworkInfoRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetworkInfoRequest) 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 *NetworkInfoRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetworkInfoRequest) 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", "NetworkInfoRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(NetworkInfoRequest_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(grpc.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(grpc.RequestVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *NetworkInfoRequest) GetBody() *NetworkInfoRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *NetworkInfoRequest) SetBody(v *NetworkInfoRequest_Body) { + x.Body = v +} +func (x *NetworkInfoRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *NetworkInfoRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *NetworkInfoRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *NetworkInfoRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetworkInfoRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetworkInfoRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetworkInfoRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetworkInfoRequest) 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 *NetworkInfoRequest_Body + f = new(NetworkInfoRequest_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *grpc.RequestMetaHeader + f = new(grpc.RequestMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *grpc.RequestVerificationHeader + f = new(grpc.RequestVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetworkInfoResponse_Body struct { + NetworkInfo *NetworkInfo `json:"networkInfo"` +} + +var ( + _ encoding.ProtoMarshaler = (*NetworkInfoResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*NetworkInfoResponse_Body)(nil) + _ json.Marshaler = (*NetworkInfoResponse_Body)(nil) + _ json.Unmarshaler = (*NetworkInfoResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetworkInfoResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.NetworkInfo) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetworkInfoResponse_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 *NetworkInfoResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.NetworkInfo != nil && x.NetworkInfo.StableSize() != 0 { + x.NetworkInfo.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetworkInfoResponse_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", "NetworkInfoResponse_Body") + } + switch fc.FieldNum { + case 1: // NetworkInfo + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "NetworkInfo") + } + x.NetworkInfo = new(NetworkInfo) + if err := x.NetworkInfo.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *NetworkInfoResponse_Body) GetNetworkInfo() *NetworkInfo { + if x != nil { + return x.NetworkInfo + } + return nil +} +func (x *NetworkInfoResponse_Body) SetNetworkInfo(v *NetworkInfo) { + x.NetworkInfo = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetworkInfoResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetworkInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"networkInfo\":" + out.RawString(prefix[1:]) + x.NetworkInfo.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetworkInfoResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetworkInfoResponse_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 "networkInfo": + { + var f *NetworkInfo + f = new(NetworkInfo) + f.UnmarshalEasyJSON(in) + x.NetworkInfo = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetworkInfoResponse struct { + Body *NetworkInfoResponse_Body `json:"body"` + MetaHeader *grpc.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*NetworkInfoResponse)(nil) + _ encoding.ProtoUnmarshaler = (*NetworkInfoResponse)(nil) + _ json.Marshaler = (*NetworkInfoResponse)(nil) + _ json.Unmarshaler = (*NetworkInfoResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetworkInfoResponse) 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 *NetworkInfoResponse) 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 *NetworkInfoResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetworkInfoResponse) 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 *NetworkInfoResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetworkInfoResponse) 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", "NetworkInfoResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(NetworkInfoResponse_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(grpc.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(grpc.ResponseVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *NetworkInfoResponse) GetBody() *NetworkInfoResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *NetworkInfoResponse) SetBody(v *NetworkInfoResponse_Body) { + x.Body = v +} +func (x *NetworkInfoResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *NetworkInfoResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *NetworkInfoResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *NetworkInfoResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetworkInfoResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetworkInfoResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetworkInfoResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetworkInfoResponse) 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 *NetworkInfoResponse_Body + f = new(NetworkInfoResponse_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *grpc.ResponseMetaHeader + f = new(grpc.ResponseMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *grpc.ResponseVerificationHeader + f = new(grpc.ResponseVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetmapSnapshotRequest_Body struct { +} + +var ( + _ encoding.ProtoMarshaler = (*NetmapSnapshotRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*NetmapSnapshotRequest_Body)(nil) + _ json.Marshaler = (*NetmapSnapshotRequest_Body)(nil) + _ json.Unmarshaler = (*NetmapSnapshotRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetmapSnapshotRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetmapSnapshotRequest_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 *NetmapSnapshotRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetmapSnapshotRequest_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", "NetmapSnapshotRequest_Body") + } + switch fc.FieldNum { + } + } + return nil +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetmapSnapshotRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetmapSnapshotRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetmapSnapshotRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetmapSnapshotRequest_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 { + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetmapSnapshotRequest struct { + Body *NetmapSnapshotRequest_Body `json:"body"` + MetaHeader *grpc.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*NetmapSnapshotRequest)(nil) + _ encoding.ProtoUnmarshaler = (*NetmapSnapshotRequest)(nil) + _ json.Marshaler = (*NetmapSnapshotRequest)(nil) + _ json.Unmarshaler = (*NetmapSnapshotRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetmapSnapshotRequest) 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 *NetmapSnapshotRequest) 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 *NetmapSnapshotRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetmapSnapshotRequest) 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 *NetmapSnapshotRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetmapSnapshotRequest) 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", "NetmapSnapshotRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(NetmapSnapshotRequest_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(grpc.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(grpc.RequestVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *NetmapSnapshotRequest) GetBody() *NetmapSnapshotRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) { + x.Body = v +} +func (x *NetmapSnapshotRequest) GetMetaHeader() *grpc.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *NetmapSnapshotRequest) SetMetaHeader(v *grpc.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *NetmapSnapshotRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *NetmapSnapshotRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetmapSnapshotRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetmapSnapshotRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetmapSnapshotRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetmapSnapshotRequest) 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 *NetmapSnapshotRequest_Body + f = new(NetmapSnapshotRequest_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *grpc.RequestMetaHeader + f = new(grpc.RequestMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *grpc.RequestVerificationHeader + f = new(grpc.RequestVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetmapSnapshotResponse_Body struct { + Netmap *Netmap `json:"netmap"` +} + +var ( + _ encoding.ProtoMarshaler = (*NetmapSnapshotResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*NetmapSnapshotResponse_Body)(nil) + _ json.Marshaler = (*NetmapSnapshotResponse_Body)(nil) + _ json.Unmarshaler = (*NetmapSnapshotResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetmapSnapshotResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Netmap) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetmapSnapshotResponse_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 *NetmapSnapshotResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Netmap != nil && x.Netmap.StableSize() != 0 { + x.Netmap.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetmapSnapshotResponse_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", "NetmapSnapshotResponse_Body") + } + switch fc.FieldNum { + case 1: // Netmap + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Netmap") + } + x.Netmap = new(Netmap) + if err := x.Netmap.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *NetmapSnapshotResponse_Body) GetNetmap() *Netmap { + if x != nil { + return x.Netmap + } + return nil +} +func (x *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) { + x.Netmap = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetmapSnapshotResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetmapSnapshotResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"netmap\":" + out.RawString(prefix[1:]) + x.Netmap.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetmapSnapshotResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetmapSnapshotResponse_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 "netmap": + { + var f *Netmap + f = new(Netmap) + f.UnmarshalEasyJSON(in) + x.Netmap = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetmapSnapshotResponse struct { + Body *NetmapSnapshotResponse_Body `json:"body"` + MetaHeader *grpc.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*NetmapSnapshotResponse)(nil) + _ encoding.ProtoUnmarshaler = (*NetmapSnapshotResponse)(nil) + _ json.Marshaler = (*NetmapSnapshotResponse)(nil) + _ json.Unmarshaler = (*NetmapSnapshotResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetmapSnapshotResponse) 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 *NetmapSnapshotResponse) 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 *NetmapSnapshotResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetmapSnapshotResponse) 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 *NetmapSnapshotResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetmapSnapshotResponse) 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", "NetmapSnapshotResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(NetmapSnapshotResponse_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(grpc.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(grpc.ResponseVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *NetmapSnapshotResponse) GetBody() *NetmapSnapshotResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) { + x.Body = v +} +func (x *NetmapSnapshotResponse) GetMetaHeader() *grpc.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *NetmapSnapshotResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *NetmapSnapshotResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *NetmapSnapshotResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetmapSnapshotResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetmapSnapshotResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetmapSnapshotResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetmapSnapshotResponse) 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 *NetmapSnapshotResponse_Body + f = new(NetmapSnapshotResponse_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *grpc.ResponseMetaHeader + f = new(grpc.ResponseMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *grpc.ResponseVerificationHeader + f = new(grpc.ResponseVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/netmap/grpc/service_frostfs_fuzz.go b/netmap/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..ebb59bc --- /dev/null +++ b/netmap/grpc/service_frostfs_fuzz.go @@ -0,0 +1,121 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package netmap + +func DoFuzzProtoLocalNodeInfoRequest(data []byte) int { + msg := new(LocalNodeInfoRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONLocalNodeInfoRequest(data []byte) int { + msg := new(LocalNodeInfoRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoLocalNodeInfoResponse(data []byte) int { + msg := new(LocalNodeInfoResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONLocalNodeInfoResponse(data []byte) int { + msg := new(LocalNodeInfoResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoNetworkInfoRequest(data []byte) int { + msg := new(NetworkInfoRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONNetworkInfoRequest(data []byte) int { + msg := new(NetworkInfoRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoNetworkInfoResponse(data []byte) int { + msg := new(NetworkInfoResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONNetworkInfoResponse(data []byte) int { + msg := new(NetworkInfoResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoNetmapSnapshotRequest(data []byte) int { + msg := new(NetmapSnapshotRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONNetmapSnapshotRequest(data []byte) int { + msg := new(NetmapSnapshotRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoNetmapSnapshotResponse(data []byte) int { + msg := new(NetmapSnapshotResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONNetmapSnapshotResponse(data []byte) int { + msg := new(NetmapSnapshotResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/netmap/grpc/service_frostfs_test.go b/netmap/grpc/service_frostfs_test.go new file mode 100644 index 0000000..5c9035f --- /dev/null +++ b/netmap/grpc/service_frostfs_test.go @@ -0,0 +1,71 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package netmap + +import ( + testing "testing" +) + +func FuzzProtoLocalNodeInfoRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoLocalNodeInfoRequest(data) + }) +} +func FuzzJSONLocalNodeInfoRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONLocalNodeInfoRequest(data) + }) +} +func FuzzProtoLocalNodeInfoResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoLocalNodeInfoResponse(data) + }) +} +func FuzzJSONLocalNodeInfoResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONLocalNodeInfoResponse(data) + }) +} +func FuzzProtoNetworkInfoRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoNetworkInfoRequest(data) + }) +} +func FuzzJSONNetworkInfoRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONNetworkInfoRequest(data) + }) +} +func FuzzProtoNetworkInfoResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoNetworkInfoResponse(data) + }) +} +func FuzzJSONNetworkInfoResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONNetworkInfoResponse(data) + }) +} +func FuzzProtoNetmapSnapshotRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoNetmapSnapshotRequest(data) + }) +} +func FuzzJSONNetmapSnapshotRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONNetmapSnapshotRequest(data) + }) +} +func FuzzProtoNetmapSnapshotResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoNetmapSnapshotResponse(data) + }) +} +func FuzzJSONNetmapSnapshotResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONNetmapSnapshotResponse(data) + }) +} diff --git a/netmap/grpc/types.go b/netmap/grpc/types.go deleted file mode 100644 index f4e90f8..0000000 --- a/netmap/grpc/types.go +++ /dev/null @@ -1,212 +0,0 @@ -package netmap - -// SetReplicas of placement policy. -func (m *PlacementPolicy) SetReplicas(v []*Replica) { - m.Replicas = v -} - -// SetContainerBackupFactor of placement policy. -func (m *PlacementPolicy) SetContainerBackupFactor(v uint32) { - m.ContainerBackupFactor = v -} - -// SetSelectors of placement policy. -func (m *PlacementPolicy) SetSelectors(v []*Selector) { - m.Selectors = v -} - -// SetFilters of placement policy. -func (m *PlacementPolicy) SetFilters(v []*Filter) { - m.Filters = v -} - -// SetUnique of placement policy. -func (m *PlacementPolicy) SetUnique(unique bool) { - m.Unique = unique -} - -// SetName of placement filter. -func (m *Filter) SetName(v string) { - m.Name = v -} - -// SetKey of placement filter. -func (m *Filter) SetKey(v string) { - m.Key = v -} - -// SetOperation of placement filter. -func (m *Filter) SetOp(v Operation) { - m.Op = v -} - -// SetValue of placement filter. -func (m *Filter) SetValue(v string) { - m.Value = v -} - -// SetFilters sets sub-filters of placement filter. -func (m *Filter) SetFilters(v []*Filter) { - m.Filters = v -} - -// SetName of placement selector. -func (m *Selector) SetName(v string) { - m.Name = v -} - -// SetCount of nodes of placement selector. -func (m *Selector) SetCount(v uint32) { - m.Count = v -} - -// SetAttribute of nodes of placement selector. -func (m *Selector) SetAttribute(v string) { - m.Attribute = v -} - -// SetFilter of placement selector. -func (m *Selector) SetFilter(v string) { - m.Filter = v -} - -// SetClause of placement selector. -func (m *Selector) SetClause(v Clause) { - m.Clause = v -} - -// SetCount of object replica. -func (m *Replica) SetCount(v uint32) { - m.Count = v -} - -// SetSelector of object replica. -func (m *Replica) SetSelector(v string) { - m.Selector = v -} - -// SetKey sets key to the node attribute. -func (m *NodeInfo_Attribute) SetKey(v string) { - m.Key = v -} - -// SetValue sets value of the node attribute. -func (m *NodeInfo_Attribute) SetValue(v string) { - m.Value = v -} - -// SetParent sets value of the node parents. -func (m *NodeInfo_Attribute) SetParents(v []string) { - m.Parents = v -} - -// SetAddress sets node network address. -// -// Deprecated: use SetAddresses. -func (m *NodeInfo) SetAddress(v string) { - m.SetAddresses([]string{v}) -} - -// SetAddresses sets list of network addresses of the node. -func (m *NodeInfo) SetAddresses(v []string) { - m.Addresses = v -} - -// SetPublicKey sets node public key in a binary format. -func (m *NodeInfo) SetPublicKey(v []byte) { - m.PublicKey = v -} - -// SetAttributes sets list of the node attributes. -func (m *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) { - m.Attributes = v -} - -// SetState sets node state. -func (m *NodeInfo) SetState(v NodeInfo_State) { - m.State = v -} - -// SetCurrentEpoch sets number of the current epoch. -func (x *NetworkInfo) SetCurrentEpoch(v uint64) { - x.CurrentEpoch = v -} - -// SetMagicNumber sets magic number of the sidechain. -func (x *NetworkInfo) SetMagicNumber(v uint64) { - x.MagicNumber = v -} - -// SetMsPerBlock sets MillisecondsPerBlock network parameter. -func (x *NetworkInfo) SetMsPerBlock(v int64) { - x.MsPerBlock = v -} - -// SetNetworkConfig sets NeoFS network configuration. -func (x *NetworkInfo) SetNetworkConfig(v *NetworkConfig) { - x.NetworkConfig = v -} - -// FromString parses Clause from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *Clause) FromString(s string) bool { - i, ok := Clause_value[s] - if ok { - *x = Clause(i) - } - - return ok -} - -// FromString parses Operation from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *Operation) FromString(s string) bool { - i, ok := Operation_value[s] - if ok { - *x = Operation(i) - } - - return ok -} - -// FromString parses NodeInfo_State from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *NodeInfo_State) FromString(s string) bool { - i, ok := NodeInfo_State_value[s] - if ok { - *x = NodeInfo_State(i) - } - - return ok -} - -// SetKey sets parameter key. -func (x *NetworkConfig_Parameter) SetKey(v []byte) { - x.Key = v -} - -// SetValue sets parameter value. -func (x *NetworkConfig_Parameter) SetValue(v []byte) { - x.Value = v -} - -// SetParameters sets NeoFS network parameters. -func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) { - x.Parameters = v -} - -// SetEpoch sets revision number of the Netmap. -func (x *Netmap) SetEpoch(v uint64) { - x.Epoch = v -} - -// SetNodes sets nodes presented in the Netmap. -func (x *Netmap) SetNodes(v []*NodeInfo) { - x.Nodes = v -} diff --git a/netmap/grpc/types.pb.go b/netmap/grpc/types.pb.go deleted file mode 100644 index ae1f55f..0000000 --- a/netmap/grpc/types.pb.go +++ /dev/null @@ -1,1371 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: netmap/grpc/types.proto - -package netmap - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Operations on filters -type Operation int32 - -const ( - // No Operation defined - Operation_OPERATION_UNSPECIFIED Operation = 0 - // Equal - Operation_EQ Operation = 1 - // Not Equal - Operation_NE Operation = 2 - // Greater then - Operation_GT Operation = 3 - // Greater or equal - Operation_GE Operation = 4 - // Less then - Operation_LT Operation = 5 - // Less or equal - Operation_LE Operation = 6 - // Logical OR - Operation_OR Operation = 7 - // Logical AND - Operation_AND Operation = 8 - // Logical negation - Operation_NOT Operation = 9 - // Matches pattern - Operation_LIKE Operation = 10 -) - -// Enum value maps for Operation. -var ( - Operation_name = map[int32]string{ - 0: "OPERATION_UNSPECIFIED", - 1: "EQ", - 2: "NE", - 3: "GT", - 4: "GE", - 5: "LT", - 6: "LE", - 7: "OR", - 8: "AND", - 9: "NOT", - 10: "LIKE", - } - Operation_value = map[string]int32{ - "OPERATION_UNSPECIFIED": 0, - "EQ": 1, - "NE": 2, - "GT": 3, - "GE": 4, - "LT": 5, - "LE": 6, - "OR": 7, - "AND": 8, - "NOT": 9, - "LIKE": 10, - } -) - -func (x Operation) Enum() *Operation { - p := new(Operation) - *p = x - return p -} - -func (x Operation) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Operation) Descriptor() protoreflect.EnumDescriptor { - return file_netmap_grpc_types_proto_enumTypes[0].Descriptor() -} - -func (Operation) Type() protoreflect.EnumType { - return &file_netmap_grpc_types_proto_enumTypes[0] -} - -func (x Operation) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Operation.Descriptor instead. -func (Operation) EnumDescriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{0} -} - -// Selector modifier shows how the node set will be formed. By default selector -// just groups nodes into a bucket by attribute, selecting nodes only by their -// hash distance. -type Clause int32 - -const ( - // No modifier defined. Nodes will be selected from the bucket randomly - Clause_CLAUSE_UNSPECIFIED Clause = 0 - // SAME will select only nodes having the same value of bucket attribute - Clause_SAME Clause = 1 - // DISTINCT will select nodes having different values of bucket attribute - Clause_DISTINCT Clause = 2 -) - -// Enum value maps for Clause. -var ( - Clause_name = map[int32]string{ - 0: "CLAUSE_UNSPECIFIED", - 1: "SAME", - 2: "DISTINCT", - } - Clause_value = map[string]int32{ - "CLAUSE_UNSPECIFIED": 0, - "SAME": 1, - "DISTINCT": 2, - } -) - -func (x Clause) Enum() *Clause { - p := new(Clause) - *p = x - return p -} - -func (x Clause) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Clause) Descriptor() protoreflect.EnumDescriptor { - return file_netmap_grpc_types_proto_enumTypes[1].Descriptor() -} - -func (Clause) Type() protoreflect.EnumType { - return &file_netmap_grpc_types_proto_enumTypes[1] -} - -func (x Clause) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Clause.Descriptor instead. -func (Clause) EnumDescriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{1} -} - -// Represents the enumeration of various states of the NeoFS node. -type NodeInfo_State int32 - -const ( - // Unknown state - NodeInfo_UNSPECIFIED NodeInfo_State = 0 - // Active state in the network - NodeInfo_ONLINE NodeInfo_State = 1 - // Network unavailable state - NodeInfo_OFFLINE NodeInfo_State = 2 - // Maintenance state - NodeInfo_MAINTENANCE NodeInfo_State = 3 -) - -// Enum value maps for NodeInfo_State. -var ( - NodeInfo_State_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "ONLINE", - 2: "OFFLINE", - 3: "MAINTENANCE", - } - NodeInfo_State_value = map[string]int32{ - "UNSPECIFIED": 0, - "ONLINE": 1, - "OFFLINE": 2, - "MAINTENANCE": 3, - } -) - -func (x NodeInfo_State) Enum() *NodeInfo_State { - p := new(NodeInfo_State) - *p = x - return p -} - -func (x NodeInfo_State) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (NodeInfo_State) Descriptor() protoreflect.EnumDescriptor { - return file_netmap_grpc_types_proto_enumTypes[2].Descriptor() -} - -func (NodeInfo_State) Type() protoreflect.EnumType { - return &file_netmap_grpc_types_proto_enumTypes[2] -} - -func (x NodeInfo_State) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use NodeInfo_State.Descriptor instead. -func (NodeInfo_State) EnumDescriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{4, 0} -} - -// This filter will return the subset of nodes from `NetworkMap` or another -// filter's results that will satisfy filter's conditions. -type Filter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the filter or a reference to a named filter. '*' means - // application to the whole unfiltered NetworkMap. At top level it's used as a - // filter name. At lower levels it's considered to be a reference to another - // named filter - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Key to filter - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - // Filtering operation - Op Operation `protobuf:"varint,3,opt,name=op,proto3,enum=neo.fs.v2.netmap.Operation" json:"op,omitempty"` - // Value to match - Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - // List of inner filters. Top level operation will be applied to the whole - // list. - Filters []*Filter `protobuf:"bytes,5,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *Filter) Reset() { - *x = Filter{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Filter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Filter) ProtoMessage() {} - -func (x *Filter) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Filter.ProtoReflect.Descriptor instead. -func (*Filter) Descriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *Filter) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Filter) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Filter) GetOp() Operation { - if x != nil { - return x.Op - } - return Operation_OPERATION_UNSPECIFIED -} - -func (x *Filter) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *Filter) GetFilters() []*Filter { - if x != nil { - return x.Filters - } - return nil -} - -// Selector chooses a number of nodes from the bucket taking the nearest nodes -// to the provided `ContainerID` by hash distance. -type Selector struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Selector name to reference in object placement section - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // How many nodes to select from the bucket - Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` - // Selector modifier showing how to form a bucket - Clause Clause `protobuf:"varint,3,opt,name=clause,proto3,enum=neo.fs.v2.netmap.Clause" json:"clause,omitempty"` - // Bucket attribute to select from - Attribute string `protobuf:"bytes,4,opt,name=attribute,proto3" json:"attribute,omitempty"` - // Filter reference to select from - Filter string `protobuf:"bytes,5,opt,name=filter,proto3" json:"filter,omitempty"` -} - -func (x *Selector) Reset() { - *x = Selector{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Selector) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Selector) ProtoMessage() {} - -func (x *Selector) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Selector.ProtoReflect.Descriptor instead. -func (*Selector) Descriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{1} -} - -func (x *Selector) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Selector) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *Selector) GetClause() Clause { - if x != nil { - return x.Clause - } - return Clause_CLAUSE_UNSPECIFIED -} - -func (x *Selector) GetAttribute() string { - if x != nil { - return x.Attribute - } - return "" -} - -func (x *Selector) GetFilter() string { - if x != nil { - return x.Filter - } - return "" -} - -// Number of object replicas in a set of nodes from the defined selector. If no -// selector set, the root bucket containing all possible nodes will be used by -// default. -type Replica struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // How many object replicas to put - Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - // Named selector bucket to put replicas - Selector string `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` - // Data shards count - EcDataCount uint32 `protobuf:"varint,3,opt,name=ec_data_count,json=ecDataCount,proto3" json:"ec_data_count,omitempty"` - // Parity shards count - EcParityCount uint32 `protobuf:"varint,4,opt,name=ec_parity_count,json=ecParityCount,proto3" json:"ec_parity_count,omitempty"` -} - -func (x *Replica) Reset() { - *x = Replica{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Replica) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Replica) ProtoMessage() {} - -func (x *Replica) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_types_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Replica.ProtoReflect.Descriptor instead. -func (*Replica) Descriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{2} -} - -func (x *Replica) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *Replica) GetSelector() string { - if x != nil { - return x.Selector - } - return "" -} - -func (x *Replica) GetEcDataCount() uint32 { - if x != nil { - return x.EcDataCount - } - return 0 -} - -func (x *Replica) GetEcParityCount() uint32 { - if x != nil { - return x.EcParityCount - } - return 0 -} - -// Set of rules to select a subset of nodes from `NetworkMap` able to store -// container's objects. The format is simple enough to transpile from different -// storage policy definition languages. -type PlacementPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Rules to set number of object replicas and place each one into a named - // bucket - Replicas []*Replica `protobuf:"bytes,1,rep,name=replicas,proto3" json:"replicas,omitempty"` - // Container backup factor controls how deep NeoFS will search for nodes - // alternatives to include into container's nodes subset - ContainerBackupFactor uint32 `protobuf:"varint,2,opt,name=container_backup_factor,json=containerBackupFactor,proto3" json:"container_backup_factor,omitempty"` - // Set of Selectors to form the container's nodes subset - Selectors []*Selector `protobuf:"bytes,3,rep,name=selectors,proto3" json:"selectors,omitempty"` - // List of named filters to reference in selectors - Filters []*Filter `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters,omitempty"` - // Unique flag defines non-overlapping application for replicas - Unique bool `protobuf:"varint,5,opt,name=unique,proto3" json:"unique,omitempty"` -} - -func (x *PlacementPolicy) Reset() { - *x = PlacementPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlacementPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlacementPolicy) ProtoMessage() {} - -func (x *PlacementPolicy) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_types_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PlacementPolicy.ProtoReflect.Descriptor instead. -func (*PlacementPolicy) Descriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{3} -} - -func (x *PlacementPolicy) GetReplicas() []*Replica { - if x != nil { - return x.Replicas - } - return nil -} - -func (x *PlacementPolicy) GetContainerBackupFactor() uint32 { - if x != nil { - return x.ContainerBackupFactor - } - return 0 -} - -func (x *PlacementPolicy) GetSelectors() []*Selector { - if x != nil { - return x.Selectors - } - return nil -} - -func (x *PlacementPolicy) GetFilters() []*Filter { - if x != nil { - return x.Filters - } - return nil -} - -func (x *PlacementPolicy) GetUnique() bool { - if x != nil { - return x.Unique - } - return false -} - -// NeoFS node description -type NodeInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Public key of the NeoFS node in a binary format - PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // Ways to connect to a node - Addresses []string `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"` - // Carries list of the NeoFS node attributes in a key-value form. Key name - // must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo - // structures with duplicated attribute names or attributes with empty values - // will be considered invalid. - Attributes []*NodeInfo_Attribute `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty"` - // Carries state of the NeoFS node - State NodeInfo_State `protobuf:"varint,4,opt,name=state,proto3,enum=neo.fs.v2.netmap.NodeInfo_State" json:"state,omitempty"` -} - -func (x *NodeInfo) Reset() { - *x = NodeInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeInfo) ProtoMessage() {} - -func (x *NodeInfo) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_types_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NodeInfo.ProtoReflect.Descriptor instead. -func (*NodeInfo) Descriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{4} -} - -func (x *NodeInfo) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *NodeInfo) GetAddresses() []string { - if x != nil { - return x.Addresses - } - return nil -} - -func (x *NodeInfo) GetAttributes() []*NodeInfo_Attribute { - if x != nil { - return x.Attributes - } - return nil -} - -func (x *NodeInfo) GetState() NodeInfo_State { - if x != nil { - return x.State - } - return NodeInfo_UNSPECIFIED -} - -// Network map structure -type Netmap struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Network map revision number. - Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` - // Nodes presented in network. - Nodes []*NodeInfo `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"` -} - -func (x *Netmap) Reset() { - *x = Netmap{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_types_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Netmap) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Netmap) ProtoMessage() {} - -func (x *Netmap) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_types_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Netmap.ProtoReflect.Descriptor instead. -func (*Netmap) Descriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{5} -} - -func (x *Netmap) GetEpoch() uint64 { - if x != nil { - return x.Epoch - } - return 0 -} - -func (x *Netmap) GetNodes() []*NodeInfo { - if x != nil { - return x.Nodes - } - return nil -} - -// NeoFS network configuration -type NetworkConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of parameter values - Parameters []*NetworkConfig_Parameter `protobuf:"bytes,1,rep,name=parameters,proto3" json:"parameters,omitempty"` -} - -func (x *NetworkConfig) Reset() { - *x = NetworkConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_types_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetworkConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetworkConfig) ProtoMessage() {} - -func (x *NetworkConfig) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_types_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetworkConfig.ProtoReflect.Descriptor instead. -func (*NetworkConfig) Descriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{6} -} - -func (x *NetworkConfig) GetParameters() []*NetworkConfig_Parameter { - if x != nil { - return x.Parameters - } - return nil -} - -// Information about NeoFS network -type NetworkInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Number of the current epoch in the NeoFS network - CurrentEpoch uint64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` - // Magic number of the sidechain of the NeoFS network - MagicNumber uint64 `protobuf:"varint,2,opt,name=magic_number,json=magicNumber,proto3" json:"magic_number,omitempty"` - // MillisecondsPerBlock network parameter of the sidechain of the NeoFS - // network - MsPerBlock int64 `protobuf:"varint,3,opt,name=ms_per_block,json=msPerBlock,proto3" json:"ms_per_block,omitempty"` - // NeoFS network configuration - NetworkConfig *NetworkConfig `protobuf:"bytes,4,opt,name=network_config,json=networkConfig,proto3" json:"network_config,omitempty"` -} - -func (x *NetworkInfo) Reset() { - *x = NetworkInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_types_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetworkInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetworkInfo) ProtoMessage() {} - -func (x *NetworkInfo) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_types_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetworkInfo.ProtoReflect.Descriptor instead. -func (*NetworkInfo) Descriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{7} -} - -func (x *NetworkInfo) GetCurrentEpoch() uint64 { - if x != nil { - return x.CurrentEpoch - } - return 0 -} - -func (x *NetworkInfo) GetMagicNumber() uint64 { - if x != nil { - return x.MagicNumber - } - return 0 -} - -func (x *NetworkInfo) GetMsPerBlock() int64 { - if x != nil { - return x.MsPerBlock - } - return 0 -} - -func (x *NetworkInfo) GetNetworkConfig() *NetworkConfig { - if x != nil { - return x.NetworkConfig - } - return nil -} - -// Administrator-defined Attributes of the NeoFS Storage Node. -// -// `Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8 -// string. Value can't be empty. -// -// Attributes can be constructed into a chain of attributes: any attribute can -// have a parent attribute and a child attribute (except the first and the -// last one). A string representation of the chain of attributes in NeoFS -// Storage Node configuration uses ":" and "/" symbols, e.g.: -// -// `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` -// -// Therefore the string attribute representation in the Node configuration -// must use "\:", "\/" and "\\" escaped symbols if any of them appears in an -// attribute's key or value. -// -// Node's attributes are mostly used during Storage Policy evaluation to -// calculate object's placement and find a set of nodes satisfying policy -// requirements. There are some "well-known" node attributes common to all the -// Storage Nodes in the network and used implicitly with default values if not -// explicitly set: -// -// - Capacity \ -// Total available disk space in Gigabytes. -// - Price \ -// Price in GAS tokens for storing one GB of data during one Epoch. In node -// attributes it's a string presenting floating point number with comma or -// point delimiter for decimal part. In the Network Map it will be saved as -// 64-bit unsigned integer representing number of minimal token fractions. -// - UN-LOCODE \ -// Node's geographic location in -// [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) -// format approximated to the nearest point defined in the standard. -// - CountryCode \ -// Country code in -// [ISO 3166-1_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) -// format. Calculated automatically from `UN-LOCODE` attribute. -// - Country \ -// Country short name in English, as defined in -// [ISO-3166](https://www.iso.org/obp/ui/#search). Calculated automatically -// from `UN-LOCODE` attribute. -// - Location \ -// Place names are given, whenever possible, in their national language -// versions as expressed in the Roman alphabet using the 26 characters of -// the character set adopted for international trade data interchange, -// written without diacritics . Calculated automatically from `UN-LOCODE` -// attribute. -// - SubDivCode \ -// Country's administrative subdivision where node is located. Calculated -// automatically from `UN-LOCODE` attribute based on `SubDiv` field. -// Presented in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) -// format. -// - SubDiv \ -// Country's administrative subdivision name, as defined in -// [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). Calculated -// automatically from `UN-LOCODE` attribute. -// - Continent \ -// Node's continent name according to the [Seven-Continent model] -// (https://en.wikipedia.org/wiki/Continent#Number). Calculated -// automatically from `UN-LOCODE` attribute. -// - ExternalAddr -// Node's preferred way for communications with external clients. -// Clients SHOULD use these addresses if possible. -// Must contain a comma-separated list of multi-addresses. -// -// For detailed description of each well-known attribute please see the -// corresponding section in NeoFS Technical Specification. -type NodeInfo_Attribute struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Key of the node attribute - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Value of the node attribute - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - // Parent keys, if any. For example for `City` it could be `Region` and - // `Country`. - Parents []string `protobuf:"bytes,3,rep,name=parents,proto3" json:"parents,omitempty"` -} - -func (x *NodeInfo_Attribute) Reset() { - *x = NodeInfo_Attribute{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_types_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeInfo_Attribute) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeInfo_Attribute) ProtoMessage() {} - -func (x *NodeInfo_Attribute) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_types_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NodeInfo_Attribute.ProtoReflect.Descriptor instead. -func (*NodeInfo_Attribute) Descriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{4, 0} -} - -func (x *NodeInfo_Attribute) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *NodeInfo_Attribute) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *NodeInfo_Attribute) GetParents() []string { - if x != nil { - return x.Parents - } - return nil -} - -// Single configuration parameter. Key MUST be network-unique. -// -// System parameters: -// - **AuditFee** \ -// Fee paid by the storage group owner to the Inner Ring member. -// Value: little-endian integer. Default: 0. -// - **BasicIncomeRate** \ -// Cost of storing one gigabyte of data for a period of one epoch. Paid by -// container owner to container nodes. -// Value: little-endian integer. Default: 0. -// - **ContainerAliasFee** \ -// Fee paid for named container's creation by the container owner. -// Value: little-endian integer. Default: 0. -// - **ContainerFee** \ -// Fee paid for container creation by the container owner. -// Value: little-endian integer. Default: 0. -// - **EpochDuration** \ -// NeoFS epoch duration measured in Sidechain blocks. -// Value: little-endian integer. Default: 0. -// - **HomomorphicHashingDisabled** \ -// Flag of disabling the homomorphic hashing of objects' payload. -// Value: true if any byte != 0. Default: false. -// - **InnerRingCandidateFee** \ -// Fee for entrance to the Inner Ring paid by the candidate. -// Value: little-endian integer. Default: 0. -// - **MaintenanceModeAllowed** \ -// Flag allowing setting the MAINTENANCE state to storage nodes. -// Value: true if any byte != 0. Default: false. -// - **MaxObjectSize** \ -// Maximum size of physically stored NeoFS object measured in bytes. -// Value: little-endian integer. Default: 0. -// - **WithdrawFee** \ -// Fee paid for withdrawal of funds paid by the account owner. -// Value: little-endian integer. Default: 0. -// - **MaxECDataCount** \ -// Maximum number of data shards for EC placement policy. -// Value: little-endian integer. Default: 0. -// - **MaxECParityCount** \ -// Maximum number of parity shards for EC placement policy. -// Value: little-endian integer. Default: 0. -type NetworkConfig_Parameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Parameter key. UTF-8 encoded string - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Parameter value - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NetworkConfig_Parameter) Reset() { - *x = NetworkConfig_Parameter{} - if protoimpl.UnsafeEnabled { - mi := &file_netmap_grpc_types_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetworkConfig_Parameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetworkConfig_Parameter) ProtoMessage() {} - -func (x *NetworkConfig_Parameter) ProtoReflect() protoreflect.Message { - mi := &file_netmap_grpc_types_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetworkConfig_Parameter.ProtoReflect.Descriptor instead. -func (*NetworkConfig_Parameter) Descriptor() ([]byte, []int) { - return file_netmap_grpc_types_proto_rawDescGZIP(), []int{6, 0} -} - -func (x *NetworkConfig_Parameter) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *NetworkConfig_Parameter) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -var File_netmap_grpc_types_proto protoreflect.FileDescriptor - -var file_netmap_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 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, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x22, 0xa5, 0x01, 0x0a, 0x06, - 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x02, - 0x6f, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, - 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x08, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6c, - 0x61, 0x75, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x43, 0x6c, - 0x61, 0x75, 0x73, 0x65, 0x52, 0x06, 0x63, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x22, 0x87, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x63, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x63, 0x44, 0x61, 0x74, 0x61, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x69, 0x74, - 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x65, - 0x63, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x86, 0x02, 0x0a, - 0x0f, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, - 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x08, 0x72, - 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x66, 0x61, 0x63, 0x74, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, - 0x38, 0x0a, 0x09, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, - 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, - 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, - 0x6e, 0x69, 0x71, 0x75, 0x65, 0x22, 0xd8, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, - 0x44, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x4d, 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, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x42, 0x0a, 0x05, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, - 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, - 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, - 0x22, 0x50, 0x0a, 0x06, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x30, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, - 0x61, 0x70, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x6e, 0x6f, 0x64, - 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x49, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, - 0x33, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, - 0x69, 0x63, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0b, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0c, - 0x6d, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x73, 0x50, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x46, - 0x0a, 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x7a, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, - 0x0a, 0x02, 0x45, 0x51, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x06, - 0x0a, 0x02, 0x47, 0x54, 0x10, 0x03, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x45, 0x10, 0x04, 0x12, 0x06, - 0x0a, 0x02, 0x4c, 0x54, 0x10, 0x05, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x45, 0x10, 0x06, 0x12, 0x06, - 0x0a, 0x02, 0x4f, 0x52, 0x10, 0x07, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x44, 0x10, 0x08, 0x12, - 0x07, 0x0a, 0x03, 0x4e, 0x4f, 0x54, 0x10, 0x09, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x4b, 0x45, - 0x10, 0x0a, 0x2a, 0x38, 0x0a, 0x06, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x12, - 0x43, 0x4c, 0x41, 0x55, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0c, - 0x0a, 0x08, 0x44, 0x49, 0x53, 0x54, 0x49, 0x4e, 0x43, 0x54, 0x10, 0x02, 0x42, 0x61, 0x5a, 0x42, - 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, - 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, - 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, - 0x6e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6e, 0x65, 0x74, 0x6d, - 0x61, 0x70, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4e, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_netmap_grpc_types_proto_rawDescOnce sync.Once - file_netmap_grpc_types_proto_rawDescData = file_netmap_grpc_types_proto_rawDesc -) - -func file_netmap_grpc_types_proto_rawDescGZIP() []byte { - file_netmap_grpc_types_proto_rawDescOnce.Do(func() { - file_netmap_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_netmap_grpc_types_proto_rawDescData) - }) - return file_netmap_grpc_types_proto_rawDescData -} - -var file_netmap_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_netmap_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_netmap_grpc_types_proto_goTypes = []interface{}{ - (Operation)(0), // 0: neo.fs.v2.netmap.Operation - (Clause)(0), // 1: neo.fs.v2.netmap.Clause - (NodeInfo_State)(0), // 2: neo.fs.v2.netmap.NodeInfo.State - (*Filter)(nil), // 3: neo.fs.v2.netmap.Filter - (*Selector)(nil), // 4: neo.fs.v2.netmap.Selector - (*Replica)(nil), // 5: neo.fs.v2.netmap.Replica - (*PlacementPolicy)(nil), // 6: neo.fs.v2.netmap.PlacementPolicy - (*NodeInfo)(nil), // 7: neo.fs.v2.netmap.NodeInfo - (*Netmap)(nil), // 8: neo.fs.v2.netmap.Netmap - (*NetworkConfig)(nil), // 9: neo.fs.v2.netmap.NetworkConfig - (*NetworkInfo)(nil), // 10: neo.fs.v2.netmap.NetworkInfo - (*NodeInfo_Attribute)(nil), // 11: neo.fs.v2.netmap.NodeInfo.Attribute - (*NetworkConfig_Parameter)(nil), // 12: neo.fs.v2.netmap.NetworkConfig.Parameter -} -var file_netmap_grpc_types_proto_depIdxs = []int32{ - 0, // 0: neo.fs.v2.netmap.Filter.op:type_name -> neo.fs.v2.netmap.Operation - 3, // 1: neo.fs.v2.netmap.Filter.filters:type_name -> neo.fs.v2.netmap.Filter - 1, // 2: neo.fs.v2.netmap.Selector.clause:type_name -> neo.fs.v2.netmap.Clause - 5, // 3: neo.fs.v2.netmap.PlacementPolicy.replicas:type_name -> neo.fs.v2.netmap.Replica - 4, // 4: neo.fs.v2.netmap.PlacementPolicy.selectors:type_name -> neo.fs.v2.netmap.Selector - 3, // 5: neo.fs.v2.netmap.PlacementPolicy.filters:type_name -> neo.fs.v2.netmap.Filter - 11, // 6: neo.fs.v2.netmap.NodeInfo.attributes:type_name -> neo.fs.v2.netmap.NodeInfo.Attribute - 2, // 7: neo.fs.v2.netmap.NodeInfo.state:type_name -> neo.fs.v2.netmap.NodeInfo.State - 7, // 8: neo.fs.v2.netmap.Netmap.nodes:type_name -> neo.fs.v2.netmap.NodeInfo - 12, // 9: neo.fs.v2.netmap.NetworkConfig.parameters:type_name -> neo.fs.v2.netmap.NetworkConfig.Parameter - 9, // 10: neo.fs.v2.netmap.NetworkInfo.network_config:type_name -> neo.fs.v2.netmap.NetworkConfig - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name -} - -func init() { file_netmap_grpc_types_proto_init() } -func file_netmap_grpc_types_proto_init() { - if File_netmap_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_netmap_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Selector); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Replica); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlacementPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Netmap); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetworkConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetworkInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeInfo_Attribute); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_netmap_grpc_types_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetworkConfig_Parameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_netmap_grpc_types_proto_rawDesc, - NumEnums: 3, - NumMessages: 10, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_netmap_grpc_types_proto_goTypes, - DependencyIndexes: file_netmap_grpc_types_proto_depIdxs, - EnumInfos: file_netmap_grpc_types_proto_enumTypes, - MessageInfos: file_netmap_grpc_types_proto_msgTypes, - }.Build() - File_netmap_grpc_types_proto = out.File - file_netmap_grpc_types_proto_rawDesc = nil - file_netmap_grpc_types_proto_goTypes = nil - file_netmap_grpc_types_proto_depIdxs = nil -} diff --git a/netmap/grpc/types_frostfs.pb.go b/netmap/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..3bab079 --- /dev/null +++ b/netmap/grpc/types_frostfs.pb.go @@ -0,0 +1,2453 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package netmap + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type Operation int32 + +const ( + Operation_OPERATION_UNSPECIFIED Operation = 0 + Operation_EQ Operation = 1 + Operation_NE Operation = 2 + Operation_GT Operation = 3 + Operation_GE Operation = 4 + Operation_LT Operation = 5 + Operation_LE Operation = 6 + Operation_OR Operation = 7 + Operation_AND Operation = 8 + Operation_NOT Operation = 9 + Operation_LIKE Operation = 10 +) + +var ( + Operation_name = map[int32]string{ + 0: "OPERATION_UNSPECIFIED", + 1: "EQ", + 2: "NE", + 3: "GT", + 4: "GE", + 5: "LT", + 6: "LE", + 7: "OR", + 8: "AND", + 9: "NOT", + 10: "LIKE", + } + Operation_value = map[string]int32{ + "OPERATION_UNSPECIFIED": 0, + "EQ": 1, + "NE": 2, + "GT": 3, + "GE": 4, + "LT": 5, + "LE": 6, + "OR": 7, + "AND": 8, + "NOT": 9, + "LIKE": 10, + } +) + +func (x Operation) String() string { + if v, ok := Operation_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Operation) FromString(s string) bool { + if v, ok := Operation_value[s]; ok { + *x = Operation(v) + return true + } + return false +} + +type Clause int32 + +const ( + Clause_CLAUSE_UNSPECIFIED Clause = 0 + Clause_SAME Clause = 1 + Clause_DISTINCT Clause = 2 +) + +var ( + Clause_name = map[int32]string{ + 0: "CLAUSE_UNSPECIFIED", + 1: "SAME", + 2: "DISTINCT", + } + Clause_value = map[string]int32{ + "CLAUSE_UNSPECIFIED": 0, + "SAME": 1, + "DISTINCT": 2, + } +) + +func (x Clause) String() string { + if v, ok := Clause_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Clause) FromString(s string) bool { + if v, ok := Clause_value[s]; ok { + *x = Clause(v) + return true + } + return false +} + +type Filter struct { + Name string `json:"name"` + Key string `json:"key"` + Op Operation `json:"op"` + Value string `json:"value"` + Filters []*Filter `json:"filters"` +} + +var ( + _ encoding.ProtoMarshaler = (*Filter)(nil) + _ encoding.ProtoUnmarshaler = (*Filter)(nil) + _ json.Marshaler = (*Filter)(nil) + _ json.Unmarshaler = (*Filter)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Filter) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.StringSize(1, x.Name) + size += proto.StringSize(2, x.Key) + size += proto.EnumSize(3, int32(x.Op)) + size += proto.StringSize(4, x.Value) + for i := range x.Filters { + size += proto.NestedStructureSize(5, x.Filters[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Filter) 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 *Filter) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Name) != 0 { + mm.AppendString(1, x.Name) + } + if len(x.Key) != 0 { + mm.AppendString(2, x.Key) + } + if int32(x.Op) != 0 { + mm.AppendInt32(3, int32(x.Op)) + } + if len(x.Value) != 0 { + mm.AppendString(4, x.Value) + } + for i := range x.Filters { + if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 { + x.Filters[i].EmitProtobuf(mm.AppendMessage(5)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Filter) 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", "Filter") + } + switch fc.FieldNum { + case 1: // Name + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Name") + } + x.Name = data + case 2: // Key + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Key") + } + x.Key = data + case 3: // Op + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Op") + } + x.Op = Operation(data) + case 4: // Value + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + case 5: // Filters + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Filters") + } + x.Filters = append(x.Filters, new(Filter)) + ff := x.Filters[len(x.Filters)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Filter) GetName() string { + if x != nil { + return x.Name + } + return "" +} +func (x *Filter) SetName(v string) { + x.Name = v +} +func (x *Filter) GetKey() string { + if x != nil { + return x.Key + } + return "" +} +func (x *Filter) SetKey(v string) { + x.Key = v +} +func (x *Filter) GetOp() Operation { + if x != nil { + return x.Op + } + return 0 +} +func (x *Filter) SetOp(v Operation) { + x.Op = v +} +func (x *Filter) GetValue() string { + if x != nil { + return x.Value + } + return "" +} +func (x *Filter) SetValue(v string) { + x.Value = v +} +func (x *Filter) GetFilters() []*Filter { + if x != nil { + return x.Filters + } + return nil +} +func (x *Filter) SetFilters(v []*Filter) { + x.Filters = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Filter) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"name\":" + out.RawString(prefix[1:]) + out.String(x.Name) + } + { + const prefix string = ",\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + { + const prefix string = ",\"op\":" + out.RawString(prefix) + out.Int32(int32(x.Op)) + } + { + const prefix string = ",\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + { + const prefix string = ",\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Filter) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Filter) 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 "name": + { + var f string + f = in.String() + x.Name = f + } + case "key": + { + var f string + f = in.String() + x.Key = f + } + case "op": + { + var f Operation + var parsedValue Operation + switch v := in.Interface().(type) { + case string: + if vv, ok := Operation_value[v]; ok { + parsedValue = Operation(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = Operation(vv) + case float64: + parsedValue = Operation(v) + } + f = parsedValue + x.Op = f + } + case "value": + { + var f string + f = in.String() + x.Value = f + } + case "filters": + { + var f *Filter + var list []*Filter + in.Delim('[') + for !in.IsDelim(']') { + f = new(Filter) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Filters = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Selector struct { + Name string `json:"name"` + Count uint32 `json:"count"` + Clause Clause `json:"clause"` + Attribute string `json:"attribute"` + Filter string `json:"filter"` +} + +var ( + _ encoding.ProtoMarshaler = (*Selector)(nil) + _ encoding.ProtoUnmarshaler = (*Selector)(nil) + _ json.Marshaler = (*Selector)(nil) + _ json.Unmarshaler = (*Selector)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Selector) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.StringSize(1, x.Name) + size += proto.UInt32Size(2, x.Count) + size += proto.EnumSize(3, int32(x.Clause)) + size += proto.StringSize(4, x.Attribute) + size += proto.StringSize(5, x.Filter) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Selector) 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 *Selector) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Name) != 0 { + mm.AppendString(1, x.Name) + } + if x.Count != 0 { + mm.AppendUint32(2, x.Count) + } + if int32(x.Clause) != 0 { + mm.AppendInt32(3, int32(x.Clause)) + } + if len(x.Attribute) != 0 { + mm.AppendString(4, x.Attribute) + } + if len(x.Filter) != 0 { + mm.AppendString(5, x.Filter) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Selector) 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", "Selector") + } + switch fc.FieldNum { + case 1: // Name + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Name") + } + x.Name = data + case 2: // Count + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Count") + } + x.Count = data + case 3: // Clause + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Clause") + } + x.Clause = Clause(data) + case 4: // Attribute + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Attribute") + } + x.Attribute = data + case 5: // Filter + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Filter") + } + x.Filter = data + } + } + return nil +} +func (x *Selector) GetName() string { + if x != nil { + return x.Name + } + return "" +} +func (x *Selector) SetName(v string) { + x.Name = v +} +func (x *Selector) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} +func (x *Selector) SetCount(v uint32) { + x.Count = v +} +func (x *Selector) GetClause() Clause { + if x != nil { + return x.Clause + } + return 0 +} +func (x *Selector) SetClause(v Clause) { + x.Clause = v +} +func (x *Selector) GetAttribute() string { + if x != nil { + return x.Attribute + } + return "" +} +func (x *Selector) SetAttribute(v string) { + x.Attribute = v +} +func (x *Selector) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} +func (x *Selector) SetFilter(v string) { + x.Filter = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Selector) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"name\":" + out.RawString(prefix[1:]) + out.String(x.Name) + } + { + const prefix string = ",\"count\":" + out.RawString(prefix) + out.Uint32(x.Count) + } + { + const prefix string = ",\"clause\":" + out.RawString(prefix) + out.Int32(int32(x.Clause)) + } + { + const prefix string = ",\"attribute\":" + out.RawString(prefix) + out.String(x.Attribute) + } + { + const prefix string = ",\"filter\":" + out.RawString(prefix) + out.String(x.Filter) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Selector) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Selector) 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 "name": + { + var f string + f = in.String() + x.Name = f + } + case "count": + { + var f uint32 + f = in.Uint32() + x.Count = f + } + case "clause": + { + var f Clause + var parsedValue Clause + switch v := in.Interface().(type) { + case string: + if vv, ok := Clause_value[v]; ok { + parsedValue = Clause(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = Clause(vv) + case float64: + parsedValue = Clause(v) + } + f = parsedValue + x.Clause = f + } + case "attribute": + { + var f string + f = in.String() + x.Attribute = f + } + case "filter": + { + var f string + f = in.String() + x.Filter = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Replica struct { + Count uint32 `json:"count"` + Selector string `json:"selector"` + EcDataCount uint32 `json:"ecDataCount"` + EcParityCount uint32 `json:"ecParityCount"` +} + +var ( + _ encoding.ProtoMarshaler = (*Replica)(nil) + _ encoding.ProtoUnmarshaler = (*Replica)(nil) + _ json.Marshaler = (*Replica)(nil) + _ json.Unmarshaler = (*Replica)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Replica) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt32Size(1, x.Count) + size += proto.StringSize(2, x.Selector) + size += proto.UInt32Size(3, x.EcDataCount) + size += proto.UInt32Size(4, x.EcParityCount) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Replica) 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 *Replica) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Count != 0 { + mm.AppendUint32(1, x.Count) + } + if len(x.Selector) != 0 { + mm.AppendString(2, x.Selector) + } + if x.EcDataCount != 0 { + mm.AppendUint32(3, x.EcDataCount) + } + if x.EcParityCount != 0 { + mm.AppendUint32(4, x.EcParityCount) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Replica) 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", "Replica") + } + switch fc.FieldNum { + case 1: // Count + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Count") + } + x.Count = data + case 2: // Selector + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Selector") + } + x.Selector = data + case 3: // EcDataCount + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "EcDataCount") + } + x.EcDataCount = data + case 4: // EcParityCount + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "EcParityCount") + } + x.EcParityCount = data + } + } + return nil +} +func (x *Replica) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} +func (x *Replica) SetCount(v uint32) { + x.Count = v +} +func (x *Replica) GetSelector() string { + if x != nil { + return x.Selector + } + return "" +} +func (x *Replica) SetSelector(v string) { + x.Selector = v +} +func (x *Replica) GetEcDataCount() uint32 { + if x != nil { + return x.EcDataCount + } + return 0 +} +func (x *Replica) SetEcDataCount(v uint32) { + x.EcDataCount = v +} +func (x *Replica) GetEcParityCount() uint32 { + if x != nil { + return x.EcParityCount + } + return 0 +} +func (x *Replica) SetEcParityCount(v uint32) { + x.EcParityCount = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Replica) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Replica) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"count\":" + out.RawString(prefix[1:]) + out.Uint32(x.Count) + } + { + const prefix string = ",\"selector\":" + out.RawString(prefix) + out.String(x.Selector) + } + { + const prefix string = ",\"ecDataCount\":" + out.RawString(prefix) + out.Uint32(x.EcDataCount) + } + { + const prefix string = ",\"ecParityCount\":" + out.RawString(prefix) + out.Uint32(x.EcParityCount) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Replica) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Replica) 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 "count": + { + var f uint32 + f = in.Uint32() + x.Count = f + } + case "selector": + { + var f string + f = in.String() + x.Selector = f + } + case "ecDataCount": + { + var f uint32 + f = in.Uint32() + x.EcDataCount = f + } + case "ecParityCount": + { + var f uint32 + f = in.Uint32() + x.EcParityCount = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type PlacementPolicy struct { + Replicas []*Replica `json:"replicas"` + ContainerBackupFactor uint32 `json:"containerBackupFactor"` + Selectors []*Selector `json:"selectors"` + Filters []*Filter `json:"filters"` + Unique bool `json:"unique"` +} + +var ( + _ encoding.ProtoMarshaler = (*PlacementPolicy)(nil) + _ encoding.ProtoUnmarshaler = (*PlacementPolicy)(nil) + _ json.Marshaler = (*PlacementPolicy)(nil) + _ json.Unmarshaler = (*PlacementPolicy)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PlacementPolicy) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.Replicas { + size += proto.NestedStructureSize(1, x.Replicas[i]) + } + size += proto.UInt32Size(2, x.ContainerBackupFactor) + for i := range x.Selectors { + size += proto.NestedStructureSize(3, x.Selectors[i]) + } + for i := range x.Filters { + size += proto.NestedStructureSize(4, x.Filters[i]) + } + size += proto.BoolSize(5, x.Unique) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PlacementPolicy) 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 *PlacementPolicy) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + for i := range x.Replicas { + if x.Replicas[i] != nil && x.Replicas[i].StableSize() != 0 { + x.Replicas[i].EmitProtobuf(mm.AppendMessage(1)) + } + } + if x.ContainerBackupFactor != 0 { + mm.AppendUint32(2, x.ContainerBackupFactor) + } + for i := range x.Selectors { + if x.Selectors[i] != nil && x.Selectors[i].StableSize() != 0 { + x.Selectors[i].EmitProtobuf(mm.AppendMessage(3)) + } + } + for i := range x.Filters { + if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 { + x.Filters[i].EmitProtobuf(mm.AppendMessage(4)) + } + } + if x.Unique { + mm.AppendBool(5, x.Unique) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PlacementPolicy) 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", "PlacementPolicy") + } + switch fc.FieldNum { + case 1: // Replicas + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Replicas") + } + x.Replicas = append(x.Replicas, new(Replica)) + ff := x.Replicas[len(x.Replicas)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // ContainerBackupFactor + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerBackupFactor") + } + x.ContainerBackupFactor = data + case 3: // Selectors + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Selectors") + } + x.Selectors = append(x.Selectors, new(Selector)) + ff := x.Selectors[len(x.Selectors)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 4: // Filters + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Filters") + } + x.Filters = append(x.Filters, new(Filter)) + ff := x.Filters[len(x.Filters)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 5: // Unique + data, ok := fc.Bool() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Unique") + } + x.Unique = data + } + } + return nil +} +func (x *PlacementPolicy) GetReplicas() []*Replica { + if x != nil { + return x.Replicas + } + return nil +} +func (x *PlacementPolicy) SetReplicas(v []*Replica) { + x.Replicas = v +} +func (x *PlacementPolicy) GetContainerBackupFactor() uint32 { + if x != nil { + return x.ContainerBackupFactor + } + return 0 +} +func (x *PlacementPolicy) SetContainerBackupFactor(v uint32) { + x.ContainerBackupFactor = v +} +func (x *PlacementPolicy) GetSelectors() []*Selector { + if x != nil { + return x.Selectors + } + return nil +} +func (x *PlacementPolicy) SetSelectors(v []*Selector) { + x.Selectors = v +} +func (x *PlacementPolicy) GetFilters() []*Filter { + if x != nil { + return x.Filters + } + return nil +} +func (x *PlacementPolicy) SetFilters(v []*Filter) { + x.Filters = v +} +func (x *PlacementPolicy) GetUnique() bool { + if x != nil { + return x.Unique + } + return false +} +func (x *PlacementPolicy) SetUnique(v bool) { + x.Unique = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PlacementPolicy) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"replicas\":" + out.RawString(prefix[1:]) + out.RawByte('[') + for i := range x.Replicas { + if i != 0 { + out.RawByte(',') + } + x.Replicas[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"containerBackupFactor\":" + out.RawString(prefix) + out.Uint32(x.ContainerBackupFactor) + } + { + const prefix string = ",\"selectors\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Selectors { + if i != 0 { + out.RawByte(',') + } + x.Selectors[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"unique\":" + out.RawString(prefix) + out.Bool(x.Unique) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PlacementPolicy) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PlacementPolicy) 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 "replicas": + { + var f *Replica + var list []*Replica + in.Delim('[') + for !in.IsDelim(']') { + f = new(Replica) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Replicas = list + in.Delim(']') + } + case "containerBackupFactor": + { + var f uint32 + f = in.Uint32() + x.ContainerBackupFactor = f + } + case "selectors": + { + var f *Selector + var list []*Selector + in.Delim('[') + for !in.IsDelim(']') { + f = new(Selector) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Selectors = list + in.Delim(']') + } + case "filters": + { + var f *Filter + var list []*Filter + in.Delim('[') + for !in.IsDelim(']') { + f = new(Filter) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Filters = list + in.Delim(']') + } + case "unique": + { + var f bool + f = in.Bool() + x.Unique = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NodeInfo_State int32 + +const ( + NodeInfo_UNSPECIFIED NodeInfo_State = 0 + NodeInfo_ONLINE NodeInfo_State = 1 + NodeInfo_OFFLINE NodeInfo_State = 2 + NodeInfo_MAINTENANCE NodeInfo_State = 3 +) + +var ( + NodeInfo_State_name = map[int32]string{ + 0: "UNSPECIFIED", + 1: "ONLINE", + 2: "OFFLINE", + 3: "MAINTENANCE", + } + NodeInfo_State_value = map[string]int32{ + "UNSPECIFIED": 0, + "ONLINE": 1, + "OFFLINE": 2, + "MAINTENANCE": 3, + } +) + +func (x NodeInfo_State) String() string { + if v, ok := NodeInfo_State_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *NodeInfo_State) FromString(s string) bool { + if v, ok := NodeInfo_State_value[s]; ok { + *x = NodeInfo_State(v) + return true + } + return false +} + +type NodeInfo_Attribute struct { + Key string `json:"key"` + Value string `json:"value"` + Parents []string `json:"parents"` +} + +var ( + _ encoding.ProtoMarshaler = (*NodeInfo_Attribute)(nil) + _ encoding.ProtoUnmarshaler = (*NodeInfo_Attribute)(nil) + _ json.Marshaler = (*NodeInfo_Attribute)(nil) + _ json.Unmarshaler = (*NodeInfo_Attribute)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NodeInfo_Attribute) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.StringSize(1, x.Key) + size += proto.StringSize(2, x.Value) + size += proto.RepeatedStringSize(3, x.Parents) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NodeInfo_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 *NodeInfo_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) + } + for j := range x.Parents { + mm.AppendString(3, x.Parents[j]) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NodeInfo_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", "NodeInfo_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 + case 3: // Parents + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Parents") + } + x.Parents = append(x.Parents, data) + } + } + return nil +} +func (x *NodeInfo_Attribute) GetKey() string { + if x != nil { + return x.Key + } + return "" +} +func (x *NodeInfo_Attribute) SetKey(v string) { + x.Key = v +} +func (x *NodeInfo_Attribute) GetValue() string { + if x != nil { + return x.Value + } + return "" +} +func (x *NodeInfo_Attribute) SetValue(v string) { + x.Value = v +} +func (x *NodeInfo_Attribute) GetParents() []string { + if x != nil { + return x.Parents + } + return nil +} +func (x *NodeInfo_Attribute) SetParents(v []string) { + x.Parents = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NodeInfo_Attribute) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NodeInfo_Attribute) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"key\":" + out.RawString(prefix[1:]) + out.String(x.Key) + } + { + const prefix string = ",\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + { + const prefix string = ",\"parents\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Parents { + if i != 0 { + out.RawByte(',') + } + out.String(x.Parents[i]) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NodeInfo_Attribute) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NodeInfo_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 + } + case "parents": + { + var f string + var list []string + in.Delim('[') + for !in.IsDelim(']') { + f = in.String() + list = append(list, f) + in.WantComma() + } + x.Parents = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NodeInfo struct { + PublicKey []byte `json:"publicKey"` + Addresses []string `json:"addresses"` + Attributes []*NodeInfo_Attribute `json:"attributes"` + State NodeInfo_State `json:"state"` +} + +var ( + _ encoding.ProtoMarshaler = (*NodeInfo)(nil) + _ encoding.ProtoUnmarshaler = (*NodeInfo)(nil) + _ json.Marshaler = (*NodeInfo)(nil) + _ json.Unmarshaler = (*NodeInfo)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NodeInfo) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.PublicKey) + size += proto.RepeatedStringSize(2, x.Addresses) + for i := range x.Attributes { + size += proto.NestedStructureSize(3, x.Attributes[i]) + } + size += proto.EnumSize(4, int32(x.State)) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NodeInfo) 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 *NodeInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.PublicKey) != 0 { + mm.AppendBytes(1, x.PublicKey) + } + for j := range x.Addresses { + mm.AppendString(2, x.Addresses[j]) + } + for i := range x.Attributes { + if x.Attributes[i] != nil && x.Attributes[i].StableSize() != 0 { + x.Attributes[i].EmitProtobuf(mm.AppendMessage(3)) + } + } + if int32(x.State) != 0 { + mm.AppendInt32(4, int32(x.State)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NodeInfo) 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", "NodeInfo") + } + switch fc.FieldNum { + case 1: // PublicKey + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "PublicKey") + } + x.PublicKey = data + case 2: // Addresses + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Addresses") + } + x.Addresses = append(x.Addresses, data) + case 3: // Attributes + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Attributes") + } + x.Attributes = append(x.Attributes, new(NodeInfo_Attribute)) + ff := x.Attributes[len(x.Attributes)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 4: // State + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "State") + } + x.State = NodeInfo_State(data) + } + } + return nil +} +func (x *NodeInfo) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} +func (x *NodeInfo) SetPublicKey(v []byte) { + x.PublicKey = v +} +func (x *NodeInfo) GetAddresses() []string { + if x != nil { + return x.Addresses + } + return nil +} +func (x *NodeInfo) SetAddresses(v []string) { + x.Addresses = v +} +func (x *NodeInfo) GetAttributes() []*NodeInfo_Attribute { + if x != nil { + return x.Attributes + } + return nil +} +func (x *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) { + x.Attributes = v +} +func (x *NodeInfo) GetState() NodeInfo_State { + if x != nil { + return x.State + } + return 0 +} +func (x *NodeInfo) SetState(v NodeInfo_State) { + x.State = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NodeInfo) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"publicKey\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.PublicKey) + } + { + const prefix string = ",\"addresses\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Addresses { + if i != 0 { + out.RawByte(',') + } + out.String(x.Addresses[i]) + } + out.RawByte(']') + } + { + const prefix string = ",\"attributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Attributes { + if i != 0 { + out.RawByte(',') + } + x.Attributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"state\":" + out.RawString(prefix) + out.Int32(int32(x.State)) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NodeInfo) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NodeInfo) 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 "publicKey": + { + var f []byte + f = in.Bytes() + x.PublicKey = f + } + case "addresses": + { + var f string + var list []string + in.Delim('[') + for !in.IsDelim(']') { + f = in.String() + list = append(list, f) + in.WantComma() + } + x.Addresses = list + in.Delim(']') + } + case "attributes": + { + var f *NodeInfo_Attribute + var list []*NodeInfo_Attribute + in.Delim('[') + for !in.IsDelim(']') { + f = new(NodeInfo_Attribute) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Attributes = list + in.Delim(']') + } + case "state": + { + var f NodeInfo_State + var parsedValue NodeInfo_State + switch v := in.Interface().(type) { + case string: + if vv, ok := NodeInfo_State_value[v]; ok { + parsedValue = NodeInfo_State(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = NodeInfo_State(vv) + case float64: + parsedValue = NodeInfo_State(v) + } + f = parsedValue + x.State = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Netmap struct { + Epoch uint64 `json:"epoch"` + Nodes []*NodeInfo `json:"nodes"` +} + +var ( + _ encoding.ProtoMarshaler = (*Netmap)(nil) + _ encoding.ProtoUnmarshaler = (*Netmap)(nil) + _ json.Marshaler = (*Netmap)(nil) + _ json.Unmarshaler = (*Netmap)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Netmap) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt64Size(1, x.Epoch) + for i := range x.Nodes { + size += proto.NestedStructureSize(2, x.Nodes[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Netmap) 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 *Netmap) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Epoch != 0 { + mm.AppendUint64(1, x.Epoch) + } + for i := range x.Nodes { + if x.Nodes[i] != nil && x.Nodes[i].StableSize() != 0 { + x.Nodes[i].EmitProtobuf(mm.AppendMessage(2)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Netmap) 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", "Netmap") + } + switch fc.FieldNum { + case 1: // Epoch + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Epoch") + } + x.Epoch = data + case 2: // Nodes + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Nodes") + } + x.Nodes = append(x.Nodes, new(NodeInfo)) + ff := x.Nodes[len(x.Nodes)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Netmap) GetEpoch() uint64 { + if x != nil { + return x.Epoch + } + return 0 +} +func (x *Netmap) SetEpoch(v uint64) { + x.Epoch = v +} +func (x *Netmap) GetNodes() []*NodeInfo { + if x != nil { + return x.Nodes + } + return nil +} +func (x *Netmap) SetNodes(v []*NodeInfo) { + x.Nodes = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Netmap) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Netmap) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"epoch\":" + out.RawString(prefix[1:]) + out.Uint64(x.Epoch) + } + { + const prefix string = ",\"nodes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Nodes { + if i != 0 { + out.RawByte(',') + } + x.Nodes[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Netmap) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Netmap) 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 "epoch": + { + var f uint64 + f = in.Uint64() + x.Epoch = f + } + case "nodes": + { + var f *NodeInfo + var list []*NodeInfo + in.Delim('[') + for !in.IsDelim(']') { + f = new(NodeInfo) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Nodes = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetworkConfig_Parameter struct { + Key []byte `json:"key"` + Value []byte `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*NetworkConfig_Parameter)(nil) + _ encoding.ProtoUnmarshaler = (*NetworkConfig_Parameter)(nil) + _ json.Marshaler = (*NetworkConfig_Parameter)(nil) + _ json.Unmarshaler = (*NetworkConfig_Parameter)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetworkConfig_Parameter) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.Key) + size += proto.BytesSize(2, x.Value) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetworkConfig_Parameter) 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 *NetworkConfig_Parameter) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Key) != 0 { + mm.AppendBytes(1, x.Key) + } + if len(x.Value) != 0 { + mm.AppendBytes(2, x.Value) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetworkConfig_Parameter) 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", "NetworkConfig_Parameter") + } + switch fc.FieldNum { + case 1: // Key + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Key") + } + x.Key = data + case 2: // Value + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + } + } + return nil +} +func (x *NetworkConfig_Parameter) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} +func (x *NetworkConfig_Parameter) SetKey(v []byte) { + x.Key = v +} +func (x *NetworkConfig_Parameter) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} +func (x *NetworkConfig_Parameter) SetValue(v []byte) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetworkConfig_Parameter) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetworkConfig_Parameter) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"key\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.Key) + } + { + const prefix string = ",\"value\":" + out.RawString(prefix) + out.Base64Bytes(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetworkConfig_Parameter) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetworkConfig_Parameter) 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 []byte + f = in.Bytes() + x.Key = f + } + case "value": + { + var f []byte + f = in.Bytes() + x.Value = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetworkConfig struct { + Parameters []*NetworkConfig_Parameter `json:"parameters"` +} + +var ( + _ encoding.ProtoMarshaler = (*NetworkConfig)(nil) + _ encoding.ProtoUnmarshaler = (*NetworkConfig)(nil) + _ json.Marshaler = (*NetworkConfig)(nil) + _ json.Unmarshaler = (*NetworkConfig)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetworkConfig) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.Parameters { + size += proto.NestedStructureSize(1, x.Parameters[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetworkConfig) 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 *NetworkConfig) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + for i := range x.Parameters { + if x.Parameters[i] != nil && x.Parameters[i].StableSize() != 0 { + x.Parameters[i].EmitProtobuf(mm.AppendMessage(1)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetworkConfig) 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", "NetworkConfig") + } + switch fc.FieldNum { + case 1: // Parameters + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Parameters") + } + x.Parameters = append(x.Parameters, new(NetworkConfig_Parameter)) + ff := x.Parameters[len(x.Parameters)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *NetworkConfig) GetParameters() []*NetworkConfig_Parameter { + if x != nil { + return x.Parameters + } + return nil +} +func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) { + x.Parameters = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetworkConfig) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetworkConfig) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"parameters\":" + out.RawString(prefix[1:]) + out.RawByte('[') + for i := range x.Parameters { + if i != 0 { + out.RawByte(',') + } + x.Parameters[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetworkConfig) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetworkConfig) 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 "parameters": + { + var f *NetworkConfig_Parameter + var list []*NetworkConfig_Parameter + in.Delim('[') + for !in.IsDelim(']') { + f = new(NetworkConfig_Parameter) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Parameters = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type NetworkInfo struct { + CurrentEpoch uint64 `json:"currentEpoch"` + MagicNumber uint64 `json:"magicNumber"` + MsPerBlock int64 `json:"msPerBlock"` + NetworkConfig *NetworkConfig `json:"networkConfig"` +} + +var ( + _ encoding.ProtoMarshaler = (*NetworkInfo)(nil) + _ encoding.ProtoUnmarshaler = (*NetworkInfo)(nil) + _ json.Marshaler = (*NetworkInfo)(nil) + _ json.Unmarshaler = (*NetworkInfo)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *NetworkInfo) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt64Size(1, x.CurrentEpoch) + size += proto.UInt64Size(2, x.MagicNumber) + size += proto.Int64Size(3, x.MsPerBlock) + size += proto.NestedStructureSize(4, x.NetworkConfig) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *NetworkInfo) 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 *NetworkInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.CurrentEpoch != 0 { + mm.AppendUint64(1, x.CurrentEpoch) + } + if x.MagicNumber != 0 { + mm.AppendUint64(2, x.MagicNumber) + } + if x.MsPerBlock != 0 { + mm.AppendInt64(3, x.MsPerBlock) + } + if x.NetworkConfig != nil && x.NetworkConfig.StableSize() != 0 { + x.NetworkConfig.EmitProtobuf(mm.AppendMessage(4)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *NetworkInfo) 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", "NetworkInfo") + } + switch fc.FieldNum { + case 1: // CurrentEpoch + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "CurrentEpoch") + } + x.CurrentEpoch = data + case 2: // MagicNumber + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MagicNumber") + } + x.MagicNumber = data + case 3: // MsPerBlock + data, ok := fc.Int64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MsPerBlock") + } + x.MsPerBlock = data + case 4: // NetworkConfig + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "NetworkConfig") + } + x.NetworkConfig = new(NetworkConfig) + if err := x.NetworkConfig.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *NetworkInfo) GetCurrentEpoch() uint64 { + if x != nil { + return x.CurrentEpoch + } + return 0 +} +func (x *NetworkInfo) SetCurrentEpoch(v uint64) { + x.CurrentEpoch = v +} +func (x *NetworkInfo) GetMagicNumber() uint64 { + if x != nil { + return x.MagicNumber + } + return 0 +} +func (x *NetworkInfo) SetMagicNumber(v uint64) { + x.MagicNumber = v +} +func (x *NetworkInfo) GetMsPerBlock() int64 { + if x != nil { + return x.MsPerBlock + } + return 0 +} +func (x *NetworkInfo) SetMsPerBlock(v int64) { + x.MsPerBlock = v +} +func (x *NetworkInfo) GetNetworkConfig() *NetworkConfig { + if x != nil { + return x.NetworkConfig + } + return nil +} +func (x *NetworkInfo) SetNetworkConfig(v *NetworkConfig) { + x.NetworkConfig = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *NetworkInfo) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"currentEpoch\":" + out.RawString(prefix[1:]) + out.Uint64(x.CurrentEpoch) + } + { + const prefix string = ",\"magicNumber\":" + out.RawString(prefix) + out.Uint64(x.MagicNumber) + } + { + const prefix string = ",\"msPerBlock\":" + out.RawString(prefix) + out.Int64(x.MsPerBlock) + } + { + const prefix string = ",\"networkConfig\":" + out.RawString(prefix) + x.NetworkConfig.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *NetworkInfo) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *NetworkInfo) 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 "currentEpoch": + { + var f uint64 + f = in.Uint64() + x.CurrentEpoch = f + } + case "magicNumber": + { + var f uint64 + f = in.Uint64() + x.MagicNumber = f + } + case "msPerBlock": + { + var f int64 + f = in.Int64() + x.MsPerBlock = f + } + case "networkConfig": + { + var f *NetworkConfig + f = new(NetworkConfig) + f.UnmarshalEasyJSON(in) + x.NetworkConfig = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/netmap/grpc/types_frostfs_fuzz.go b/netmap/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..89ccd74 --- /dev/null +++ b/netmap/grpc/types_frostfs_fuzz.go @@ -0,0 +1,159 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package netmap + +func DoFuzzProtoFilter(data []byte) int { + msg := new(Filter) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONFilter(data []byte) int { + msg := new(Filter) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoSelector(data []byte) int { + msg := new(Selector) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONSelector(data []byte) int { + msg := new(Selector) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoReplica(data []byte) int { + msg := new(Replica) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONReplica(data []byte) int { + msg := new(Replica) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoPlacementPolicy(data []byte) int { + msg := new(PlacementPolicy) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONPlacementPolicy(data []byte) int { + msg := new(PlacementPolicy) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoNodeInfo(data []byte) int { + msg := new(NodeInfo) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONNodeInfo(data []byte) int { + msg := new(NodeInfo) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoNetmap(data []byte) int { + msg := new(Netmap) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONNetmap(data []byte) int { + msg := new(Netmap) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoNetworkConfig(data []byte) int { + msg := new(NetworkConfig) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONNetworkConfig(data []byte) int { + msg := new(NetworkConfig) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoNetworkInfo(data []byte) int { + msg := new(NetworkInfo) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONNetworkInfo(data []byte) int { + msg := new(NetworkInfo) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/netmap/grpc/types_frostfs_test.go b/netmap/grpc/types_frostfs_test.go new file mode 100644 index 0000000..9996dc9 --- /dev/null +++ b/netmap/grpc/types_frostfs_test.go @@ -0,0 +1,91 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package netmap + +import ( + testing "testing" +) + +func FuzzProtoFilter(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoFilter(data) + }) +} +func FuzzJSONFilter(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONFilter(data) + }) +} +func FuzzProtoSelector(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoSelector(data) + }) +} +func FuzzJSONSelector(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONSelector(data) + }) +} +func FuzzProtoReplica(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoReplica(data) + }) +} +func FuzzJSONReplica(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONReplica(data) + }) +} +func FuzzProtoPlacementPolicy(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoPlacementPolicy(data) + }) +} +func FuzzJSONPlacementPolicy(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONPlacementPolicy(data) + }) +} +func FuzzProtoNodeInfo(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoNodeInfo(data) + }) +} +func FuzzJSONNodeInfo(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONNodeInfo(data) + }) +} +func FuzzProtoNetmap(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoNetmap(data) + }) +} +func FuzzJSONNetmap(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONNetmap(data) + }) +} +func FuzzProtoNetworkConfig(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoNetworkConfig(data) + }) +} +func FuzzJSONNetworkConfig(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONNetworkConfig(data) + }) +} +func FuzzProtoNetworkInfo(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoNetworkInfo(data) + }) +} +func FuzzJSONNetworkInfo(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONNetworkInfo(data) + }) +} diff --git a/object/convert.go b/object/convert.go index 9814b58..e237883 100644 --- a/object/convert.go +++ b/object/convert.go @@ -2491,7 +2491,7 @@ func (r *PatchResponseBody) ToGRPCMessage() grpc.Message { if r != nil { m = new(object.PatchResponse_Body) - m.SetObjectID(r.ObjectID.ToGRPCMessage().(*refsGRPC.ObjectID)) + m.SetObjectId(r.ObjectID.ToGRPCMessage().(*refsGRPC.ObjectID)) } return m diff --git a/object/grpc/service.go b/object/grpc/service.go deleted file mode 100644 index ef6422e..0000000 --- a/object/grpc/service.go +++ /dev/null @@ -1,610 +0,0 @@ -package object - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" -) - -// SetAddress sets address of the requested object. -func (m *GetRequest_Body) SetAddress(v *refs.Address) { - m.Address = v -} - -// SetRaw sets raw flag of the request. -func (m *GetRequest_Body) SetRaw(v bool) { - m.Raw = v -} - -// SetBody sets body of the request. -func (m *GetRequest) SetBody(v *GetRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *GetRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *GetRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetObjectId sets identifier of the object. -func (m *GetResponse_Body_Init) SetObjectId(v *refs.ObjectID) { - m.ObjectId = v -} - -// SetSignature sets signature of the object identifier. -func (m *GetResponse_Body_Init) SetSignature(v *refs.Signature) { - m.Signature = v -} - -// SetHeader sets header of the object. -func (m *GetResponse_Body_Init) SetHeader(v *Header) { - m.Header = v -} - -// GetChunk returns chunk of the object payload bytes. -func (m *GetResponse_Body_Chunk) GetChunk() []byte { - if m != nil { - return m.Chunk - } - - return nil -} - -// SetChunk sets chunk of the object payload bytes. -func (m *GetResponse_Body_Chunk) SetChunk(v []byte) { - m.Chunk = v -} - -// SetInit sets initial part of the object. -func (m *GetResponse_Body) SetInit(v *GetResponse_Body_Init) { - m.ObjectPart = &GetResponse_Body_Init_{ - Init: v, - } -} - -// SetChunk sets part of the object payload. -func (m *GetResponse_Body) SetChunk(v *GetResponse_Body_Chunk) { - m.ObjectPart = v -} - -// SetSplitInfo sets part of the object payload. -func (m *GetResponse_Body) SetSplitInfo(v *SplitInfo) { - m.ObjectPart = &GetResponse_Body_SplitInfo{ - SplitInfo: v, - } -} - -// SetEcInfo sets part of the object payload. -func (m *GetResponse_Body) SetEcInfo(v *ECInfo) { - m.ObjectPart = &GetResponse_Body_EcInfo{ - EcInfo: v, - } -} - -// SetBody sets body of the response. -func (m *GetResponse) SetBody(v *GetResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *GetResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *GetResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetObjectId sets identifier of the object. -func (m *PutRequest_Body_Init) SetObjectId(v *refs.ObjectID) { - m.ObjectId = v -} - -// SetSignature sets signature of the object identifier. -func (m *PutRequest_Body_Init) SetSignature(v *refs.Signature) { - m.Signature = v -} - -// SetHeader sets header of the object. -func (m *PutRequest_Body_Init) SetHeader(v *Header) { - m.Header = v -} - -// SetCopiesNumber sets number of the copies to save. -func (m *PutRequest_Body_Init) SetCopiesNumber(v []uint32) { - m.CopiesNumber = v -} - -// GetChunk returns chunk of the object payload bytes. -func (m *PutRequest_Body_Chunk) GetChunk() []byte { - if m != nil { - return m.Chunk - } - - return nil -} - -// SetChunk sets chunk of the object payload bytes. -func (m *PutRequest_Body_Chunk) SetChunk(v []byte) { - m.Chunk = v -} - -// SetInit sets initial part of the object. -func (m *PutRequest_Body) SetInit(v *PutRequest_Body_Init) { - m.ObjectPart = &PutRequest_Body_Init_{ - Init: v, - } -} - -// SetChunk sets part of the object payload. -func (m *PutRequest_Body) SetChunk(v *PutRequest_Body_Chunk) { - m.ObjectPart = v -} - -// SetBody sets body of the request. -func (m *PutRequest) SetBody(v *PutRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *PutRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *PutRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetObjectId sets identifier of the saved object. -func (m *PutResponse_Body) SetObjectId(v *refs.ObjectID) { - m.ObjectId = v -} - -// SetBody sets body of the response. -func (m *PutResponse) SetBody(v *PutResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *PutResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *PutResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetAddress sets address of the object to delete. -func (m *DeleteRequest_Body) SetAddress(v *refs.Address) { - m.Address = v -} - -// SetBody sets body of the request. -func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *DeleteRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *DeleteRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetTombstone sets tombstone address. -func (x *DeleteResponse_Body) SetTombstone(v *refs.Address) { - x.Tombstone = v -} - -// SetBody sets body of the response. -func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *DeleteResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *DeleteResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetAddress sets address of the object with the requested header. -func (m *HeadRequest_Body) SetAddress(v *refs.Address) { - m.Address = v -} - -// SetMainOnly sets flag to return the minimal header subset. -func (m *HeadRequest_Body) SetMainOnly(v bool) { - m.MainOnly = v -} - -// SetRaw sets raw flag of the request. -func (m *HeadRequest_Body) SetRaw(v bool) { - m.Raw = v -} - -// SetBody sets body of the request. -func (m *HeadRequest) SetBody(v *HeadRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *HeadRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *HeadRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetHeader sets object header. -func (m *HeaderWithSignature) SetHeader(v *Header) { - m.Header = v -} - -// SetSignature of the header. -func (m *HeaderWithSignature) SetSignature(v *refs.Signature) { - m.Signature = v -} - -// SetHeader sets full header of the object. -func (m *HeadResponse_Body) SetHeader(v *HeaderWithSignature) { - m.Head = &HeadResponse_Body_Header{ - Header: v, - } -} - -// SetShortHeader sets short header of the object. -func (m *HeadResponse_Body) SetShortHeader(v *ShortHeader) { - m.Head = &HeadResponse_Body_ShortHeader{ - ShortHeader: v, - } -} - -// SetSplitInfo sets meta info about split hierarchy of the object. -func (m *HeadResponse_Body) SetSplitInfo(v *SplitInfo) { - m.Head = &HeadResponse_Body_SplitInfo{ - SplitInfo: v, - } -} - -// SetEcInfo sets meta info about the erasure coded object. -func (m *HeadResponse_Body) SetEcInfo(v *ECInfo) { - m.Head = &HeadResponse_Body_EcInfo{ - EcInfo: v, - } -} - -// SetBody sets body of the response. -func (m *HeadResponse) SetBody(v *HeadResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *HeadResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *HeadResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetMatchType sets match type of the filter. -func (m *SearchRequest_Body_Filter) SetMatchType(v MatchType) { - m.MatchType = v -} - -// SetKey sets key to the filtering header. -func (m *SearchRequest_Body_Filter) SetKey(v string) { - m.Key = v -} - -// SetValue sets value of the filtering header. -func (m *SearchRequest_Body_Filter) SetValue(v string) { - m.Value = v -} - -// SetVersion sets version of the search query. -func (m *SearchRequest_Body) SetVersion(v uint32) { - m.Version = v -} - -// SetFilters sets list of the query filters. -func (m *SearchRequest_Body) SetFilters(v []*SearchRequest_Body_Filter) { - m.Filters = v -} - -// SetContainerId sets container ID of the search requets. -func (m *SearchRequest_Body) SetContainerId(v *refs.ContainerID) { - m.ContainerId = v -} - -// SetBody sets body of the request. -func (m *SearchRequest) SetBody(v *SearchRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *SearchRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *SearchRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetIdList sets list of the identifiers of the matched objects. -func (m *SearchResponse_Body) SetIdList(v []*refs.ObjectID) { - m.IdList = v -} - -// SetBody sets body of the response. -func (m *SearchResponse) SetBody(v *SearchResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *SearchResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *SearchResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetOffset sets offset of the payload range. -func (m *Range) SetOffset(v uint64) { - m.Offset = v -} - -// SetLength sets length of the payload range. -func (m *Range) SetLength(v uint64) { - m.Length = v -} - -// SetAddress sets address of the object with the request payload range. -func (m *GetRangeRequest_Body) SetAddress(v *refs.Address) { - m.Address = v -} - -// SetRange sets range of the object payload. -func (m *GetRangeRequest_Body) SetRange(v *Range) { - m.Range = v -} - -// SetRaw sets raw flag of the request. -func (m *GetRangeRequest_Body) SetRaw(v bool) { - m.Raw = v -} - -// SetBody sets body of the request. -func (m *GetRangeRequest) SetBody(v *GetRangeRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *GetRangeRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *GetRangeRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// GetChunk returns chunk of the object payload range bytes. -func (m *GetRangeResponse_Body_Chunk) GetChunk() []byte { - if m != nil { - return m.Chunk - } - - return nil -} - -// SetChunk sets chunk of the object payload range bytes. -func (m *GetRangeResponse_Body_Chunk) SetChunk(v []byte) { - m.Chunk = v -} - -// SetChunk sets chunk of the object payload. -func (m *GetRangeResponse_Body) SetChunk(v *GetRangeResponse_Body_Chunk) { - m.RangePart = v -} - -// SetSplitInfo sets meta info about split hierarchy of the object. -func (m *GetRangeResponse_Body) SetSplitInfo(v *SplitInfo) { - m.RangePart = &GetRangeResponse_Body_SplitInfo{ - SplitInfo: v, - } -} - -// SetEcInfo sets meta info about the erasure-coded object. -func (m *GetRangeResponse_Body) SetEcInfo(v *ECInfo) { - m.RangePart = &GetRangeResponse_Body_EcInfo{ - EcInfo: v, - } -} - -// SetBody sets body of the response. -func (m *GetRangeResponse) SetBody(v *GetRangeResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *GetRangeResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *GetRangeResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetAddress sets address of the object with the request payload range. -func (m *GetRangeHashRequest_Body) SetAddress(v *refs.Address) { - m.Address = v -} - -// SetRanges sets list of the ranges of the object payload. -func (m *GetRangeHashRequest_Body) SetRanges(v []*Range) { - m.Ranges = v -} - -// SetSalt sets salt for the object payload ranges. -func (m *GetRangeHashRequest_Body) SetSalt(v []byte) { - m.Salt = v -} - -// Set sets salt for the object payload ranges. -func (m *GetRangeHashRequest_Body) SetType(v refs.ChecksumType) { - m.Type = v -} - -// SetBody sets body of the request. -func (m *GetRangeHashRequest) SetBody(v *GetRangeHashRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *GetRangeHashRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *GetRangeHashRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetHashList returns list of the range hashes. -func (m *GetRangeHashResponse_Body) SetHashList(v [][]byte) { - m.HashList = v -} - -// SetHashList returns list of the range hashes. -func (m *GetRangeHashResponse_Body) SetType(v refs.ChecksumType) { - m.Type = v -} - -// SetBody sets body of the response. -func (m *GetRangeHashResponse) SetBody(v *GetRangeHashResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *GetRangeHashResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *GetRangeHashResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -// SetObject set object of the body. -func (m *PutSingleRequest_Body) SetObject(o *Object) { - m.Object = o -} - -// SetCopiesNumber sets copies number of the body. -func (m *PutSingleRequest_Body) SetCopiesNumber(v []uint32) { - m.CopiesNumber = v -} - -// SetBody sets body of the request. -func (m *PutSingleRequest) SetBody(b *PutSingleRequest_Body) { - m.Body = b -} - -// SetMetaHeader sets meta header of the request. -func (m *PutSingleRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *PutSingleRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetBody sets body of the response. -func (m *PutSingleResponse) SetBody(b *PutSingleResponse_Body) { - m.Body = b -} - -// SetMetaHeader sets meta header of the response. -func (m *PutSingleResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *PutSingleResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} - -func (m *PatchRequest_Body) SetAddress(addr *refs.Address) { - m.Address = addr -} - -func (m *PatchRequest_Body) SetNewAttributes(attrs []*Header_Attribute) { - m.NewAttributes = attrs -} - -func (m *PatchRequest_Body) SetReplaceAttributes(replaceAttributes bool) { - m.ReplaceAttributes = replaceAttributes -} - -func (m *PatchRequest_Body) SetPatch(patch *PatchRequest_Body_Patch) { - m.Patch = patch -} - -func (m *PatchRequest_Body_Patch) SetSourceRange(r *Range) { - m.SourceRange = r -} - -func (m *PatchRequest_Body_Patch) SetChunk(chunk []byte) { - m.Chunk = chunk -} - -func (m *PatchRequest) SetBody(b *PatchRequest_Body) { - m.Body = b -} - -func (m *PatchRequest) SetMetaHeader(v *session.RequestMetaHeader) { - m.MetaHeader = v -} - -func (m *PatchRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - m.VerifyHeader = v -} - -func (m *PatchResponse_Body) SetObjectID(objectID *refs.ObjectID) { - m.ObjectId = objectID -} - -func (m *PatchResponse) SetBody(b *PatchResponse_Body) { - m.Body = b -} - -func (m *PatchResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - m.MetaHeader = v -} - -func (m *PatchResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - m.VerifyHeader = v -} diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go deleted file mode 100644 index 979c932..0000000 --- a/object/grpc/service.pb.go +++ /dev/null @@ -1,4244 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: object/grpc/service.proto - -package object - -import ( - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GET object request -type GetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of get object request message. - Body *GetRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *GetRequest) Reset() { - *x = GetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest) ProtoMessage() {} - -func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. -func (*GetRequest) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{0} -} - -func (x *GetRequest) GetBody() *GetRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *GetRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// GET object response -type GetResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of get object response message. - Body *GetResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *GetResponse) Reset() { - *x = GetResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse) ProtoMessage() {} - -func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. -func (*GetResponse) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{1} -} - -func (x *GetResponse) GetBody() *GetResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *GetResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// PUT object request -type PutRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of put object request message. - Body *PutRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *PutRequest) Reset() { - *x = PutRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutRequest) ProtoMessage() {} - -func (x *PutRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutRequest.ProtoReflect.Descriptor instead. -func (*PutRequest) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{2} -} - -func (x *PutRequest) GetBody() *PutRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *PutRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *PutRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// PUT Object response -type PutResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of put object response message. - Body *PutResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *PutResponse) Reset() { - *x = PutResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutResponse) ProtoMessage() {} - -func (x *PutResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutResponse.ProtoReflect.Descriptor instead. -func (*PutResponse) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{3} -} - -func (x *PutResponse) GetBody() *PutResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *PutResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *PutResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Object DELETE request -type DeleteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of delete object request message. - Body *DeleteRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *DeleteRequest) Reset() { - *x = DeleteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRequest) ProtoMessage() {} - -func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{4} -} - -func (x *DeleteRequest) GetBody() *DeleteRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *DeleteRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *DeleteRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// DeleteResponse body is empty because we cannot guarantee permanent object -// removal in distributed system. -type DeleteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of delete object response message. - Body *DeleteResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *DeleteResponse) Reset() { - *x = DeleteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteResponse) ProtoMessage() {} - -func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. -func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{5} -} - -func (x *DeleteResponse) GetBody() *DeleteResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *DeleteResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *DeleteResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Object HEAD request -type HeadRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of head object request message. - Body *HeadRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *HeadRequest) Reset() { - *x = HeadRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeadRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeadRequest) ProtoMessage() {} - -func (x *HeadRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HeadRequest.ProtoReflect.Descriptor instead. -func (*HeadRequest) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{6} -} - -func (x *HeadRequest) GetBody() *HeadRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *HeadRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *HeadRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Tuple of a full object header and signature of an `ObjectID`. \ -// Signed `ObjectID` is present to verify full header's authenticity through the -// following steps: -// -// 1. Calculate `SHA-256` of the marshalled `Header` structure -// 2. Check if the resulting hash matches `ObjectID` -// 3. Check if `ObjectID` signature in `signature` field is correct -type HeaderWithSignature struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Full object header - Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // Signed `ObjectID` to verify full header's authenticity - Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *HeaderWithSignature) Reset() { - *x = HeaderWithSignature{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeaderWithSignature) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeaderWithSignature) ProtoMessage() {} - -func (x *HeaderWithSignature) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HeaderWithSignature.ProtoReflect.Descriptor instead. -func (*HeaderWithSignature) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{7} -} - -func (x *HeaderWithSignature) GetHeader() *Header { - if x != nil { - return x.Header - } - return nil -} - -func (x *HeaderWithSignature) GetSignature() *grpc1.Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Object HEAD response -type HeadResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of head object response message. - Body *HeadResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *HeadResponse) Reset() { - *x = HeadResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeadResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeadResponse) ProtoMessage() {} - -func (x *HeadResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HeadResponse.ProtoReflect.Descriptor instead. -func (*HeadResponse) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{8} -} - -func (x *HeadResponse) GetBody() *HeadResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *HeadResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *HeadResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Object Search request -type SearchRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of search object request message. - Body *SearchRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *SearchRequest) Reset() { - *x = SearchRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchRequest) ProtoMessage() {} - -func (x *SearchRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead. -func (*SearchRequest) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{9} -} - -func (x *SearchRequest) GetBody() *SearchRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *SearchRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *SearchRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Search response -type SearchResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of search object response message. - Body *SearchResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *SearchResponse) Reset() { - *x = SearchResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchResponse) ProtoMessage() {} - -func (x *SearchResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead. -func (*SearchResponse) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{10} -} - -func (x *SearchResponse) GetBody() *SearchResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *SearchResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *SearchResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Object payload range.Ranges of zero length SHOULD be considered as invalid. -type Range struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Offset of the range from the object payload start - Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - // Length in bytes of the object payload range - Length uint64 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` -} - -func (x *Range) Reset() { - *x = Range{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Range) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Range) ProtoMessage() {} - -func (x *Range) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Range.ProtoReflect.Descriptor instead. -func (*Range) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{11} -} - -func (x *Range) GetOffset() uint64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *Range) GetLength() uint64 { - if x != nil { - return x.Length - } - return 0 -} - -// Request part of object's payload -type GetRangeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of get range object request message. - Body *GetRangeRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *GetRangeRequest) Reset() { - *x = GetRangeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRangeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRangeRequest) ProtoMessage() {} - -func (x *GetRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRangeRequest.ProtoReflect.Descriptor instead. -func (*GetRangeRequest) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{12} -} - -func (x *GetRangeRequest) GetBody() *GetRangeRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetRangeRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *GetRangeRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Get part of object's payload -type GetRangeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of get range object response message. - Body *GetRangeResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *GetRangeResponse) Reset() { - *x = GetRangeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRangeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRangeResponse) ProtoMessage() {} - -func (x *GetRangeResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRangeResponse.ProtoReflect.Descriptor instead. -func (*GetRangeResponse) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{13} -} - -func (x *GetRangeResponse) GetBody() *GetRangeResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetRangeResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *GetRangeResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Get hash of object's payload part -type GetRangeHashRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of get range hash object request message. - Body *GetRangeHashRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *GetRangeHashRequest) Reset() { - *x = GetRangeHashRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRangeHashRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRangeHashRequest) ProtoMessage() {} - -func (x *GetRangeHashRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRangeHashRequest.ProtoReflect.Descriptor instead. -func (*GetRangeHashRequest) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{14} -} - -func (x *GetRangeHashRequest) GetBody() *GetRangeHashRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetRangeHashRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *GetRangeHashRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Get hash of object's payload part -type GetRangeHashResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of get range hash object response message. - Body *GetRangeHashResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *GetRangeHashResponse) Reset() { - *x = GetRangeHashResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRangeHashResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRangeHashResponse) ProtoMessage() {} - -func (x *GetRangeHashResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRangeHashResponse.ProtoReflect.Descriptor instead. -func (*GetRangeHashResponse) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{15} -} - -func (x *GetRangeHashResponse) GetBody() *GetRangeHashResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *GetRangeHashResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *GetRangeHashResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Object PUT Single request -type PutSingleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of put single object request message. - Body *PutSingleRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *PutSingleRequest) Reset() { - *x = PutSingleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutSingleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutSingleRequest) ProtoMessage() {} - -func (x *PutSingleRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutSingleRequest.ProtoReflect.Descriptor instead. -func (*PutSingleRequest) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{16} -} - -func (x *PutSingleRequest) GetBody() *PutSingleRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *PutSingleRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *PutSingleRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Object PUT Single response -type PutSingleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of put single object response message. - Body *PutSingleResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *PutSingleResponse) Reset() { - *x = PutSingleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutSingleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutSingleResponse) ProtoMessage() {} - -func (x *PutSingleResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutSingleResponse.ProtoReflect.Descriptor instead. -func (*PutSingleResponse) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{17} -} - -func (x *PutSingleResponse) GetBody() *PutSingleResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *PutSingleResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *PutSingleResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Object PATCH request -type PatchRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body for patch request message. - Body *PatchRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *grpc.RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *PatchRequest) Reset() { - *x = PatchRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PatchRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PatchRequest) ProtoMessage() {} - -func (x *PatchRequest) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PatchRequest.ProtoReflect.Descriptor instead. -func (*PatchRequest) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{18} -} - -func (x *PatchRequest) GetBody() *PatchRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *PatchRequest) GetMetaHeader() *grpc.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *PatchRequest) GetVerifyHeader() *grpc.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Object PATCH response -type PatchResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body for patch response message. - Body *PatchResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *grpc.ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. - VerifyHeader *grpc.ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *PatchResponse) Reset() { - *x = PatchResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PatchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PatchResponse) ProtoMessage() {} - -func (x *PatchResponse) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PatchResponse.ProtoReflect.Descriptor instead. -func (*PatchResponse) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{19} -} - -func (x *PatchResponse) GetBody() *PatchResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *PatchResponse) GetMetaHeader() *grpc.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *PatchResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// GET Object request body -type GetRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Address of the requested object - Address *grpc1.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // If `raw` flag is set, request will work only with objects that are - // physically stored on the peer node - Raw bool `protobuf:"varint,2,opt,name=raw,proto3" json:"raw,omitempty"` -} - -func (x *GetRequest_Body) Reset() { - *x = GetRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest_Body) ProtoMessage() {} - -func (x *GetRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRequest_Body.ProtoReflect.Descriptor instead. -func (*GetRequest_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *GetRequest_Body) GetAddress() *grpc1.Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *GetRequest_Body) GetRaw() bool { - if x != nil { - return x.Raw - } - return false -} - -// GET Object Response body -type GetResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Single message in the response stream. - // - // Types that are assignable to ObjectPart: - // - // *GetResponse_Body_Init_ - // *GetResponse_Body_Chunk - // *GetResponse_Body_SplitInfo - // *GetResponse_Body_EcInfo - ObjectPart isGetResponse_Body_ObjectPart `protobuf_oneof:"object_part"` -} - -func (x *GetResponse_Body) Reset() { - *x = GetResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse_Body) ProtoMessage() {} - -func (x *GetResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResponse_Body.ProtoReflect.Descriptor instead. -func (*GetResponse_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{1, 0} -} - -func (m *GetResponse_Body) GetObjectPart() isGetResponse_Body_ObjectPart { - if m != nil { - return m.ObjectPart - } - return nil -} - -func (x *GetResponse_Body) GetInit() *GetResponse_Body_Init { - if x, ok := x.GetObjectPart().(*GetResponse_Body_Init_); ok { - return x.Init - } - return nil -} - -func (x *GetResponse_Body) GetChunk() []byte { - if x, ok := x.GetObjectPart().(*GetResponse_Body_Chunk); ok { - return x.Chunk - } - return nil -} - -func (x *GetResponse_Body) GetSplitInfo() *SplitInfo { - if x, ok := x.GetObjectPart().(*GetResponse_Body_SplitInfo); ok { - return x.SplitInfo - } - return nil -} - -func (x *GetResponse_Body) GetEcInfo() *ECInfo { - if x, ok := x.GetObjectPart().(*GetResponse_Body_EcInfo); ok { - return x.EcInfo - } - return nil -} - -type isGetResponse_Body_ObjectPart interface { - isGetResponse_Body_ObjectPart() -} - -type GetResponse_Body_Init_ struct { - // Initial part of the object stream - Init *GetResponse_Body_Init `protobuf:"bytes,1,opt,name=init,proto3,oneof"` -} - -type GetResponse_Body_Chunk struct { - // Chunked object payload - Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3,oneof"` -} - -type GetResponse_Body_SplitInfo struct { - // Meta information of split hierarchy for object assembly. - SplitInfo *SplitInfo `protobuf:"bytes,3,opt,name=split_info,json=splitInfo,proto3,oneof"` -} - -type GetResponse_Body_EcInfo struct { - // Meta information for EC object assembly. - EcInfo *ECInfo `protobuf:"bytes,4,opt,name=ec_info,json=ecInfo,proto3,oneof"` -} - -func (*GetResponse_Body_Init_) isGetResponse_Body_ObjectPart() {} - -func (*GetResponse_Body_Chunk) isGetResponse_Body_ObjectPart() {} - -func (*GetResponse_Body_SplitInfo) isGetResponse_Body_ObjectPart() {} - -func (*GetResponse_Body_EcInfo) isGetResponse_Body_ObjectPart() {} - -// Initial part of the `Object` structure stream. Technically it's a -// set of all `Object` structure's fields except `payload`. -type GetResponse_Body_Init struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Object's unique identifier. - ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"` - // Signed `ObjectID` - Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - // Object metadata headers - Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` -} - -func (x *GetResponse_Body_Init) Reset() { - *x = GetResponse_Body_Init{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResponse_Body_Init) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse_Body_Init) ProtoMessage() {} - -func (x *GetResponse_Body_Init) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResponse_Body_Init.ProtoReflect.Descriptor instead. -func (*GetResponse_Body_Init) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{1, 0, 0} -} - -func (x *GetResponse_Body_Init) GetObjectId() *grpc1.ObjectID { - if x != nil { - return x.ObjectId - } - return nil -} - -func (x *GetResponse_Body_Init) GetSignature() *grpc1.Signature { - if x != nil { - return x.Signature - } - return nil -} - -func (x *GetResponse_Body_Init) GetHeader() *Header { - if x != nil { - return x.Header - } - return nil -} - -// PUT request body -type PutRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Single message in the request stream. - // - // Types that are assignable to ObjectPart: - // - // *PutRequest_Body_Init_ - // *PutRequest_Body_Chunk - ObjectPart isPutRequest_Body_ObjectPart `protobuf_oneof:"object_part"` -} - -func (x *PutRequest_Body) Reset() { - *x = PutRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutRequest_Body) ProtoMessage() {} - -func (x *PutRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutRequest_Body.ProtoReflect.Descriptor instead. -func (*PutRequest_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{2, 0} -} - -func (m *PutRequest_Body) GetObjectPart() isPutRequest_Body_ObjectPart { - if m != nil { - return m.ObjectPart - } - return nil -} - -func (x *PutRequest_Body) GetInit() *PutRequest_Body_Init { - if x, ok := x.GetObjectPart().(*PutRequest_Body_Init_); ok { - return x.Init - } - return nil -} - -func (x *PutRequest_Body) GetChunk() []byte { - if x, ok := x.GetObjectPart().(*PutRequest_Body_Chunk); ok { - return x.Chunk - } - return nil -} - -type isPutRequest_Body_ObjectPart interface { - isPutRequest_Body_ObjectPart() -} - -type PutRequest_Body_Init_ struct { - // Initial part of the object stream - Init *PutRequest_Body_Init `protobuf:"bytes,1,opt,name=init,proto3,oneof"` -} - -type PutRequest_Body_Chunk struct { - // Chunked object payload - Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3,oneof"` -} - -func (*PutRequest_Body_Init_) isPutRequest_Body_ObjectPart() {} - -func (*PutRequest_Body_Chunk) isPutRequest_Body_ObjectPart() {} - -// Newly created object structure parameters. If some optional parameters -// are not set, they will be calculated by a peer node. -type PutRequest_Body_Init struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ObjectID if available. - ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"` - // Object signature if available - Signature *grpc1.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - // Object's Header - Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` - // Number of copies of the object to store within the RPC call. By - // default, object is processed according to the container's placement - // policy. Can be one of: - // 1. A single number; applied to the whole request and is treated as - // a minimal number of nodes that must store an object to complete the - // request successfully. - // 2. An ordered array; every number is treated as a minimal number of - // nodes in a corresponding placement vector that must store an object - // to complete the request successfully. The length MUST equal the - // placement vectors number, otherwise request is considered malformed. - CopiesNumber []uint32 `protobuf:"varint,4,rep,packed,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` -} - -func (x *PutRequest_Body_Init) Reset() { - *x = PutRequest_Body_Init{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutRequest_Body_Init) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutRequest_Body_Init) ProtoMessage() {} - -func (x *PutRequest_Body_Init) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutRequest_Body_Init.ProtoReflect.Descriptor instead. -func (*PutRequest_Body_Init) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{2, 0, 0} -} - -func (x *PutRequest_Body_Init) GetObjectId() *grpc1.ObjectID { - if x != nil { - return x.ObjectId - } - return nil -} - -func (x *PutRequest_Body_Init) GetSignature() *grpc1.Signature { - if x != nil { - return x.Signature - } - return nil -} - -func (x *PutRequest_Body_Init) GetHeader() *Header { - if x != nil { - return x.Header - } - return nil -} - -func (x *PutRequest_Body_Init) GetCopiesNumber() []uint32 { - if x != nil { - return x.CopiesNumber - } - return nil -} - -// PUT Object response body -type PutResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the saved object - ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"` -} - -func (x *PutResponse_Body) Reset() { - *x = PutResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutResponse_Body) ProtoMessage() {} - -func (x *PutResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutResponse_Body.ProtoReflect.Descriptor instead. -func (*PutResponse_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *PutResponse_Body) GetObjectId() *grpc1.ObjectID { - if x != nil { - return x.ObjectId - } - return nil -} - -// Object DELETE request body -type DeleteRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Address of the object to be deleted - Address *grpc1.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (x *DeleteRequest_Body) Reset() { - *x = DeleteRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRequest_Body) ProtoMessage() {} - -func (x *DeleteRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRequest_Body.ProtoReflect.Descriptor instead. -func (*DeleteRequest_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{4, 0} -} - -func (x *DeleteRequest_Body) GetAddress() *grpc1.Address { - if x != nil { - return x.Address - } - return nil -} - -// Object DELETE Response has an empty body. -type DeleteResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Address of the tombstone created for the deleted object - Tombstone *grpc1.Address `protobuf:"bytes,1,opt,name=tombstone,proto3" json:"tombstone,omitempty"` -} - -func (x *DeleteResponse_Body) Reset() { - *x = DeleteResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteResponse_Body) ProtoMessage() {} - -func (x *DeleteResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteResponse_Body.ProtoReflect.Descriptor instead. -func (*DeleteResponse_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *DeleteResponse_Body) GetTombstone() *grpc1.Address { - if x != nil { - return x.Tombstone - } - return nil -} - -// Object HEAD request body -type HeadRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Address of the object with the requested Header - Address *grpc1.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // Return only minimal header subset - MainOnly bool `protobuf:"varint,2,opt,name=main_only,json=mainOnly,proto3" json:"main_only,omitempty"` - // If `raw` flag is set, request will work only with objects that are - // physically stored on the peer node - Raw bool `protobuf:"varint,3,opt,name=raw,proto3" json:"raw,omitempty"` -} - -func (x *HeadRequest_Body) Reset() { - *x = HeadRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeadRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeadRequest_Body) ProtoMessage() {} - -func (x *HeadRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HeadRequest_Body.ProtoReflect.Descriptor instead. -func (*HeadRequest_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{6, 0} -} - -func (x *HeadRequest_Body) GetAddress() *grpc1.Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *HeadRequest_Body) GetMainOnly() bool { - if x != nil { - return x.MainOnly - } - return false -} - -func (x *HeadRequest_Body) GetRaw() bool { - if x != nil { - return x.Raw - } - return false -} - -// Object HEAD response body -type HeadResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Requested object header, it's part or meta information about split - // object. - // - // Types that are assignable to Head: - // - // *HeadResponse_Body_Header - // *HeadResponse_Body_ShortHeader - // *HeadResponse_Body_SplitInfo - // *HeadResponse_Body_EcInfo - Head isHeadResponse_Body_Head `protobuf_oneof:"head"` -} - -func (x *HeadResponse_Body) Reset() { - *x = HeadResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeadResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeadResponse_Body) ProtoMessage() {} - -func (x *HeadResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HeadResponse_Body.ProtoReflect.Descriptor instead. -func (*HeadResponse_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{8, 0} -} - -func (m *HeadResponse_Body) GetHead() isHeadResponse_Body_Head { - if m != nil { - return m.Head - } - return nil -} - -func (x *HeadResponse_Body) GetHeader() *HeaderWithSignature { - if x, ok := x.GetHead().(*HeadResponse_Body_Header); ok { - return x.Header - } - return nil -} - -func (x *HeadResponse_Body) GetShortHeader() *ShortHeader { - if x, ok := x.GetHead().(*HeadResponse_Body_ShortHeader); ok { - return x.ShortHeader - } - return nil -} - -func (x *HeadResponse_Body) GetSplitInfo() *SplitInfo { - if x, ok := x.GetHead().(*HeadResponse_Body_SplitInfo); ok { - return x.SplitInfo - } - return nil -} - -func (x *HeadResponse_Body) GetEcInfo() *ECInfo { - if x, ok := x.GetHead().(*HeadResponse_Body_EcInfo); ok { - return x.EcInfo - } - return nil -} - -type isHeadResponse_Body_Head interface { - isHeadResponse_Body_Head() -} - -type HeadResponse_Body_Header struct { - // Full object's `Header` with `ObjectID` signature - Header *HeaderWithSignature `protobuf:"bytes,1,opt,name=header,proto3,oneof"` -} - -type HeadResponse_Body_ShortHeader struct { - // Short object header - ShortHeader *ShortHeader `protobuf:"bytes,2,opt,name=short_header,json=shortHeader,proto3,oneof"` -} - -type HeadResponse_Body_SplitInfo struct { - // Meta information of split hierarchy. - SplitInfo *SplitInfo `protobuf:"bytes,3,opt,name=split_info,json=splitInfo,proto3,oneof"` -} - -type HeadResponse_Body_EcInfo struct { - // Meta information for EC object assembly. - EcInfo *ECInfo `protobuf:"bytes,4,opt,name=ec_info,json=ecInfo,proto3,oneof"` -} - -func (*HeadResponse_Body_Header) isHeadResponse_Body_Head() {} - -func (*HeadResponse_Body_ShortHeader) isHeadResponse_Body_Head() {} - -func (*HeadResponse_Body_SplitInfo) isHeadResponse_Body_Head() {} - -func (*HeadResponse_Body_EcInfo) isHeadResponse_Body_Head() {} - -// Object Search request body -type SearchRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Container identifier were to search - ContainerId *grpc1.ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // Version of the Query Language used - Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` - // List of search expressions - Filters []*SearchRequest_Body_Filter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"` -} - -func (x *SearchRequest_Body) Reset() { - *x = SearchRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchRequest_Body) ProtoMessage() {} - -func (x *SearchRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchRequest_Body.ProtoReflect.Descriptor instead. -func (*SearchRequest_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{9, 0} -} - -func (x *SearchRequest_Body) GetContainerId() *grpc1.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -func (x *SearchRequest_Body) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { - if x != nil { - return x.Filters - } - return nil -} - -// Filter structure checks if the object header field or the attribute -// content matches a value. -// -// If no filters are set, search request will return all objects of the -// container, including Regular object and Tombstone -// objects. Most human users expect to get only object they can directly -// work with. In that case, `$Object:ROOT` filter should be used. -// -// By default `key` field refers to the corresponding object's `Attribute`. -// Some Object's header fields can also be accessed by adding `$Object:` -// prefix to the name. Here is the list of fields available via this prefix: -// -// - $Object:version \ -// version -// - $Object:objectID \ -// object_id -// - $Object:containerID \ -// container_id -// - $Object:ownerID \ -// owner_id -// - $Object:creationEpoch \ -// creation_epoch -// - $Object:payloadLength \ -// payload_length -// - $Object:payloadHash \ -// payload_hash -// - $Object:objectType \ -// object_type -// - $Object:homomorphicHash \ -// homomorphic_hash -// - $Object:split.parent \ -// object_id of parent -// - $Object:split.splitID \ -// 16 byte UUIDv4 used to identify the split object hierarchy parts -// - $Object:ec.parent \ -// If the object is stored according to EC policy, then ec_parent -// attribute is set to return an id list of all related EC chunks. -// -// There are some well-known filter aliases to match objects by certain -// properties: -// -// - $Object:ROOT \ -// Returns only `REGULAR` type objects that are not split or that are the -// top level root objects in a split hierarchy. This includes objects not -// present physically, like large objects split into smaller objects -// without a separate top-level root object. Objects of other types like -// Locks and Tombstones will not be shown. This filter may be -// useful for listing objects like `ls` command of some virtual file -// system. This filter is activated if the `key` exists, disregarding the -// value and matcher type. -// - $Object:PHY \ -// Returns only objects physically stored in the system. This filter is -// activated if the `key` exists, disregarding the value and matcher type. -// -// Note: using filters with a key with prefix `$Object:` and match type -// `NOT_PRESENT `is not recommended since this is not a cross-version -// approach. Behavior when processing this kind of filters is undefined. -type SearchRequest_Body_Filter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Match type to use - MatchType MatchType `protobuf:"varint,1,opt,name=match_type,json=matchType,proto3,enum=neo.fs.v2.object.MatchType" json:"match_type,omitempty"` - // Attribute or Header fields to match - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - // Value to match - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *SearchRequest_Body_Filter) Reset() { - *x = SearchRequest_Body_Filter{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchRequest_Body_Filter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchRequest_Body_Filter) ProtoMessage() {} - -func (x *SearchRequest_Body_Filter) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchRequest_Body_Filter.ProtoReflect.Descriptor instead. -func (*SearchRequest_Body_Filter) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{9, 0, 0} -} - -func (x *SearchRequest_Body_Filter) GetMatchType() MatchType { - if x != nil { - return x.MatchType - } - return MatchType_MATCH_TYPE_UNSPECIFIED -} - -func (x *SearchRequest_Body_Filter) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *SearchRequest_Body_Filter) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// Object Search response body -type SearchResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of `ObjectID`s that match the search query - IdList []*grpc1.ObjectID `protobuf:"bytes,1,rep,name=id_list,json=idList,proto3" json:"id_list,omitempty"` -} - -func (x *SearchResponse_Body) Reset() { - *x = SearchResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchResponse_Body) ProtoMessage() {} - -func (x *SearchResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchResponse_Body.ProtoReflect.Descriptor instead. -func (*SearchResponse_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{10, 0} -} - -func (x *SearchResponse_Body) GetIdList() []*grpc1.ObjectID { - if x != nil { - return x.IdList - } - return nil -} - -// Byte range of object's payload request body -type GetRangeRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Address of the object containing the requested payload range - Address *grpc1.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // Requested payload range - Range *Range `protobuf:"bytes,2,opt,name=range,proto3" json:"range,omitempty"` - // If `raw` flag is set, request will work only with objects that are - // physically stored on the peer node. - Raw bool `protobuf:"varint,3,opt,name=raw,proto3" json:"raw,omitempty"` -} - -func (x *GetRangeRequest_Body) Reset() { - *x = GetRangeRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRangeRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRangeRequest_Body) ProtoMessage() {} - -func (x *GetRangeRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRangeRequest_Body.ProtoReflect.Descriptor instead. -func (*GetRangeRequest_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{12, 0} -} - -func (x *GetRangeRequest_Body) GetAddress() *grpc1.Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *GetRangeRequest_Body) GetRange() *Range { - if x != nil { - return x.Range - } - return nil -} - -func (x *GetRangeRequest_Body) GetRaw() bool { - if x != nil { - return x.Raw - } - return false -} - -// Get Range response body uses streams to transfer the response. Because -// object payload considered a byte sequence, there is no need to have some -// initial preamble message. The requested byte range is sent as a series -// chunks. -type GetRangeResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Requested object range or meta information about split object. - // - // Types that are assignable to RangePart: - // - // *GetRangeResponse_Body_Chunk - // *GetRangeResponse_Body_SplitInfo - // *GetRangeResponse_Body_EcInfo - RangePart isGetRangeResponse_Body_RangePart `protobuf_oneof:"range_part"` -} - -func (x *GetRangeResponse_Body) Reset() { - *x = GetRangeResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRangeResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRangeResponse_Body) ProtoMessage() {} - -func (x *GetRangeResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRangeResponse_Body.ProtoReflect.Descriptor instead. -func (*GetRangeResponse_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{13, 0} -} - -func (m *GetRangeResponse_Body) GetRangePart() isGetRangeResponse_Body_RangePart { - if m != nil { - return m.RangePart - } - return nil -} - -func (x *GetRangeResponse_Body) GetChunk() []byte { - if x, ok := x.GetRangePart().(*GetRangeResponse_Body_Chunk); ok { - return x.Chunk - } - return nil -} - -func (x *GetRangeResponse_Body) GetSplitInfo() *SplitInfo { - if x, ok := x.GetRangePart().(*GetRangeResponse_Body_SplitInfo); ok { - return x.SplitInfo - } - return nil -} - -func (x *GetRangeResponse_Body) GetEcInfo() *ECInfo { - if x, ok := x.GetRangePart().(*GetRangeResponse_Body_EcInfo); ok { - return x.EcInfo - } - return nil -} - -type isGetRangeResponse_Body_RangePart interface { - isGetRangeResponse_Body_RangePart() -} - -type GetRangeResponse_Body_Chunk struct { - // Chunked object payload's range. - Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3,oneof"` -} - -type GetRangeResponse_Body_SplitInfo struct { - // Meta information of split hierarchy. - SplitInfo *SplitInfo `protobuf:"bytes,2,opt,name=split_info,json=splitInfo,proto3,oneof"` -} - -type GetRangeResponse_Body_EcInfo struct { - // Meta information for EC object assembly. - EcInfo *ECInfo `protobuf:"bytes,3,opt,name=ec_info,json=ecInfo,proto3,oneof"` -} - -func (*GetRangeResponse_Body_Chunk) isGetRangeResponse_Body_RangePart() {} - -func (*GetRangeResponse_Body_SplitInfo) isGetRangeResponse_Body_RangePart() {} - -func (*GetRangeResponse_Body_EcInfo) isGetRangeResponse_Body_RangePart() {} - -// Get hash of object's payload part request body. -type GetRangeHashRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Address of the object that containing the requested payload range - Address *grpc1.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // List of object's payload ranges to calculate homomorphic hash - Ranges []*Range `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges,omitempty"` - // Binary salt to XOR object's payload ranges before hash calculation - Salt []byte `protobuf:"bytes,3,opt,name=salt,proto3" json:"salt,omitempty"` - // Checksum algorithm type - Type grpc1.ChecksumType `protobuf:"varint,4,opt,name=type,proto3,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` -} - -func (x *GetRangeHashRequest_Body) Reset() { - *x = GetRangeHashRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRangeHashRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRangeHashRequest_Body) ProtoMessage() {} - -func (x *GetRangeHashRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRangeHashRequest_Body.ProtoReflect.Descriptor instead. -func (*GetRangeHashRequest_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{14, 0} -} - -func (x *GetRangeHashRequest_Body) GetAddress() *grpc1.Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *GetRangeHashRequest_Body) GetRanges() []*Range { - if x != nil { - return x.Ranges - } - return nil -} - -func (x *GetRangeHashRequest_Body) GetSalt() []byte { - if x != nil { - return x.Salt - } - return nil -} - -func (x *GetRangeHashRequest_Body) GetType() grpc1.ChecksumType { - if x != nil { - return x.Type - } - return grpc1.ChecksumType(0) -} - -// Get hash of object's payload part response body. -type GetRangeHashResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Checksum algorithm type - Type grpc1.ChecksumType `protobuf:"varint,1,opt,name=type,proto3,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` - // List of range hashes in a binary format - HashList [][]byte `protobuf:"bytes,2,rep,name=hash_list,json=hashList,proto3" json:"hash_list,omitempty"` -} - -func (x *GetRangeHashResponse_Body) Reset() { - *x = GetRangeHashResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRangeHashResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRangeHashResponse_Body) ProtoMessage() {} - -func (x *GetRangeHashResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[36] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRangeHashResponse_Body.ProtoReflect.Descriptor instead. -func (*GetRangeHashResponse_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{15, 0} -} - -func (x *GetRangeHashResponse_Body) GetType() grpc1.ChecksumType { - if x != nil { - return x.Type - } - return grpc1.ChecksumType(0) -} - -func (x *GetRangeHashResponse_Body) GetHashList() [][]byte { - if x != nil { - return x.HashList - } - return nil -} - -// PUT Single request body -type PutSingleRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Prepared object with payload. - Object *Object `protobuf:"bytes,1,opt,name=object,proto3" json:"object,omitempty"` - // Number of copies of the object to store within the RPC call. By default, - // object is processed according to the container's placement policy. - // Every number is treated as a minimal number of - // nodes in a corresponding placement vector that must store an object - // to complete the request successfully. The length MUST equal the placement - // vectors number, otherwise request is considered malformed. - CopiesNumber []uint32 `protobuf:"varint,2,rep,packed,name=copies_number,json=copiesNumber,proto3" json:"copies_number,omitempty"` -} - -func (x *PutSingleRequest_Body) Reset() { - *x = PutSingleRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutSingleRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutSingleRequest_Body) ProtoMessage() {} - -func (x *PutSingleRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[37] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutSingleRequest_Body.ProtoReflect.Descriptor instead. -func (*PutSingleRequest_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{16, 0} -} - -func (x *PutSingleRequest_Body) GetObject() *Object { - if x != nil { - return x.Object - } - return nil -} - -func (x *PutSingleRequest_Body) GetCopiesNumber() []uint32 { - if x != nil { - return x.CopiesNumber - } - return nil -} - -// PUT Single Object response body -type PutSingleResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *PutSingleResponse_Body) Reset() { - *x = PutSingleResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutSingleResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutSingleResponse_Body) ProtoMessage() {} - -func (x *PutSingleResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[38] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutSingleResponse_Body.ProtoReflect.Descriptor instead. -func (*PutSingleResponse_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{17, 0} -} - -// PATCH request body -type PatchRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The address of the object that is requested to get patched. - Address *grpc1.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // New attributes for the object. See `replace_attributes` flag usage to define how - // new attributes should be set. - NewAttributes []*Header_Attribute `protobuf:"bytes,2,rep,name=new_attributes,json=newAttributes,proto3" json:"new_attributes,omitempty"` - // If this flag is set, then the object's attributes will be entirely replaced by `new_attributes` list. - // The empty `new_attributes` list with `replace_attributes = true` just resets attributes list for the object. - // - // Default `false` value for this flag means the attributes will be just merged. If the incoming `new_attributes` - // list contains already existing key, then it just replaces it while merging the lists. - ReplaceAttributes bool `protobuf:"varint,3,opt,name=replace_attributes,json=replaceAttributes,proto3" json:"replace_attributes,omitempty"` - // The patch that is applied for the object. - Patch *PatchRequest_Body_Patch `protobuf:"bytes,4,opt,name=patch,proto3" json:"patch,omitempty"` -} - -func (x *PatchRequest_Body) Reset() { - *x = PatchRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PatchRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PatchRequest_Body) ProtoMessage() {} - -func (x *PatchRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[39] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PatchRequest_Body.ProtoReflect.Descriptor instead. -func (*PatchRequest_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{18, 0} -} - -func (x *PatchRequest_Body) GetAddress() *grpc1.Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *PatchRequest_Body) GetNewAttributes() []*Header_Attribute { - if x != nil { - return x.NewAttributes - } - return nil -} - -func (x *PatchRequest_Body) GetReplaceAttributes() bool { - if x != nil { - return x.ReplaceAttributes - } - return false -} - -func (x *PatchRequest_Body) GetPatch() *PatchRequest_Body_Patch { - if x != nil { - return x.Patch - } - return nil -} - -// The patch for the object's payload. -type PatchRequest_Body_Patch struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The range of the source object for which the payload is replaced by the patch's chunk. - // If the range's `length = 0`, then the patch's chunk is just appended to the original payload - // starting from the `offest` without any replace. - SourceRange *Range `protobuf:"bytes,1,opt,name=source_range,json=sourceRange,proto3" json:"source_range,omitempty"` - // The chunk that is being appended to or that replaces the original payload on the given range. - Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` -} - -func (x *PatchRequest_Body_Patch) Reset() { - *x = PatchRequest_Body_Patch{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PatchRequest_Body_Patch) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PatchRequest_Body_Patch) ProtoMessage() {} - -func (x *PatchRequest_Body_Patch) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[40] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PatchRequest_Body_Patch.ProtoReflect.Descriptor instead. -func (*PatchRequest_Body_Patch) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{18, 0, 0} -} - -func (x *PatchRequest_Body_Patch) GetSourceRange() *Range { - if x != nil { - return x.SourceRange - } - return nil -} - -func (x *PatchRequest_Body_Patch) GetChunk() []byte { - if x != nil { - return x.Chunk - } - return nil -} - -// PATCH response body -type PatchResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The object ID of the saved patched object. - ObjectId *grpc1.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectId,proto3" json:"object_id,omitempty"` -} - -func (x *PatchResponse_Body) Reset() { - *x = PatchResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_service_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PatchResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PatchResponse_Body) ProtoMessage() {} - -func (x *PatchResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_service_proto_msgTypes[41] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PatchResponse_Body.ProtoReflect.Descriptor instead. -func (*PatchResponse_Body) Descriptor() ([]byte, []int) { - return file_object_grpc_service_proto_rawDescGZIP(), []int{19, 0} -} - -func (x *PatchResponse_Body) GetObjectId() *grpc1.ObjectID { - if x != nil { - return x.ObjectId - } - return nil -} - -var File_object_grpc_service_proto protoreflect.FileDescriptor - -var file_object_grpc_service_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x17, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x02, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 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, 0x4b, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, - 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x03, 0x72, 0x61, 0x77, 0x22, 0xee, 0x04, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 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, 0x8a, 0x03, 0x0a, 0x04, 0x42, 0x6f, 0x64, - 0x79, 0x12, 0x3d, 0x0a, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, - 0x6f, 0x64, 0x79, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x69, 0x6e, 0x69, 0x74, - 0x12, 0x16, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, - 0x00, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x3c, 0x0a, 0x0a, 0x73, 0x70, 0x6c, 0x69, - 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, - 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x6c, - 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 0x0a, 0x07, 0x65, 0x63, 0x5f, 0x69, 0x6e, 0x66, - 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, - 0x6f, 0x48, 0x00, 0x52, 0x06, 0x65, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0xa8, 0x01, 0x0a, 0x04, - 0x49, 0x6e, 0x69, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, - 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x5f, 0x70, 0x61, 0x72, 0x74, 0x22, 0x9b, 0x04, 0x0a, 0x0a, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 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, 0xbb, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3c, - 0x0a, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, - 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, - 0x49, 0x6e, 0x69, 0x74, 0x48, 0x00, 0x52, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x05, - 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x63, - 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0xcd, 0x01, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x35, 0x0a, - 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, - 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, - 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, - 0x61, 0x72, 0x74, 0x22, 0xa0, 0x02, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 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, 0x3d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, - 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x22, 0x9e, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 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, 0x39, 0x0a, 0x04, - 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa6, 0x02, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 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, 0x3d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x74, 0x6f, 0x6d, - 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x09, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, - 0x22, 0xc9, 0x02, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x36, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 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, 0x68, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, - 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, - 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, 0x80, 0x01, 0x0a, - 0x13, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, - 0xec, 0x03, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x37, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 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, 0x86, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3f, - 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x42, 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0a, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x66, - 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x33, 0x0a, 0x07, 0x65, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x06, - 0x65, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x06, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x22, 0xfb, - 0x03, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 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, 0x95, 0x02, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3e, 0x0a, - 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, - 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x6c, - 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa2, 0x02, 0x0a, - 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 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, 0x39, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, - 0x0a, 0x07, 0x69, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 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, 0x06, 0x69, 0x64, 0x4c, 0x69, 0x73, - 0x74, 0x22, 0x37, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0xe3, 0x02, 0x0a, 0x0f, 0x47, - 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, - 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 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, 0x7a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x2d, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x72, 0x61, 0x77, - 0x22, 0x8d, 0x03, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 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, 0x9f, - 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x16, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x12, - 0x3c, 0x0a, 0x0a, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 0x0a, - 0x07, 0x65, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x06, 0x65, 0x63, 0x49, 0x6e, - 0x66, 0x6f, 0x42, 0x0c, 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, - 0x22, 0xa2, 0x03, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, - 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 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, 0xb0, 0x01, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, - 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, - 0x12, 0x0a, 0x04, 0x73, 0x61, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, - 0x61, 0x6c, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, - 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xca, 0x02, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, - 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, - 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 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, 0x55, 0x0a, 0x04, 0x42, - 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, - 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x6c, 0x69, - 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x68, 0x61, 0x73, 0x68, 0x4c, 0x69, - 0x73, 0x74, 0x22, 0xc8, 0x02, 0x0a, 0x10, 0x50, 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, - 0x6c, 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, 0x5d, - 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x69, - 0x65, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, - 0x0c, 0x63, 0x6f, 0x70, 0x69, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xf5, 0x01, - 0x0a, 0x11, 0x50, 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x28, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 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, 0x06, 0x0a, - 0x04, 0x42, 0x6f, 0x64, 0x79, 0x22, 0xb3, 0x04, 0x0a, 0x0c, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 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, 0xcf, 0x02, 0x0a, 0x04, 0x42, 0x6f, - 0x64, 0x79, 0x12, 0x31, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x0e, 0x6e, 0x65, 0x77, 0x5f, 0x61, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x52, 0x0d, 0x6e, 0x65, 0x77, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, - 0x12, 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x5f, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x72, 0x65, - 0x70, 0x6c, 0x61, 0x63, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, - 0x3f, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x42, - 0x6f, 0x64, 0x79, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, - 0x1a, 0x59, 0x0a, 0x05, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0xa4, 0x02, 0x0a, 0x0d, - 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, - 0x61, 0x74, 0x63, 0x68, 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, 0x3d, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x49, 0x64, 0x32, 0xd4, 0x05, 0x0a, 0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x03, 0x50, 0x75, - 0x74, 0x12, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, - 0x12, 0x4b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, - 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x1d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x1f, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x30, 0x01, 0x12, 0x53, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, - 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x09, 0x50, 0x75, 0x74, 0x53, 0x69, - 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x75, 0x74, 0x53, - 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, - 0x05, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, - 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, - 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, - 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_object_grpc_service_proto_rawDescOnce sync.Once - file_object_grpc_service_proto_rawDescData = file_object_grpc_service_proto_rawDesc -) - -func file_object_grpc_service_proto_rawDescGZIP() []byte { - file_object_grpc_service_proto_rawDescOnce.Do(func() { - file_object_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_object_grpc_service_proto_rawDescData) - }) - return file_object_grpc_service_proto_rawDescData -} - -var file_object_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 42) -var file_object_grpc_service_proto_goTypes = []interface{}{ - (*GetRequest)(nil), // 0: neo.fs.v2.object.GetRequest - (*GetResponse)(nil), // 1: neo.fs.v2.object.GetResponse - (*PutRequest)(nil), // 2: neo.fs.v2.object.PutRequest - (*PutResponse)(nil), // 3: neo.fs.v2.object.PutResponse - (*DeleteRequest)(nil), // 4: neo.fs.v2.object.DeleteRequest - (*DeleteResponse)(nil), // 5: neo.fs.v2.object.DeleteResponse - (*HeadRequest)(nil), // 6: neo.fs.v2.object.HeadRequest - (*HeaderWithSignature)(nil), // 7: neo.fs.v2.object.HeaderWithSignature - (*HeadResponse)(nil), // 8: neo.fs.v2.object.HeadResponse - (*SearchRequest)(nil), // 9: neo.fs.v2.object.SearchRequest - (*SearchResponse)(nil), // 10: neo.fs.v2.object.SearchResponse - (*Range)(nil), // 11: neo.fs.v2.object.Range - (*GetRangeRequest)(nil), // 12: neo.fs.v2.object.GetRangeRequest - (*GetRangeResponse)(nil), // 13: neo.fs.v2.object.GetRangeResponse - (*GetRangeHashRequest)(nil), // 14: neo.fs.v2.object.GetRangeHashRequest - (*GetRangeHashResponse)(nil), // 15: neo.fs.v2.object.GetRangeHashResponse - (*PutSingleRequest)(nil), // 16: neo.fs.v2.object.PutSingleRequest - (*PutSingleResponse)(nil), // 17: neo.fs.v2.object.PutSingleResponse - (*PatchRequest)(nil), // 18: neo.fs.v2.object.PatchRequest - (*PatchResponse)(nil), // 19: neo.fs.v2.object.PatchResponse - (*GetRequest_Body)(nil), // 20: neo.fs.v2.object.GetRequest.Body - (*GetResponse_Body)(nil), // 21: neo.fs.v2.object.GetResponse.Body - (*GetResponse_Body_Init)(nil), // 22: neo.fs.v2.object.GetResponse.Body.Init - (*PutRequest_Body)(nil), // 23: neo.fs.v2.object.PutRequest.Body - (*PutRequest_Body_Init)(nil), // 24: neo.fs.v2.object.PutRequest.Body.Init - (*PutResponse_Body)(nil), // 25: neo.fs.v2.object.PutResponse.Body - (*DeleteRequest_Body)(nil), // 26: neo.fs.v2.object.DeleteRequest.Body - (*DeleteResponse_Body)(nil), // 27: neo.fs.v2.object.DeleteResponse.Body - (*HeadRequest_Body)(nil), // 28: neo.fs.v2.object.HeadRequest.Body - (*HeadResponse_Body)(nil), // 29: neo.fs.v2.object.HeadResponse.Body - (*SearchRequest_Body)(nil), // 30: neo.fs.v2.object.SearchRequest.Body - (*SearchRequest_Body_Filter)(nil), // 31: neo.fs.v2.object.SearchRequest.Body.Filter - (*SearchResponse_Body)(nil), // 32: neo.fs.v2.object.SearchResponse.Body - (*GetRangeRequest_Body)(nil), // 33: neo.fs.v2.object.GetRangeRequest.Body - (*GetRangeResponse_Body)(nil), // 34: neo.fs.v2.object.GetRangeResponse.Body - (*GetRangeHashRequest_Body)(nil), // 35: neo.fs.v2.object.GetRangeHashRequest.Body - (*GetRangeHashResponse_Body)(nil), // 36: neo.fs.v2.object.GetRangeHashResponse.Body - (*PutSingleRequest_Body)(nil), // 37: neo.fs.v2.object.PutSingleRequest.Body - (*PutSingleResponse_Body)(nil), // 38: neo.fs.v2.object.PutSingleResponse.Body - (*PatchRequest_Body)(nil), // 39: neo.fs.v2.object.PatchRequest.Body - (*PatchRequest_Body_Patch)(nil), // 40: neo.fs.v2.object.PatchRequest.Body.Patch - (*PatchResponse_Body)(nil), // 41: neo.fs.v2.object.PatchResponse.Body - (*grpc.RequestMetaHeader)(nil), // 42: neo.fs.v2.session.RequestMetaHeader - (*grpc.RequestVerificationHeader)(nil), // 43: neo.fs.v2.session.RequestVerificationHeader - (*grpc.ResponseMetaHeader)(nil), // 44: neo.fs.v2.session.ResponseMetaHeader - (*grpc.ResponseVerificationHeader)(nil), // 45: neo.fs.v2.session.ResponseVerificationHeader - (*Header)(nil), // 46: neo.fs.v2.object.Header - (*grpc1.Signature)(nil), // 47: neo.fs.v2.refs.Signature - (*grpc1.Address)(nil), // 48: neo.fs.v2.refs.Address - (*SplitInfo)(nil), // 49: neo.fs.v2.object.SplitInfo - (*ECInfo)(nil), // 50: neo.fs.v2.object.ECInfo - (*grpc1.ObjectID)(nil), // 51: neo.fs.v2.refs.ObjectID - (*ShortHeader)(nil), // 52: neo.fs.v2.object.ShortHeader - (*grpc1.ContainerID)(nil), // 53: neo.fs.v2.refs.ContainerID - (MatchType)(0), // 54: neo.fs.v2.object.MatchType - (grpc1.ChecksumType)(0), // 55: neo.fs.v2.refs.ChecksumType - (*Object)(nil), // 56: neo.fs.v2.object.Object - (*Header_Attribute)(nil), // 57: neo.fs.v2.object.Header.Attribute -} -var file_object_grpc_service_proto_depIdxs = []int32{ - 20, // 0: neo.fs.v2.object.GetRequest.body:type_name -> neo.fs.v2.object.GetRequest.Body - 42, // 1: neo.fs.v2.object.GetRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 43, // 2: neo.fs.v2.object.GetRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 21, // 3: neo.fs.v2.object.GetResponse.body:type_name -> neo.fs.v2.object.GetResponse.Body - 44, // 4: neo.fs.v2.object.GetResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 45, // 5: neo.fs.v2.object.GetResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 23, // 6: neo.fs.v2.object.PutRequest.body:type_name -> neo.fs.v2.object.PutRequest.Body - 42, // 7: neo.fs.v2.object.PutRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 43, // 8: neo.fs.v2.object.PutRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 25, // 9: neo.fs.v2.object.PutResponse.body:type_name -> neo.fs.v2.object.PutResponse.Body - 44, // 10: neo.fs.v2.object.PutResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 45, // 11: neo.fs.v2.object.PutResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 26, // 12: neo.fs.v2.object.DeleteRequest.body:type_name -> neo.fs.v2.object.DeleteRequest.Body - 42, // 13: neo.fs.v2.object.DeleteRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 43, // 14: neo.fs.v2.object.DeleteRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 27, // 15: neo.fs.v2.object.DeleteResponse.body:type_name -> neo.fs.v2.object.DeleteResponse.Body - 44, // 16: neo.fs.v2.object.DeleteResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 45, // 17: neo.fs.v2.object.DeleteResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 28, // 18: neo.fs.v2.object.HeadRequest.body:type_name -> neo.fs.v2.object.HeadRequest.Body - 42, // 19: neo.fs.v2.object.HeadRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 43, // 20: neo.fs.v2.object.HeadRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 46, // 21: neo.fs.v2.object.HeaderWithSignature.header:type_name -> neo.fs.v2.object.Header - 47, // 22: neo.fs.v2.object.HeaderWithSignature.signature:type_name -> neo.fs.v2.refs.Signature - 29, // 23: neo.fs.v2.object.HeadResponse.body:type_name -> neo.fs.v2.object.HeadResponse.Body - 44, // 24: neo.fs.v2.object.HeadResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 45, // 25: neo.fs.v2.object.HeadResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 30, // 26: neo.fs.v2.object.SearchRequest.body:type_name -> neo.fs.v2.object.SearchRequest.Body - 42, // 27: neo.fs.v2.object.SearchRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 43, // 28: neo.fs.v2.object.SearchRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 32, // 29: neo.fs.v2.object.SearchResponse.body:type_name -> neo.fs.v2.object.SearchResponse.Body - 44, // 30: neo.fs.v2.object.SearchResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 45, // 31: neo.fs.v2.object.SearchResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 33, // 32: neo.fs.v2.object.GetRangeRequest.body:type_name -> neo.fs.v2.object.GetRangeRequest.Body - 42, // 33: neo.fs.v2.object.GetRangeRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 43, // 34: neo.fs.v2.object.GetRangeRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 34, // 35: neo.fs.v2.object.GetRangeResponse.body:type_name -> neo.fs.v2.object.GetRangeResponse.Body - 44, // 36: neo.fs.v2.object.GetRangeResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 45, // 37: neo.fs.v2.object.GetRangeResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 35, // 38: neo.fs.v2.object.GetRangeHashRequest.body:type_name -> neo.fs.v2.object.GetRangeHashRequest.Body - 42, // 39: neo.fs.v2.object.GetRangeHashRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 43, // 40: neo.fs.v2.object.GetRangeHashRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 36, // 41: neo.fs.v2.object.GetRangeHashResponse.body:type_name -> neo.fs.v2.object.GetRangeHashResponse.Body - 44, // 42: neo.fs.v2.object.GetRangeHashResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 45, // 43: neo.fs.v2.object.GetRangeHashResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 37, // 44: neo.fs.v2.object.PutSingleRequest.body:type_name -> neo.fs.v2.object.PutSingleRequest.Body - 42, // 45: neo.fs.v2.object.PutSingleRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 43, // 46: neo.fs.v2.object.PutSingleRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 38, // 47: neo.fs.v2.object.PutSingleResponse.body:type_name -> neo.fs.v2.object.PutSingleResponse.Body - 44, // 48: neo.fs.v2.object.PutSingleResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 45, // 49: neo.fs.v2.object.PutSingleResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 39, // 50: neo.fs.v2.object.PatchRequest.body:type_name -> neo.fs.v2.object.PatchRequest.Body - 42, // 51: neo.fs.v2.object.PatchRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 43, // 52: neo.fs.v2.object.PatchRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 41, // 53: neo.fs.v2.object.PatchResponse.body:type_name -> neo.fs.v2.object.PatchResponse.Body - 44, // 54: neo.fs.v2.object.PatchResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 45, // 55: neo.fs.v2.object.PatchResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 48, // 56: neo.fs.v2.object.GetRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 22, // 57: neo.fs.v2.object.GetResponse.Body.init:type_name -> neo.fs.v2.object.GetResponse.Body.Init - 49, // 58: neo.fs.v2.object.GetResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 50, // 59: neo.fs.v2.object.GetResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo - 51, // 60: neo.fs.v2.object.GetResponse.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID - 47, // 61: neo.fs.v2.object.GetResponse.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature - 46, // 62: neo.fs.v2.object.GetResponse.Body.Init.header:type_name -> neo.fs.v2.object.Header - 24, // 63: neo.fs.v2.object.PutRequest.Body.init:type_name -> neo.fs.v2.object.PutRequest.Body.Init - 51, // 64: neo.fs.v2.object.PutRequest.Body.Init.object_id:type_name -> neo.fs.v2.refs.ObjectID - 47, // 65: neo.fs.v2.object.PutRequest.Body.Init.signature:type_name -> neo.fs.v2.refs.Signature - 46, // 66: neo.fs.v2.object.PutRequest.Body.Init.header:type_name -> neo.fs.v2.object.Header - 51, // 67: neo.fs.v2.object.PutResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID - 48, // 68: neo.fs.v2.object.DeleteRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 48, // 69: neo.fs.v2.object.DeleteResponse.Body.tombstone:type_name -> neo.fs.v2.refs.Address - 48, // 70: neo.fs.v2.object.HeadRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 7, // 71: neo.fs.v2.object.HeadResponse.Body.header:type_name -> neo.fs.v2.object.HeaderWithSignature - 52, // 72: neo.fs.v2.object.HeadResponse.Body.short_header:type_name -> neo.fs.v2.object.ShortHeader - 49, // 73: neo.fs.v2.object.HeadResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 50, // 74: neo.fs.v2.object.HeadResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo - 53, // 75: neo.fs.v2.object.SearchRequest.Body.container_id:type_name -> neo.fs.v2.refs.ContainerID - 31, // 76: neo.fs.v2.object.SearchRequest.Body.filters:type_name -> neo.fs.v2.object.SearchRequest.Body.Filter - 54, // 77: neo.fs.v2.object.SearchRequest.Body.Filter.match_type:type_name -> neo.fs.v2.object.MatchType - 51, // 78: neo.fs.v2.object.SearchResponse.Body.id_list:type_name -> neo.fs.v2.refs.ObjectID - 48, // 79: neo.fs.v2.object.GetRangeRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 11, // 80: neo.fs.v2.object.GetRangeRequest.Body.range:type_name -> neo.fs.v2.object.Range - 49, // 81: neo.fs.v2.object.GetRangeResponse.Body.split_info:type_name -> neo.fs.v2.object.SplitInfo - 50, // 82: neo.fs.v2.object.GetRangeResponse.Body.ec_info:type_name -> neo.fs.v2.object.ECInfo - 48, // 83: neo.fs.v2.object.GetRangeHashRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 11, // 84: neo.fs.v2.object.GetRangeHashRequest.Body.ranges:type_name -> neo.fs.v2.object.Range - 55, // 85: neo.fs.v2.object.GetRangeHashRequest.Body.type:type_name -> neo.fs.v2.refs.ChecksumType - 55, // 86: neo.fs.v2.object.GetRangeHashResponse.Body.type:type_name -> neo.fs.v2.refs.ChecksumType - 56, // 87: neo.fs.v2.object.PutSingleRequest.Body.object:type_name -> neo.fs.v2.object.Object - 48, // 88: neo.fs.v2.object.PatchRequest.Body.address:type_name -> neo.fs.v2.refs.Address - 57, // 89: neo.fs.v2.object.PatchRequest.Body.new_attributes:type_name -> neo.fs.v2.object.Header.Attribute - 40, // 90: neo.fs.v2.object.PatchRequest.Body.patch:type_name -> neo.fs.v2.object.PatchRequest.Body.Patch - 11, // 91: neo.fs.v2.object.PatchRequest.Body.Patch.source_range:type_name -> neo.fs.v2.object.Range - 51, // 92: neo.fs.v2.object.PatchResponse.Body.object_id:type_name -> neo.fs.v2.refs.ObjectID - 0, // 93: neo.fs.v2.object.ObjectService.Get:input_type -> neo.fs.v2.object.GetRequest - 2, // 94: neo.fs.v2.object.ObjectService.Put:input_type -> neo.fs.v2.object.PutRequest - 4, // 95: neo.fs.v2.object.ObjectService.Delete:input_type -> neo.fs.v2.object.DeleteRequest - 6, // 96: neo.fs.v2.object.ObjectService.Head:input_type -> neo.fs.v2.object.HeadRequest - 9, // 97: neo.fs.v2.object.ObjectService.Search:input_type -> neo.fs.v2.object.SearchRequest - 12, // 98: neo.fs.v2.object.ObjectService.GetRange:input_type -> neo.fs.v2.object.GetRangeRequest - 14, // 99: neo.fs.v2.object.ObjectService.GetRangeHash:input_type -> neo.fs.v2.object.GetRangeHashRequest - 16, // 100: neo.fs.v2.object.ObjectService.PutSingle:input_type -> neo.fs.v2.object.PutSingleRequest - 18, // 101: neo.fs.v2.object.ObjectService.Patch:input_type -> neo.fs.v2.object.PatchRequest - 1, // 102: neo.fs.v2.object.ObjectService.Get:output_type -> neo.fs.v2.object.GetResponse - 3, // 103: neo.fs.v2.object.ObjectService.Put:output_type -> neo.fs.v2.object.PutResponse - 5, // 104: neo.fs.v2.object.ObjectService.Delete:output_type -> neo.fs.v2.object.DeleteResponse - 8, // 105: neo.fs.v2.object.ObjectService.Head:output_type -> neo.fs.v2.object.HeadResponse - 10, // 106: neo.fs.v2.object.ObjectService.Search:output_type -> neo.fs.v2.object.SearchResponse - 13, // 107: neo.fs.v2.object.ObjectService.GetRange:output_type -> neo.fs.v2.object.GetRangeResponse - 15, // 108: neo.fs.v2.object.ObjectService.GetRangeHash:output_type -> neo.fs.v2.object.GetRangeHashResponse - 17, // 109: neo.fs.v2.object.ObjectService.PutSingle:output_type -> neo.fs.v2.object.PutSingleResponse - 19, // 110: neo.fs.v2.object.ObjectService.Patch:output_type -> neo.fs.v2.object.PatchResponse - 102, // [102:111] is the sub-list for method output_type - 93, // [93:102] is the sub-list for method input_type - 93, // [93:93] is the sub-list for extension type_name - 93, // [93:93] is the sub-list for extension extendee - 0, // [0:93] is the sub-list for field type_name -} - -func init() { file_object_grpc_service_proto_init() } -func file_object_grpc_service_proto_init() { - if File_object_grpc_service_proto != nil { - return - } - file_object_grpc_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_object_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeaderWithSignature); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Range); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeHashRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeHashResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutSingleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutSingleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatchRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatchResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse_Body_Init); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutRequest_Body_Init); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchRequest_Body_Filter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeHashRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRangeHashResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutSingleRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutSingleResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatchRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatchRequest_Body_Patch); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_service_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatchResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_object_grpc_service_proto_msgTypes[21].OneofWrappers = []interface{}{ - (*GetResponse_Body_Init_)(nil), - (*GetResponse_Body_Chunk)(nil), - (*GetResponse_Body_SplitInfo)(nil), - (*GetResponse_Body_EcInfo)(nil), - } - file_object_grpc_service_proto_msgTypes[23].OneofWrappers = []interface{}{ - (*PutRequest_Body_Init_)(nil), - (*PutRequest_Body_Chunk)(nil), - } - file_object_grpc_service_proto_msgTypes[29].OneofWrappers = []interface{}{ - (*HeadResponse_Body_Header)(nil), - (*HeadResponse_Body_ShortHeader)(nil), - (*HeadResponse_Body_SplitInfo)(nil), - (*HeadResponse_Body_EcInfo)(nil), - } - file_object_grpc_service_proto_msgTypes[34].OneofWrappers = []interface{}{ - (*GetRangeResponse_Body_Chunk)(nil), - (*GetRangeResponse_Body_SplitInfo)(nil), - (*GetRangeResponse_Body_EcInfo)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_object_grpc_service_proto_rawDesc, - NumEnums: 0, - NumMessages: 42, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_object_grpc_service_proto_goTypes, - DependencyIndexes: file_object_grpc_service_proto_depIdxs, - MessageInfos: file_object_grpc_service_proto_msgTypes, - }.Build() - File_object_grpc_service_proto = out.File - file_object_grpc_service_proto_rawDesc = nil - file_object_grpc_service_proto_goTypes = nil - file_object_grpc_service_proto_depIdxs = nil -} diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..08b2860 --- /dev/null +++ b/object/grpc/service_frostfs.pb.go @@ -0,0 +1,8690 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package object + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type GetRequest_Body struct { + Address *grpc.Address `json:"address"` + Raw bool `json:"raw"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*GetRequest_Body)(nil) + _ json.Marshaler = (*GetRequest_Body)(nil) + _ json.Unmarshaler = (*GetRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Address) + size += proto.BoolSize(2, x.Raw) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRequest_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 *GetRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Address != nil && x.Address.StableSize() != 0 { + x.Address.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Raw { + mm.AppendBool(2, x.Raw) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRequest_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", "GetRequest_Body") + } + switch fc.FieldNum { + case 1: // Address + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Address") + } + x.Address = new(grpc.Address) + if err := x.Address.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Raw + data, ok := fc.Bool() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Raw") + } + x.Raw = data + } + } + return nil +} +func (x *GetRequest_Body) GetAddress() *grpc.Address { + if x != nil { + return x.Address + } + return nil +} +func (x *GetRequest_Body) SetAddress(v *grpc.Address) { + x.Address = v +} +func (x *GetRequest_Body) GetRaw() bool { + if x != nil { + return x.Raw + } + return false +} +func (x *GetRequest_Body) SetRaw(v bool) { + x.Raw = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"address\":" + out.RawString(prefix[1:]) + x.Address.MarshalEasyJSON(out) + } + { + const prefix string = ",\"raw\":" + out.RawString(prefix) + out.Bool(x.Raw) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRequest_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 "address": + { + var f *grpc.Address + f = new(grpc.Address) + f.UnmarshalEasyJSON(in) + x.Address = f + } + case "raw": + { + var f bool + f = in.Bool() + x.Raw = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type GetRequest struct { + Body *GetRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRequest)(nil) + _ encoding.ProtoUnmarshaler = (*GetRequest)(nil) + _ json.Marshaler = (*GetRequest)(nil) + _ json.Unmarshaler = (*GetRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRequest) 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 *GetRequest) 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 *GetRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRequest) 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 *GetRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRequest) 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", "GetRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(GetRequest_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 *GetRequest) GetBody() *GetRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *GetRequest) SetBody(v *GetRequest_Body) { + x.Body = v +} +func (x *GetRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *GetRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *GetRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *GetRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRequest) 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 *GetRequest_Body + f = new(GetRequest_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 GetResponse_Body_Init struct { + ObjectId *grpc.ObjectID `json:"objectId"` + Signature *grpc.Signature `json:"signature"` + Header *Header `json:"header"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetResponse_Body_Init)(nil) + _ encoding.ProtoUnmarshaler = (*GetResponse_Body_Init)(nil) + _ json.Marshaler = (*GetResponse_Body_Init)(nil) + _ json.Unmarshaler = (*GetResponse_Body_Init)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetResponse_Body_Init) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.ObjectId) + size += proto.NestedStructureSize(2, x.Signature) + size += proto.NestedStructureSize(3, x.Header) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetResponse_Body_Init) 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 *GetResponse_Body_Init) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + x.ObjectId.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil && x.Signature.StableSize() != 0 { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Header != nil && x.Header.StableSize() != 0 { + x.Header.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetResponse_Body_Init) 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", "GetResponse_Body_Init") + } + switch fc.FieldNum { + case 1: // ObjectId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ObjectId") + } + x.ObjectId = new(grpc.ObjectID) + if err := x.ObjectId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Signature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Signature") + } + x.Signature = new(grpc.Signature) + if err := x.Signature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // Header + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Header") + } + x.Header = new(Header) + if err := x.Header.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *GetResponse_Body_Init) GetObjectId() *grpc.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} +func (x *GetResponse_Body_Init) SetObjectId(v *grpc.ObjectID) { + x.ObjectId = v +} +func (x *GetResponse_Body_Init) GetSignature() *grpc.Signature { + if x != nil { + return x.Signature + } + return nil +} +func (x *GetResponse_Body_Init) SetSignature(v *grpc.Signature) { + x.Signature = v +} +func (x *GetResponse_Body_Init) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil +} +func (x *GetResponse_Body_Init) SetHeader(v *Header) { + x.Header = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetResponse_Body_Init) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetResponse_Body_Init) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"objectId\":" + out.RawString(prefix[1:]) + x.ObjectId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetResponse_Body_Init) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetResponse_Body_Init) 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 "objectId": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.ObjectId = f + } + case "signature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.Signature = f + } + case "header": + { + var f *Header + f = new(Header) + f.UnmarshalEasyJSON(in) + x.Header = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type GetResponse_Body struct { + ObjectPart isGetResponse_Body_ObjectPart +} + +var ( + _ encoding.ProtoMarshaler = (*GetResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*GetResponse_Body)(nil) + _ json.Marshaler = (*GetResponse_Body)(nil) + _ json.Unmarshaler = (*GetResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + if inner, ok := x.ObjectPart.(*GetResponse_Body_Init_); ok { + size += proto.NestedStructureSize(1, inner.Init) + } + if inner, ok := x.ObjectPart.(*GetResponse_Body_Chunk); ok { + size += proto.BytesSize(2, inner.Chunk) + } + if inner, ok := x.ObjectPart.(*GetResponse_Body_SplitInfo); ok { + size += proto.NestedStructureSize(3, inner.SplitInfo) + } + if inner, ok := x.ObjectPart.(*GetResponse_Body_EcInfo); ok { + size += proto.NestedStructureSize(4, inner.EcInfo) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetResponse_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 *GetResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if inner, ok := x.ObjectPart.(*GetResponse_Body_Init_); ok { + if inner.Init != nil && inner.Init.StableSize() != 0 { + inner.Init.EmitProtobuf(mm.AppendMessage(1)) + } + } + if inner, ok := x.ObjectPart.(*GetResponse_Body_Chunk); ok { + if len(inner.Chunk) != 0 { + mm.AppendBytes(2, inner.Chunk) + } + } + if inner, ok := x.ObjectPart.(*GetResponse_Body_SplitInfo); ok { + if inner.SplitInfo != nil && inner.SplitInfo.StableSize() != 0 { + inner.SplitInfo.EmitProtobuf(mm.AppendMessage(3)) + } + } + if inner, ok := x.ObjectPart.(*GetResponse_Body_EcInfo); ok { + if inner.EcInfo != nil && inner.EcInfo.StableSize() != 0 { + inner.EcInfo.EmitProtobuf(mm.AppendMessage(4)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetResponse_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", "GetResponse_Body") + } + switch fc.FieldNum { + case 1: // Init + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Init") + } + oneofField := &GetResponse_Body_Init_{Init: new(GetResponse_Body_Init)} + if err := oneofField.Init.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.ObjectPart = oneofField + case 2: // Chunk + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Chunk") + } + x.ObjectPart = &GetResponse_Body_Chunk{Chunk: data} + case 3: // SplitInfo + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SplitInfo") + } + oneofField := &GetResponse_Body_SplitInfo{SplitInfo: new(SplitInfo)} + if err := oneofField.SplitInfo.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.ObjectPart = oneofField + case 4: // EcInfo + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "EcInfo") + } + oneofField := &GetResponse_Body_EcInfo{EcInfo: new(ECInfo)} + if err := oneofField.EcInfo.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.ObjectPart = oneofField + } + } + return nil +} +func (x *GetResponse_Body) GetObjectPart() isGetResponse_Body_ObjectPart { + if x != nil { + return x.ObjectPart + } + return nil +} +func (x *GetResponse_Body) SetObjectPart(v isGetResponse_Body_ObjectPart) { + x.ObjectPart = v +} +func (x *GetResponse_Body) GetInit() *GetResponse_Body_Init { + if xx, ok := x.GetObjectPart().(*GetResponse_Body_Init_); ok { + return xx.Init + } + return nil +} +func (x *GetResponse_Body) SetInit(v *GetResponse_Body_Init) { + x.ObjectPart = &GetResponse_Body_Init_{Init: v} +} +func (x *GetResponse_Body) GetChunk() *GetResponse_Body_Chunk { + if xx, ok := x.GetObjectPart().(*GetResponse_Body_Chunk); ok { + return xx + } + return nil +} +func (x *GetResponse_Body) SetChunk(v *GetResponse_Body_Chunk) { + x.ObjectPart = v +} +func (x *GetResponse_Body_Chunk) GetChunk() []byte { + if x != nil { + return x.Chunk + } + return nil +} +func (x *GetResponse_Body_Chunk) SetChunk(v []byte) { + x.Chunk = v +} +func (x *GetResponse_Body) GetSplitInfo() *SplitInfo { + if xx, ok := x.GetObjectPart().(*GetResponse_Body_SplitInfo); ok { + return xx.SplitInfo + } + return nil +} +func (x *GetResponse_Body) SetSplitInfo(v *SplitInfo) { + x.ObjectPart = &GetResponse_Body_SplitInfo{SplitInfo: v} +} +func (x *GetResponse_Body) GetEcInfo() *ECInfo { + if xx, ok := x.GetObjectPart().(*GetResponse_Body_EcInfo); ok { + return xx.EcInfo + } + return nil +} +func (x *GetResponse_Body) SetEcInfo(v *ECInfo) { + x.ObjectPart = &GetResponse_Body_EcInfo{EcInfo: v} +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + switch xx := x.ObjectPart.(type) { + case *GetResponse_Body_Init_: + { + const prefix string = ",\"init\":" + out.RawString(prefix[1:]) + xx.Init.MarshalEasyJSON(out) + } + case *GetResponse_Body_Chunk: + { + const prefix string = ",\"chunk\":" + out.RawString(prefix[1:]) + out.Base64Bytes(xx.Chunk) + } + case *GetResponse_Body_SplitInfo: + { + const prefix string = ",\"splitInfo\":" + out.RawString(prefix[1:]) + xx.SplitInfo.MarshalEasyJSON(out) + } + case *GetResponse_Body_EcInfo: + { + const prefix string = ",\"ecInfo\":" + out.RawString(prefix[1:]) + xx.EcInfo.MarshalEasyJSON(out) + } + default: + out.RawString("null") + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetResponse_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 "init": + xx := new(GetResponse_Body_Init_) + x.ObjectPart = xx + { + var f *GetResponse_Body_Init + f = new(GetResponse_Body_Init) + f.UnmarshalEasyJSON(in) + xx.Init = f + } + case "chunk": + xx := new(GetResponse_Body_Chunk) + x.ObjectPart = xx + { + var f []byte + f = in.Bytes() + xx.Chunk = f + } + case "splitInfo": + xx := new(GetResponse_Body_SplitInfo) + x.ObjectPart = xx + { + var f *SplitInfo + f = new(SplitInfo) + f.UnmarshalEasyJSON(in) + xx.SplitInfo = f + } + case "ecInfo": + xx := new(GetResponse_Body_EcInfo) + x.ObjectPart = xx + { + var f *ECInfo + f = new(ECInfo) + f.UnmarshalEasyJSON(in) + xx.EcInfo = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type isGetResponse_Body_ObjectPart interface { + isGetResponse_Body_ObjectPart() +} + +type GetResponse_Body_Init_ struct { + Init *GetResponse_Body_Init +} + +type GetResponse_Body_Chunk struct { + Chunk []byte +} + +type GetResponse_Body_SplitInfo struct { + SplitInfo *SplitInfo +} + +type GetResponse_Body_EcInfo struct { + EcInfo *ECInfo +} + +func (*GetResponse_Body_Init_) isGetResponse_Body_ObjectPart() {} + +func (*GetResponse_Body_Chunk) isGetResponse_Body_ObjectPart() {} + +func (*GetResponse_Body_SplitInfo) isGetResponse_Body_ObjectPart() {} + +func (*GetResponse_Body_EcInfo) isGetResponse_Body_ObjectPart() {} + +type GetResponse struct { + Body *GetResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetResponse)(nil) + _ encoding.ProtoUnmarshaler = (*GetResponse)(nil) + _ json.Marshaler = (*GetResponse)(nil) + _ json.Unmarshaler = (*GetResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetResponse) 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 *GetResponse) 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 *GetResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetResponse) 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 *GetResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetResponse) 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", "GetResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(GetResponse_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 *GetResponse) GetBody() *GetResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *GetResponse) SetBody(v *GetResponse_Body) { + x.Body = v +} +func (x *GetResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *GetResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *GetResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *GetResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetResponse) 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 *GetResponse_Body + f = new(GetResponse_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() + } +} + +type PutRequest_Body_Init struct { + ObjectId *grpc.ObjectID `json:"objectId"` + Signature *grpc.Signature `json:"signature"` + Header *Header `json:"header"` + CopiesNumber []uint32 `json:"copiesNumber"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutRequest_Body_Init)(nil) + _ encoding.ProtoUnmarshaler = (*PutRequest_Body_Init)(nil) + _ json.Marshaler = (*PutRequest_Body_Init)(nil) + _ json.Unmarshaler = (*PutRequest_Body_Init)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutRequest_Body_Init) StableSize() (size int) { + if x == nil { + return 0 + } + var n int + size += proto.NestedStructureSize(1, x.ObjectId) + size += proto.NestedStructureSize(2, x.Signature) + size += proto.NestedStructureSize(3, x.Header) + n, _ = proto.RepeatedUInt32Size(4, x.CopiesNumber) + size += n + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutRequest_Body_Init) 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 *PutRequest_Body_Init) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + x.ObjectId.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil && x.Signature.StableSize() != 0 { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Header != nil && x.Header.StableSize() != 0 { + x.Header.EmitProtobuf(mm.AppendMessage(3)) + } + if len(x.CopiesNumber) != 0 { + mm.AppendUint32s(4, x.CopiesNumber) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutRequest_Body_Init) 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", "PutRequest_Body_Init") + } + switch fc.FieldNum { + case 1: // ObjectId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ObjectId") + } + x.ObjectId = new(grpc.ObjectID) + if err := x.ObjectId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Signature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Signature") + } + x.Signature = new(grpc.Signature) + if err := x.Signature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // Header + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Header") + } + x.Header = new(Header) + if err := x.Header.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 4: // CopiesNumber + data, ok := fc.UnpackUint32s(nil) + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "CopiesNumber") + } + x.CopiesNumber = data + } + } + return nil +} +func (x *PutRequest_Body_Init) GetObjectId() *grpc.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} +func (x *PutRequest_Body_Init) SetObjectId(v *grpc.ObjectID) { + x.ObjectId = v +} +func (x *PutRequest_Body_Init) GetSignature() *grpc.Signature { + if x != nil { + return x.Signature + } + return nil +} +func (x *PutRequest_Body_Init) SetSignature(v *grpc.Signature) { + x.Signature = v +} +func (x *PutRequest_Body_Init) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil +} +func (x *PutRequest_Body_Init) SetHeader(v *Header) { + x.Header = v +} +func (x *PutRequest_Body_Init) GetCopiesNumber() []uint32 { + if x != nil { + return x.CopiesNumber + } + return nil +} +func (x *PutRequest_Body_Init) SetCopiesNumber(v []uint32) { + x.CopiesNumber = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutRequest_Body_Init) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutRequest_Body_Init) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"objectId\":" + out.RawString(prefix[1:]) + x.ObjectId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) + } + { + const prefix string = ",\"copiesNumber\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.CopiesNumber { + if i != 0 { + out.RawByte(',') + } + out.Uint32(x.CopiesNumber[i]) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutRequest_Body_Init) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutRequest_Body_Init) 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 "objectId": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.ObjectId = f + } + case "signature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.Signature = f + } + case "header": + { + var f *Header + f = new(Header) + f.UnmarshalEasyJSON(in) + x.Header = f + } + case "copiesNumber": + { + var f uint32 + var list []uint32 + in.Delim('[') + for !in.IsDelim(']') { + f = in.Uint32() + list = append(list, f) + in.WantComma() + } + x.CopiesNumber = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type PutRequest_Body struct { + ObjectPart isPutRequest_Body_ObjectPart +} + +var ( + _ encoding.ProtoMarshaler = (*PutRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*PutRequest_Body)(nil) + _ json.Marshaler = (*PutRequest_Body)(nil) + _ json.Unmarshaler = (*PutRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + if inner, ok := x.ObjectPart.(*PutRequest_Body_Init_); ok { + size += proto.NestedStructureSize(1, inner.Init) + } + if inner, ok := x.ObjectPart.(*PutRequest_Body_Chunk); ok { + size += proto.BytesSize(2, inner.Chunk) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutRequest_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 *PutRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if inner, ok := x.ObjectPart.(*PutRequest_Body_Init_); ok { + if inner.Init != nil && inner.Init.StableSize() != 0 { + inner.Init.EmitProtobuf(mm.AppendMessage(1)) + } + } + if inner, ok := x.ObjectPart.(*PutRequest_Body_Chunk); ok { + if len(inner.Chunk) != 0 { + mm.AppendBytes(2, inner.Chunk) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutRequest_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", "PutRequest_Body") + } + switch fc.FieldNum { + case 1: // Init + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Init") + } + oneofField := &PutRequest_Body_Init_{Init: new(PutRequest_Body_Init)} + if err := oneofField.Init.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.ObjectPart = oneofField + case 2: // Chunk + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Chunk") + } + x.ObjectPart = &PutRequest_Body_Chunk{Chunk: data} + } + } + return nil +} +func (x *PutRequest_Body) GetObjectPart() isPutRequest_Body_ObjectPart { + if x != nil { + return x.ObjectPart + } + return nil +} +func (x *PutRequest_Body) SetObjectPart(v isPutRequest_Body_ObjectPart) { + x.ObjectPart = v +} +func (x *PutRequest_Body) GetInit() *PutRequest_Body_Init { + if xx, ok := x.GetObjectPart().(*PutRequest_Body_Init_); ok { + return xx.Init + } + return nil +} +func (x *PutRequest_Body) SetInit(v *PutRequest_Body_Init) { + x.ObjectPart = &PutRequest_Body_Init_{Init: v} +} +func (x *PutRequest_Body) GetChunk() *PutRequest_Body_Chunk { + if xx, ok := x.GetObjectPart().(*PutRequest_Body_Chunk); ok { + return xx + } + return nil +} +func (x *PutRequest_Body) SetChunk(v *PutRequest_Body_Chunk) { + x.ObjectPart = v +} +func (x *PutRequest_Body_Chunk) GetChunk() []byte { + if x != nil { + return x.Chunk + } + return nil +} +func (x *PutRequest_Body_Chunk) SetChunk(v []byte) { + x.Chunk = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + switch xx := x.ObjectPart.(type) { + case *PutRequest_Body_Init_: + { + const prefix string = ",\"init\":" + out.RawString(prefix[1:]) + xx.Init.MarshalEasyJSON(out) + } + case *PutRequest_Body_Chunk: + { + const prefix string = ",\"chunk\":" + out.RawString(prefix[1:]) + out.Base64Bytes(xx.Chunk) + } + default: + out.RawString("null") + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutRequest_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 "init": + xx := new(PutRequest_Body_Init_) + x.ObjectPart = xx + { + var f *PutRequest_Body_Init + f = new(PutRequest_Body_Init) + f.UnmarshalEasyJSON(in) + xx.Init = f + } + case "chunk": + xx := new(PutRequest_Body_Chunk) + x.ObjectPart = xx + { + var f []byte + f = in.Bytes() + xx.Chunk = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type isPutRequest_Body_ObjectPart interface { + isPutRequest_Body_ObjectPart() +} + +type PutRequest_Body_Init_ struct { + Init *PutRequest_Body_Init +} + +type PutRequest_Body_Chunk struct { + Chunk []byte +} + +func (*PutRequest_Body_Init_) isPutRequest_Body_ObjectPart() {} + +func (*PutRequest_Body_Chunk) isPutRequest_Body_ObjectPart() {} + +type PutRequest struct { + Body *PutRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutRequest)(nil) + _ encoding.ProtoUnmarshaler = (*PutRequest)(nil) + _ json.Marshaler = (*PutRequest)(nil) + _ json.Unmarshaler = (*PutRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutRequest) 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 *PutRequest) 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 *PutRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutRequest) 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 *PutRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutRequest) 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", "PutRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(PutRequest_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 *PutRequest) GetBody() *PutRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *PutRequest) SetBody(v *PutRequest_Body) { + x.Body = v +} +func (x *PutRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *PutRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *PutRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *PutRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutRequest) 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 *PutRequest_Body + f = new(PutRequest_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 PutResponse_Body struct { + ObjectId *grpc.ObjectID `json:"objectId"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*PutResponse_Body)(nil) + _ json.Marshaler = (*PutResponse_Body)(nil) + _ json.Unmarshaler = (*PutResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.ObjectId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutResponse_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 *PutResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + x.ObjectId.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutResponse_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", "PutResponse_Body") + } + switch fc.FieldNum { + case 1: // ObjectId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ObjectId") + } + x.ObjectId = new(grpc.ObjectID) + if err := x.ObjectId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *PutResponse_Body) GetObjectId() *grpc.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} +func (x *PutResponse_Body) SetObjectId(v *grpc.ObjectID) { + x.ObjectId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"objectId\":" + out.RawString(prefix[1:]) + x.ObjectId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutResponse_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 "objectId": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.ObjectId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type PutResponse struct { + Body *PutResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutResponse)(nil) + _ encoding.ProtoUnmarshaler = (*PutResponse)(nil) + _ json.Marshaler = (*PutResponse)(nil) + _ json.Unmarshaler = (*PutResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutResponse) 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 *PutResponse) 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 *PutResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutResponse) 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 *PutResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutResponse) 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", "PutResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(PutResponse_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 *PutResponse) GetBody() *PutResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *PutResponse) SetBody(v *PutResponse_Body) { + x.Body = v +} +func (x *PutResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *PutResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *PutResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *PutResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutResponse) 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 *PutResponse_Body + f = new(PutResponse_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() + } +} + +type DeleteRequest_Body struct { + Address *grpc.Address `json:"address"` +} + +var ( + _ encoding.ProtoMarshaler = (*DeleteRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*DeleteRequest_Body)(nil) + _ json.Marshaler = (*DeleteRequest_Body)(nil) + _ json.Unmarshaler = (*DeleteRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *DeleteRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Address) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *DeleteRequest_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 *DeleteRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Address != nil && x.Address.StableSize() != 0 { + x.Address.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *DeleteRequest_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", "DeleteRequest_Body") + } + switch fc.FieldNum { + case 1: // Address + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Address") + } + x.Address = new(grpc.Address) + if err := x.Address.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *DeleteRequest_Body) GetAddress() *grpc.Address { + if x != nil { + return x.Address + } + return nil +} +func (x *DeleteRequest_Body) SetAddress(v *grpc.Address) { + x.Address = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *DeleteRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *DeleteRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"address\":" + out.RawString(prefix[1:]) + x.Address.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *DeleteRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *DeleteRequest_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 "address": + { + var f *grpc.Address + f = new(grpc.Address) + f.UnmarshalEasyJSON(in) + x.Address = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type DeleteRequest struct { + Body *DeleteRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*DeleteRequest)(nil) + _ encoding.ProtoUnmarshaler = (*DeleteRequest)(nil) + _ json.Marshaler = (*DeleteRequest)(nil) + _ json.Unmarshaler = (*DeleteRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *DeleteRequest) 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 *DeleteRequest) 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 *DeleteRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *DeleteRequest) 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 *DeleteRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *DeleteRequest) 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", "DeleteRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(DeleteRequest_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 *DeleteRequest) GetBody() *DeleteRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *DeleteRequest) SetBody(v *DeleteRequest_Body) { + x.Body = v +} +func (x *DeleteRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *DeleteRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *DeleteRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *DeleteRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *DeleteRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *DeleteRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *DeleteRequest) 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 *DeleteRequest_Body + f = new(DeleteRequest_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 DeleteResponse_Body struct { + Tombstone *grpc.Address `json:"tombstone"` +} + +var ( + _ encoding.ProtoMarshaler = (*DeleteResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*DeleteResponse_Body)(nil) + _ json.Marshaler = (*DeleteResponse_Body)(nil) + _ json.Unmarshaler = (*DeleteResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *DeleteResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Tombstone) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *DeleteResponse_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 *DeleteResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Tombstone != nil && x.Tombstone.StableSize() != 0 { + x.Tombstone.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *DeleteResponse_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", "DeleteResponse_Body") + } + switch fc.FieldNum { + case 1: // Tombstone + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Tombstone") + } + x.Tombstone = new(grpc.Address) + if err := x.Tombstone.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *DeleteResponse_Body) GetTombstone() *grpc.Address { + if x != nil { + return x.Tombstone + } + return nil +} +func (x *DeleteResponse_Body) SetTombstone(v *grpc.Address) { + x.Tombstone = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *DeleteResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *DeleteResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"tombstone\":" + out.RawString(prefix[1:]) + x.Tombstone.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *DeleteResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *DeleteResponse_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 "tombstone": + { + var f *grpc.Address + f = new(grpc.Address) + f.UnmarshalEasyJSON(in) + x.Tombstone = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type DeleteResponse struct { + Body *DeleteResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*DeleteResponse)(nil) + _ encoding.ProtoUnmarshaler = (*DeleteResponse)(nil) + _ json.Marshaler = (*DeleteResponse)(nil) + _ json.Unmarshaler = (*DeleteResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *DeleteResponse) 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 *DeleteResponse) 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 *DeleteResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *DeleteResponse) 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 *DeleteResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *DeleteResponse) 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", "DeleteResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(DeleteResponse_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 *DeleteResponse) GetBody() *DeleteResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *DeleteResponse) SetBody(v *DeleteResponse_Body) { + x.Body = v +} +func (x *DeleteResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *DeleteResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *DeleteResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *DeleteResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *DeleteResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *DeleteResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *DeleteResponse) 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 *DeleteResponse_Body + f = new(DeleteResponse_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() + } +} + +type HeadRequest_Body struct { + Address *grpc.Address `json:"address"` + MainOnly bool `json:"mainOnly"` + Raw bool `json:"raw"` +} + +var ( + _ encoding.ProtoMarshaler = (*HeadRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*HeadRequest_Body)(nil) + _ json.Marshaler = (*HeadRequest_Body)(nil) + _ json.Unmarshaler = (*HeadRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *HeadRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Address) + size += proto.BoolSize(2, x.MainOnly) + size += proto.BoolSize(3, x.Raw) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *HeadRequest_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 *HeadRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Address != nil && x.Address.StableSize() != 0 { + x.Address.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MainOnly { + mm.AppendBool(2, x.MainOnly) + } + if x.Raw { + mm.AppendBool(3, x.Raw) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *HeadRequest_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", "HeadRequest_Body") + } + switch fc.FieldNum { + case 1: // Address + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Address") + } + x.Address = new(grpc.Address) + if err := x.Address.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MainOnly + data, ok := fc.Bool() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MainOnly") + } + x.MainOnly = data + case 3: // Raw + data, ok := fc.Bool() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Raw") + } + x.Raw = data + } + } + return nil +} +func (x *HeadRequest_Body) GetAddress() *grpc.Address { + if x != nil { + return x.Address + } + return nil +} +func (x *HeadRequest_Body) SetAddress(v *grpc.Address) { + x.Address = v +} +func (x *HeadRequest_Body) GetMainOnly() bool { + if x != nil { + return x.MainOnly + } + return false +} +func (x *HeadRequest_Body) SetMainOnly(v bool) { + x.MainOnly = v +} +func (x *HeadRequest_Body) GetRaw() bool { + if x != nil { + return x.Raw + } + return false +} +func (x *HeadRequest_Body) SetRaw(v bool) { + x.Raw = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *HeadRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *HeadRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"address\":" + out.RawString(prefix[1:]) + x.Address.MarshalEasyJSON(out) + } + { + const prefix string = ",\"mainOnly\":" + out.RawString(prefix) + out.Bool(x.MainOnly) + } + { + const prefix string = ",\"raw\":" + out.RawString(prefix) + out.Bool(x.Raw) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *HeadRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *HeadRequest_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 "address": + { + var f *grpc.Address + f = new(grpc.Address) + f.UnmarshalEasyJSON(in) + x.Address = f + } + case "mainOnly": + { + var f bool + f = in.Bool() + x.MainOnly = f + } + case "raw": + { + var f bool + f = in.Bool() + x.Raw = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type HeadRequest struct { + Body *HeadRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*HeadRequest)(nil) + _ encoding.ProtoUnmarshaler = (*HeadRequest)(nil) + _ json.Marshaler = (*HeadRequest)(nil) + _ json.Unmarshaler = (*HeadRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *HeadRequest) 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 *HeadRequest) 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 *HeadRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *HeadRequest) 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 *HeadRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *HeadRequest) 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", "HeadRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(HeadRequest_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 *HeadRequest) GetBody() *HeadRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *HeadRequest) SetBody(v *HeadRequest_Body) { + x.Body = v +} +func (x *HeadRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *HeadRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *HeadRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *HeadRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *HeadRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *HeadRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *HeadRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *HeadRequest) 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 *HeadRequest_Body + f = new(HeadRequest_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 HeaderWithSignature struct { + Header *Header `json:"header"` + Signature *grpc.Signature `json:"signature"` +} + +var ( + _ encoding.ProtoMarshaler = (*HeaderWithSignature)(nil) + _ encoding.ProtoUnmarshaler = (*HeaderWithSignature)(nil) + _ json.Marshaler = (*HeaderWithSignature)(nil) + _ json.Unmarshaler = (*HeaderWithSignature)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *HeaderWithSignature) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Header) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *HeaderWithSignature) 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 *HeaderWithSignature) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Header != nil && x.Header.StableSize() != 0 { + x.Header.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil && x.Signature.StableSize() != 0 { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *HeaderWithSignature) 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", "HeaderWithSignature") + } + switch fc.FieldNum { + case 1: // Header + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Header") + } + x.Header = new(Header) + if err := x.Header.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Signature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Signature") + } + x.Signature = new(grpc.Signature) + if err := x.Signature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *HeaderWithSignature) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil +} +func (x *HeaderWithSignature) SetHeader(v *Header) { + x.Header = v +} +func (x *HeaderWithSignature) GetSignature() *grpc.Signature { + if x != nil { + return x.Signature + } + return nil +} +func (x *HeaderWithSignature) SetSignature(v *grpc.Signature) { + x.Signature = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *HeaderWithSignature) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *HeaderWithSignature) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"header\":" + out.RawString(prefix[1:]) + x.Header.MarshalEasyJSON(out) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *HeaderWithSignature) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *HeaderWithSignature) 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 "header": + { + var f *Header + f = new(Header) + f.UnmarshalEasyJSON(in) + x.Header = f + } + case "signature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.Signature = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type HeadResponse_Body struct { + Head isHeadResponse_Body_Head +} + +var ( + _ encoding.ProtoMarshaler = (*HeadResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*HeadResponse_Body)(nil) + _ json.Marshaler = (*HeadResponse_Body)(nil) + _ json.Unmarshaler = (*HeadResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *HeadResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + if inner, ok := x.Head.(*HeadResponse_Body_Header); ok { + size += proto.NestedStructureSize(1, inner.Header) + } + if inner, ok := x.Head.(*HeadResponse_Body_ShortHeader); ok { + size += proto.NestedStructureSize(2, inner.ShortHeader) + } + if inner, ok := x.Head.(*HeadResponse_Body_SplitInfo); ok { + size += proto.NestedStructureSize(3, inner.SplitInfo) + } + if inner, ok := x.Head.(*HeadResponse_Body_EcInfo); ok { + size += proto.NestedStructureSize(4, inner.EcInfo) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *HeadResponse_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 *HeadResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if inner, ok := x.Head.(*HeadResponse_Body_Header); ok { + if inner.Header != nil && inner.Header.StableSize() != 0 { + inner.Header.EmitProtobuf(mm.AppendMessage(1)) + } + } + if inner, ok := x.Head.(*HeadResponse_Body_ShortHeader); ok { + if inner.ShortHeader != nil && inner.ShortHeader.StableSize() != 0 { + inner.ShortHeader.EmitProtobuf(mm.AppendMessage(2)) + } + } + if inner, ok := x.Head.(*HeadResponse_Body_SplitInfo); ok { + if inner.SplitInfo != nil && inner.SplitInfo.StableSize() != 0 { + inner.SplitInfo.EmitProtobuf(mm.AppendMessage(3)) + } + } + if inner, ok := x.Head.(*HeadResponse_Body_EcInfo); ok { + if inner.EcInfo != nil && inner.EcInfo.StableSize() != 0 { + inner.EcInfo.EmitProtobuf(mm.AppendMessage(4)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *HeadResponse_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", "HeadResponse_Body") + } + switch fc.FieldNum { + case 1: // Header + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Header") + } + oneofField := &HeadResponse_Body_Header{Header: new(HeaderWithSignature)} + if err := oneofField.Header.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.Head = oneofField + case 2: // ShortHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ShortHeader") + } + oneofField := &HeadResponse_Body_ShortHeader{ShortHeader: new(ShortHeader)} + if err := oneofField.ShortHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.Head = oneofField + case 3: // SplitInfo + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SplitInfo") + } + oneofField := &HeadResponse_Body_SplitInfo{SplitInfo: new(SplitInfo)} + if err := oneofField.SplitInfo.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.Head = oneofField + case 4: // EcInfo + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "EcInfo") + } + oneofField := &HeadResponse_Body_EcInfo{EcInfo: new(ECInfo)} + if err := oneofField.EcInfo.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.Head = oneofField + } + } + return nil +} +func (x *HeadResponse_Body) GetHead() isHeadResponse_Body_Head { + if x != nil { + return x.Head + } + return nil +} +func (x *HeadResponse_Body) SetHead(v isHeadResponse_Body_Head) { + x.Head = v +} +func (x *HeadResponse_Body) GetHeader() *HeaderWithSignature { + if xx, ok := x.GetHead().(*HeadResponse_Body_Header); ok { + return xx.Header + } + return nil +} +func (x *HeadResponse_Body) SetHeader(v *HeaderWithSignature) { + x.Head = &HeadResponse_Body_Header{Header: v} +} +func (x *HeadResponse_Body) GetShortHeader() *ShortHeader { + if xx, ok := x.GetHead().(*HeadResponse_Body_ShortHeader); ok { + return xx.ShortHeader + } + return nil +} +func (x *HeadResponse_Body) SetShortHeader(v *ShortHeader) { + x.Head = &HeadResponse_Body_ShortHeader{ShortHeader: v} +} +func (x *HeadResponse_Body) GetSplitInfo() *SplitInfo { + if xx, ok := x.GetHead().(*HeadResponse_Body_SplitInfo); ok { + return xx.SplitInfo + } + return nil +} +func (x *HeadResponse_Body) SetSplitInfo(v *SplitInfo) { + x.Head = &HeadResponse_Body_SplitInfo{SplitInfo: v} +} +func (x *HeadResponse_Body) GetEcInfo() *ECInfo { + if xx, ok := x.GetHead().(*HeadResponse_Body_EcInfo); ok { + return xx.EcInfo + } + return nil +} +func (x *HeadResponse_Body) SetEcInfo(v *ECInfo) { + x.Head = &HeadResponse_Body_EcInfo{EcInfo: v} +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *HeadResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *HeadResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + switch xx := x.Head.(type) { + case *HeadResponse_Body_Header: + { + const prefix string = ",\"header\":" + out.RawString(prefix[1:]) + xx.Header.MarshalEasyJSON(out) + } + case *HeadResponse_Body_ShortHeader: + { + const prefix string = ",\"shortHeader\":" + out.RawString(prefix[1:]) + xx.ShortHeader.MarshalEasyJSON(out) + } + case *HeadResponse_Body_SplitInfo: + { + const prefix string = ",\"splitInfo\":" + out.RawString(prefix[1:]) + xx.SplitInfo.MarshalEasyJSON(out) + } + case *HeadResponse_Body_EcInfo: + { + const prefix string = ",\"ecInfo\":" + out.RawString(prefix[1:]) + xx.EcInfo.MarshalEasyJSON(out) + } + default: + out.RawString("null") + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *HeadResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *HeadResponse_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 "header": + xx := new(HeadResponse_Body_Header) + x.Head = xx + { + var f *HeaderWithSignature + f = new(HeaderWithSignature) + f.UnmarshalEasyJSON(in) + xx.Header = f + } + case "shortHeader": + xx := new(HeadResponse_Body_ShortHeader) + x.Head = xx + { + var f *ShortHeader + f = new(ShortHeader) + f.UnmarshalEasyJSON(in) + xx.ShortHeader = f + } + case "splitInfo": + xx := new(HeadResponse_Body_SplitInfo) + x.Head = xx + { + var f *SplitInfo + f = new(SplitInfo) + f.UnmarshalEasyJSON(in) + xx.SplitInfo = f + } + case "ecInfo": + xx := new(HeadResponse_Body_EcInfo) + x.Head = xx + { + var f *ECInfo + f = new(ECInfo) + f.UnmarshalEasyJSON(in) + xx.EcInfo = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type isHeadResponse_Body_Head interface { + isHeadResponse_Body_Head() +} + +type HeadResponse_Body_Header struct { + Header *HeaderWithSignature +} + +type HeadResponse_Body_ShortHeader struct { + ShortHeader *ShortHeader +} + +type HeadResponse_Body_SplitInfo struct { + SplitInfo *SplitInfo +} + +type HeadResponse_Body_EcInfo struct { + EcInfo *ECInfo +} + +func (*HeadResponse_Body_Header) isHeadResponse_Body_Head() {} + +func (*HeadResponse_Body_ShortHeader) isHeadResponse_Body_Head() {} + +func (*HeadResponse_Body_SplitInfo) isHeadResponse_Body_Head() {} + +func (*HeadResponse_Body_EcInfo) isHeadResponse_Body_Head() {} + +type HeadResponse struct { + Body *HeadResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*HeadResponse)(nil) + _ encoding.ProtoUnmarshaler = (*HeadResponse)(nil) + _ json.Marshaler = (*HeadResponse)(nil) + _ json.Unmarshaler = (*HeadResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *HeadResponse) 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 *HeadResponse) 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 *HeadResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *HeadResponse) 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 *HeadResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *HeadResponse) 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", "HeadResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(HeadResponse_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 *HeadResponse) GetBody() *HeadResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *HeadResponse) SetBody(v *HeadResponse_Body) { + x.Body = v +} +func (x *HeadResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *HeadResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *HeadResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *HeadResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *HeadResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *HeadResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *HeadResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *HeadResponse) 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 *HeadResponse_Body + f = new(HeadResponse_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() + } +} + +type SearchRequest_Body_Filter struct { + MatchType MatchType `json:"matchType"` + Key string `json:"key"` + Value string `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*SearchRequest_Body_Filter)(nil) + _ encoding.ProtoUnmarshaler = (*SearchRequest_Body_Filter)(nil) + _ json.Marshaler = (*SearchRequest_Body_Filter)(nil) + _ json.Unmarshaler = (*SearchRequest_Body_Filter)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *SearchRequest_Body_Filter) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.MatchType)) + size += proto.StringSize(2, x.Key) + size += proto.StringSize(3, x.Value) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *SearchRequest_Body_Filter) 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 *SearchRequest_Body_Filter) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.MatchType) != 0 { + mm.AppendInt32(1, int32(x.MatchType)) + } + if len(x.Key) != 0 { + mm.AppendString(2, x.Key) + } + if len(x.Value) != 0 { + mm.AppendString(3, x.Value) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *SearchRequest_Body_Filter) 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", "SearchRequest_Body_Filter") + } + switch fc.FieldNum { + case 1: // MatchType + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MatchType") + } + x.MatchType = MatchType(data) + case 2: // Key + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Key") + } + x.Key = data + case 3: // Value + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + } + } + return nil +} +func (x *SearchRequest_Body_Filter) GetMatchType() MatchType { + if x != nil { + return x.MatchType + } + return 0 +} +func (x *SearchRequest_Body_Filter) SetMatchType(v MatchType) { + x.MatchType = v +} +func (x *SearchRequest_Body_Filter) GetKey() string { + if x != nil { + return x.Key + } + return "" +} +func (x *SearchRequest_Body_Filter) SetKey(v string) { + x.Key = v +} +func (x *SearchRequest_Body_Filter) GetValue() string { + if x != nil { + return x.Value + } + return "" +} +func (x *SearchRequest_Body_Filter) SetValue(v string) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *SearchRequest_Body_Filter) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *SearchRequest_Body_Filter) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"matchType\":" + out.RawString(prefix[1:]) + out.Int32(int32(x.MatchType)) + } + { + const prefix string = ",\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + { + const prefix string = ",\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *SearchRequest_Body_Filter) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *SearchRequest_Body_Filter) 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 "matchType": + { + var f MatchType + var parsedValue MatchType + switch v := in.Interface().(type) { + case string: + if vv, ok := MatchType_value[v]; ok { + parsedValue = MatchType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = MatchType(vv) + case float64: + parsedValue = MatchType(v) + } + f = parsedValue + x.MatchType = f + } + 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 SearchRequest_Body struct { + ContainerId *grpc.ContainerID `json:"containerId"` + Version uint32 `json:"version"` + Filters []*SearchRequest_Body_Filter `json:"filters"` +} + +var ( + _ encoding.ProtoMarshaler = (*SearchRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*SearchRequest_Body)(nil) + _ json.Marshaler = (*SearchRequest_Body)(nil) + _ json.Unmarshaler = (*SearchRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *SearchRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.ContainerId) + size += proto.UInt32Size(2, x.Version) + for i := range x.Filters { + size += proto.NestedStructureSize(3, x.Filters[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *SearchRequest_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 *SearchRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Version != 0 { + mm.AppendUint32(2, x.Version) + } + for i := range x.Filters { + if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 { + x.Filters[i].EmitProtobuf(mm.AppendMessage(3)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *SearchRequest_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", "SearchRequest_Body") + } + switch fc.FieldNum { + case 1: // ContainerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerId") + } + x.ContainerId = new(grpc.ContainerID) + if err := x.ContainerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Version + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Version") + } + x.Version = data + case 3: // Filters + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Filters") + } + x.Filters = append(x.Filters, new(SearchRequest_Body_Filter)) + ff := x.Filters[len(x.Filters)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *SearchRequest_Body) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} +func (x *SearchRequest_Body) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} +func (x *SearchRequest_Body) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} +func (x *SearchRequest_Body) SetVersion(v uint32) { + x.Version = v +} +func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { + if x != nil { + return x.Filters + } + return nil +} +func (x *SearchRequest_Body) SetFilters(v []*SearchRequest_Body_Filter) { + x.Filters = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *SearchRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *SearchRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"containerId\":" + out.RawString(prefix[1:]) + x.ContainerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"version\":" + out.RawString(prefix) + out.Uint32(x.Version) + } + { + const prefix string = ",\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *SearchRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *SearchRequest_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 "containerId": + { + var f *grpc.ContainerID + f = new(grpc.ContainerID) + f.UnmarshalEasyJSON(in) + x.ContainerId = f + } + case "version": + { + var f uint32 + f = in.Uint32() + x.Version = f + } + case "filters": + { + var f *SearchRequest_Body_Filter + var list []*SearchRequest_Body_Filter + in.Delim('[') + for !in.IsDelim(']') { + f = new(SearchRequest_Body_Filter) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Filters = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type SearchRequest struct { + Body *SearchRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*SearchRequest)(nil) + _ encoding.ProtoUnmarshaler = (*SearchRequest)(nil) + _ json.Marshaler = (*SearchRequest)(nil) + _ json.Unmarshaler = (*SearchRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *SearchRequest) 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 *SearchRequest) 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 *SearchRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *SearchRequest) 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 *SearchRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *SearchRequest) 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", "SearchRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(SearchRequest_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 *SearchRequest) GetBody() *SearchRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *SearchRequest) SetBody(v *SearchRequest_Body) { + x.Body = v +} +func (x *SearchRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *SearchRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *SearchRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *SearchRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *SearchRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *SearchRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *SearchRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *SearchRequest) 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 *SearchRequest_Body + f = new(SearchRequest_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 SearchResponse_Body struct { + IdList []*grpc.ObjectID `json:"idList"` +} + +var ( + _ encoding.ProtoMarshaler = (*SearchResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*SearchResponse_Body)(nil) + _ json.Marshaler = (*SearchResponse_Body)(nil) + _ json.Unmarshaler = (*SearchResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *SearchResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.IdList { + size += proto.NestedStructureSize(1, x.IdList[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *SearchResponse_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 *SearchResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + for i := range x.IdList { + if x.IdList[i] != nil && x.IdList[i].StableSize() != 0 { + x.IdList[i].EmitProtobuf(mm.AppendMessage(1)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *SearchResponse_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", "SearchResponse_Body") + } + switch fc.FieldNum { + case 1: // IdList + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "IdList") + } + x.IdList = append(x.IdList, new(grpc.ObjectID)) + ff := x.IdList[len(x.IdList)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *SearchResponse_Body) GetIdList() []*grpc.ObjectID { + if x != nil { + return x.IdList + } + return nil +} +func (x *SearchResponse_Body) SetIdList(v []*grpc.ObjectID) { + x.IdList = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *SearchResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *SearchResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"idList\":" + out.RawString(prefix[1:]) + out.RawByte('[') + for i := range x.IdList { + if i != 0 { + out.RawByte(',') + } + x.IdList[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *SearchResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *SearchResponse_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 "idList": + { + var f *grpc.ObjectID + var list []*grpc.ObjectID + in.Delim('[') + for !in.IsDelim(']') { + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.IdList = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type SearchResponse struct { + Body *SearchResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*SearchResponse)(nil) + _ encoding.ProtoUnmarshaler = (*SearchResponse)(nil) + _ json.Marshaler = (*SearchResponse)(nil) + _ json.Unmarshaler = (*SearchResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *SearchResponse) 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 *SearchResponse) 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 *SearchResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *SearchResponse) 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 *SearchResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *SearchResponse) 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", "SearchResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(SearchResponse_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 *SearchResponse) GetBody() *SearchResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *SearchResponse) SetBody(v *SearchResponse_Body) { + x.Body = v +} +func (x *SearchResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *SearchResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *SearchResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *SearchResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *SearchResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *SearchResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *SearchResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *SearchResponse) 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 *SearchResponse_Body + f = new(SearchResponse_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() + } +} + +type Range struct { + Offset uint64 `json:"offset"` + Length uint64 `json:"length"` +} + +var ( + _ encoding.ProtoMarshaler = (*Range)(nil) + _ encoding.ProtoUnmarshaler = (*Range)(nil) + _ json.Marshaler = (*Range)(nil) + _ json.Unmarshaler = (*Range)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Range) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt64Size(1, x.Offset) + size += proto.UInt64Size(2, x.Length) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Range) 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 *Range) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Offset != 0 { + mm.AppendUint64(1, x.Offset) + } + if x.Length != 0 { + mm.AppendUint64(2, x.Length) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Range) 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", "Range") + } + switch fc.FieldNum { + case 1: // Offset + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Offset") + } + x.Offset = data + case 2: // Length + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Length") + } + x.Length = data + } + } + return nil +} +func (x *Range) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} +func (x *Range) SetOffset(v uint64) { + x.Offset = v +} +func (x *Range) GetLength() uint64 { + if x != nil { + return x.Length + } + return 0 +} +func (x *Range) SetLength(v uint64) { + x.Length = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Range) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Range) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"offset\":" + out.RawString(prefix[1:]) + out.Uint64(x.Offset) + } + { + const prefix string = ",\"length\":" + out.RawString(prefix) + out.Uint64(x.Length) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Range) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Range) 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 "offset": + { + var f uint64 + f = in.Uint64() + x.Offset = f + } + case "length": + { + var f uint64 + f = in.Uint64() + x.Length = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type GetRangeRequest_Body struct { + Address *grpc.Address `json:"address"` + Range *Range `json:"range"` + Raw bool `json:"raw"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRangeRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*GetRangeRequest_Body)(nil) + _ json.Marshaler = (*GetRangeRequest_Body)(nil) + _ json.Unmarshaler = (*GetRangeRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRangeRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Address) + size += proto.NestedStructureSize(2, x.Range) + size += proto.BoolSize(3, x.Raw) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRangeRequest_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 *GetRangeRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Address != nil && x.Address.StableSize() != 0 { + x.Address.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Range != nil && x.Range.StableSize() != 0 { + x.Range.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Raw { + mm.AppendBool(3, x.Raw) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRangeRequest_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", "GetRangeRequest_Body") + } + switch fc.FieldNum { + case 1: // Address + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Address") + } + x.Address = new(grpc.Address) + if err := x.Address.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Range + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Range") + } + x.Range = new(Range) + if err := x.Range.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // Raw + data, ok := fc.Bool() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Raw") + } + x.Raw = data + } + } + return nil +} +func (x *GetRangeRequest_Body) GetAddress() *grpc.Address { + if x != nil { + return x.Address + } + return nil +} +func (x *GetRangeRequest_Body) SetAddress(v *grpc.Address) { + x.Address = v +} +func (x *GetRangeRequest_Body) GetRange() *Range { + if x != nil { + return x.Range + } + return nil +} +func (x *GetRangeRequest_Body) SetRange(v *Range) { + x.Range = v +} +func (x *GetRangeRequest_Body) GetRaw() bool { + if x != nil { + return x.Raw + } + return false +} +func (x *GetRangeRequest_Body) SetRaw(v bool) { + x.Raw = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRangeRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRangeRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"address\":" + out.RawString(prefix[1:]) + x.Address.MarshalEasyJSON(out) + } + { + const prefix string = ",\"range\":" + out.RawString(prefix) + x.Range.MarshalEasyJSON(out) + } + { + const prefix string = ",\"raw\":" + out.RawString(prefix) + out.Bool(x.Raw) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRangeRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRangeRequest_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 "address": + { + var f *grpc.Address + f = new(grpc.Address) + f.UnmarshalEasyJSON(in) + x.Address = f + } + case "range": + { + var f *Range + f = new(Range) + f.UnmarshalEasyJSON(in) + x.Range = f + } + case "raw": + { + var f bool + f = in.Bool() + x.Raw = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type GetRangeRequest struct { + Body *GetRangeRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRangeRequest)(nil) + _ encoding.ProtoUnmarshaler = (*GetRangeRequest)(nil) + _ json.Marshaler = (*GetRangeRequest)(nil) + _ json.Unmarshaler = (*GetRangeRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRangeRequest) 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 *GetRangeRequest) 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 *GetRangeRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRangeRequest) 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 *GetRangeRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRangeRequest) 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", "GetRangeRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(GetRangeRequest_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 *GetRangeRequest) GetBody() *GetRangeRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *GetRangeRequest) SetBody(v *GetRangeRequest_Body) { + x.Body = v +} +func (x *GetRangeRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *GetRangeRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *GetRangeRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *GetRangeRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRangeRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRangeRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRangeRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRangeRequest) 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 *GetRangeRequest_Body + f = new(GetRangeRequest_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 GetRangeResponse_Body struct { + RangePart isGetRangeResponse_Body_RangePart +} + +var ( + _ encoding.ProtoMarshaler = (*GetRangeResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*GetRangeResponse_Body)(nil) + _ json.Marshaler = (*GetRangeResponse_Body)(nil) + _ json.Unmarshaler = (*GetRangeResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRangeResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + if inner, ok := x.RangePart.(*GetRangeResponse_Body_Chunk); ok { + size += proto.BytesSize(1, inner.Chunk) + } + if inner, ok := x.RangePart.(*GetRangeResponse_Body_SplitInfo); ok { + size += proto.NestedStructureSize(2, inner.SplitInfo) + } + if inner, ok := x.RangePart.(*GetRangeResponse_Body_EcInfo); ok { + size += proto.NestedStructureSize(3, inner.EcInfo) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRangeResponse_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 *GetRangeResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if inner, ok := x.RangePart.(*GetRangeResponse_Body_Chunk); ok { + if len(inner.Chunk) != 0 { + mm.AppendBytes(1, inner.Chunk) + } + } + if inner, ok := x.RangePart.(*GetRangeResponse_Body_SplitInfo); ok { + if inner.SplitInfo != nil && inner.SplitInfo.StableSize() != 0 { + inner.SplitInfo.EmitProtobuf(mm.AppendMessage(2)) + } + } + if inner, ok := x.RangePart.(*GetRangeResponse_Body_EcInfo); ok { + if inner.EcInfo != nil && inner.EcInfo.StableSize() != 0 { + inner.EcInfo.EmitProtobuf(mm.AppendMessage(3)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRangeResponse_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", "GetRangeResponse_Body") + } + switch fc.FieldNum { + case 1: // Chunk + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Chunk") + } + x.RangePart = &GetRangeResponse_Body_Chunk{Chunk: data} + case 2: // SplitInfo + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SplitInfo") + } + oneofField := &GetRangeResponse_Body_SplitInfo{SplitInfo: new(SplitInfo)} + if err := oneofField.SplitInfo.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.RangePart = oneofField + case 3: // EcInfo + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "EcInfo") + } + oneofField := &GetRangeResponse_Body_EcInfo{EcInfo: new(ECInfo)} + if err := oneofField.EcInfo.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.RangePart = oneofField + } + } + return nil +} +func (x *GetRangeResponse_Body) GetRangePart() isGetRangeResponse_Body_RangePart { + if x != nil { + return x.RangePart + } + return nil +} +func (x *GetRangeResponse_Body) SetRangePart(v isGetRangeResponse_Body_RangePart) { + x.RangePart = v +} +func (x *GetRangeResponse_Body) GetChunk() *GetRangeResponse_Body_Chunk { + if xx, ok := x.GetRangePart().(*GetRangeResponse_Body_Chunk); ok { + return xx + } + return nil +} +func (x *GetRangeResponse_Body) SetChunk(v *GetRangeResponse_Body_Chunk) { + x.RangePart = v +} +func (x *GetRangeResponse_Body_Chunk) GetChunk() []byte { + if x != nil { + return x.Chunk + } + return nil +} +func (x *GetRangeResponse_Body_Chunk) SetChunk(v []byte) { + x.Chunk = v +} +func (x *GetRangeResponse_Body) GetSplitInfo() *SplitInfo { + if xx, ok := x.GetRangePart().(*GetRangeResponse_Body_SplitInfo); ok { + return xx.SplitInfo + } + return nil +} +func (x *GetRangeResponse_Body) SetSplitInfo(v *SplitInfo) { + x.RangePart = &GetRangeResponse_Body_SplitInfo{SplitInfo: v} +} +func (x *GetRangeResponse_Body) GetEcInfo() *ECInfo { + if xx, ok := x.GetRangePart().(*GetRangeResponse_Body_EcInfo); ok { + return xx.EcInfo + } + return nil +} +func (x *GetRangeResponse_Body) SetEcInfo(v *ECInfo) { + x.RangePart = &GetRangeResponse_Body_EcInfo{EcInfo: v} +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRangeResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRangeResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + switch xx := x.RangePart.(type) { + case *GetRangeResponse_Body_Chunk: + { + const prefix string = ",\"chunk\":" + out.RawString(prefix[1:]) + out.Base64Bytes(xx.Chunk) + } + case *GetRangeResponse_Body_SplitInfo: + { + const prefix string = ",\"splitInfo\":" + out.RawString(prefix[1:]) + xx.SplitInfo.MarshalEasyJSON(out) + } + case *GetRangeResponse_Body_EcInfo: + { + const prefix string = ",\"ecInfo\":" + out.RawString(prefix[1:]) + xx.EcInfo.MarshalEasyJSON(out) + } + default: + out.RawString("null") + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRangeResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRangeResponse_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 "chunk": + xx := new(GetRangeResponse_Body_Chunk) + x.RangePart = xx + { + var f []byte + f = in.Bytes() + xx.Chunk = f + } + case "splitInfo": + xx := new(GetRangeResponse_Body_SplitInfo) + x.RangePart = xx + { + var f *SplitInfo + f = new(SplitInfo) + f.UnmarshalEasyJSON(in) + xx.SplitInfo = f + } + case "ecInfo": + xx := new(GetRangeResponse_Body_EcInfo) + x.RangePart = xx + { + var f *ECInfo + f = new(ECInfo) + f.UnmarshalEasyJSON(in) + xx.EcInfo = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type isGetRangeResponse_Body_RangePart interface { + isGetRangeResponse_Body_RangePart() +} + +type GetRangeResponse_Body_Chunk struct { + Chunk []byte +} + +type GetRangeResponse_Body_SplitInfo struct { + SplitInfo *SplitInfo +} + +type GetRangeResponse_Body_EcInfo struct { + EcInfo *ECInfo +} + +func (*GetRangeResponse_Body_Chunk) isGetRangeResponse_Body_RangePart() {} + +func (*GetRangeResponse_Body_SplitInfo) isGetRangeResponse_Body_RangePart() {} + +func (*GetRangeResponse_Body_EcInfo) isGetRangeResponse_Body_RangePart() {} + +type GetRangeResponse struct { + Body *GetRangeResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRangeResponse)(nil) + _ encoding.ProtoUnmarshaler = (*GetRangeResponse)(nil) + _ json.Marshaler = (*GetRangeResponse)(nil) + _ json.Unmarshaler = (*GetRangeResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRangeResponse) 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 *GetRangeResponse) 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 *GetRangeResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRangeResponse) 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 *GetRangeResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRangeResponse) 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", "GetRangeResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(GetRangeResponse_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 *GetRangeResponse) GetBody() *GetRangeResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *GetRangeResponse) SetBody(v *GetRangeResponse_Body) { + x.Body = v +} +func (x *GetRangeResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *GetRangeResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *GetRangeResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *GetRangeResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRangeResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRangeResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRangeResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRangeResponse) 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 *GetRangeResponse_Body + f = new(GetRangeResponse_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() + } +} + +type GetRangeHashRequest_Body struct { + Address *grpc.Address `json:"address"` + Ranges []*Range `json:"ranges"` + Salt []byte `json:"salt"` + Type grpc.ChecksumType `json:"type"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRangeHashRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*GetRangeHashRequest_Body)(nil) + _ json.Marshaler = (*GetRangeHashRequest_Body)(nil) + _ json.Unmarshaler = (*GetRangeHashRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRangeHashRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Address) + for i := range x.Ranges { + size += proto.NestedStructureSize(2, x.Ranges[i]) + } + size += proto.BytesSize(3, x.Salt) + size += proto.EnumSize(4, int32(x.Type)) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRangeHashRequest_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 *GetRangeHashRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Address != nil && x.Address.StableSize() != 0 { + x.Address.EmitProtobuf(mm.AppendMessage(1)) + } + for i := range x.Ranges { + if x.Ranges[i] != nil && x.Ranges[i].StableSize() != 0 { + x.Ranges[i].EmitProtobuf(mm.AppendMessage(2)) + } + } + if len(x.Salt) != 0 { + mm.AppendBytes(3, x.Salt) + } + if int32(x.Type) != 0 { + mm.AppendInt32(4, int32(x.Type)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRangeHashRequest_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", "GetRangeHashRequest_Body") + } + switch fc.FieldNum { + case 1: // Address + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Address") + } + x.Address = new(grpc.Address) + if err := x.Address.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Ranges + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Ranges") + } + x.Ranges = append(x.Ranges, new(Range)) + ff := x.Ranges[len(x.Ranges)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // Salt + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Salt") + } + x.Salt = data + case 4: // Type + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Type") + } + x.Type = grpc.ChecksumType(data) + } + } + return nil +} +func (x *GetRangeHashRequest_Body) GetAddress() *grpc.Address { + if x != nil { + return x.Address + } + return nil +} +func (x *GetRangeHashRequest_Body) SetAddress(v *grpc.Address) { + x.Address = v +} +func (x *GetRangeHashRequest_Body) GetRanges() []*Range { + if x != nil { + return x.Ranges + } + return nil +} +func (x *GetRangeHashRequest_Body) SetRanges(v []*Range) { + x.Ranges = v +} +func (x *GetRangeHashRequest_Body) GetSalt() []byte { + if x != nil { + return x.Salt + } + return nil +} +func (x *GetRangeHashRequest_Body) SetSalt(v []byte) { + x.Salt = v +} +func (x *GetRangeHashRequest_Body) GetType() grpc.ChecksumType { + if x != nil { + return x.Type + } + return 0 +} +func (x *GetRangeHashRequest_Body) SetType(v grpc.ChecksumType) { + x.Type = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRangeHashRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRangeHashRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"address\":" + out.RawString(prefix[1:]) + x.Address.MarshalEasyJSON(out) + } + { + const prefix string = ",\"ranges\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Ranges { + if i != 0 { + out.RawByte(',') + } + x.Ranges[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"salt\":" + out.RawString(prefix) + out.Base64Bytes(x.Salt) + } + { + const prefix string = ",\"type\":" + out.RawString(prefix) + out.Int32(int32(x.Type)) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRangeHashRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRangeHashRequest_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 "address": + { + var f *grpc.Address + f = new(grpc.Address) + f.UnmarshalEasyJSON(in) + x.Address = f + } + case "ranges": + { + var f *Range + var list []*Range + in.Delim('[') + for !in.IsDelim(']') { + f = new(Range) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Ranges = list + in.Delim(']') + } + case "salt": + { + var f []byte + f = in.Bytes() + x.Salt = f + } + case "type": + { + var f grpc.ChecksumType + var parsedValue grpc.ChecksumType + switch v := in.Interface().(type) { + case string: + if vv, ok := grpc.ChecksumType_value[v]; ok { + parsedValue = grpc.ChecksumType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = grpc.ChecksumType(vv) + case float64: + parsedValue = grpc.ChecksumType(v) + } + f = parsedValue + x.Type = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type GetRangeHashRequest struct { + Body *GetRangeHashRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRangeHashRequest)(nil) + _ encoding.ProtoUnmarshaler = (*GetRangeHashRequest)(nil) + _ json.Marshaler = (*GetRangeHashRequest)(nil) + _ json.Unmarshaler = (*GetRangeHashRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRangeHashRequest) 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 *GetRangeHashRequest) 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 *GetRangeHashRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRangeHashRequest) 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 *GetRangeHashRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRangeHashRequest) 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", "GetRangeHashRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(GetRangeHashRequest_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 *GetRangeHashRequest) GetBody() *GetRangeHashRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *GetRangeHashRequest) SetBody(v *GetRangeHashRequest_Body) { + x.Body = v +} +func (x *GetRangeHashRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *GetRangeHashRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *GetRangeHashRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *GetRangeHashRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRangeHashRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRangeHashRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRangeHashRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRangeHashRequest) 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 *GetRangeHashRequest_Body + f = new(GetRangeHashRequest_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 GetRangeHashResponse_Body struct { + Type grpc.ChecksumType `json:"type"` + HashList [][]byte `json:"hashList"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRangeHashResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*GetRangeHashResponse_Body)(nil) + _ json.Marshaler = (*GetRangeHashResponse_Body)(nil) + _ json.Unmarshaler = (*GetRangeHashResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRangeHashResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.Type)) + size += proto.RepeatedBytesSize(2, x.HashList) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRangeHashResponse_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 *GetRangeHashResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.Type) != 0 { + mm.AppendInt32(1, int32(x.Type)) + } + for j := range x.HashList { + mm.AppendBytes(2, x.HashList[j]) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRangeHashResponse_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", "GetRangeHashResponse_Body") + } + switch fc.FieldNum { + case 1: // Type + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Type") + } + x.Type = grpc.ChecksumType(data) + case 2: // HashList + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "HashList") + } + x.HashList = append(x.HashList, data) + } + } + return nil +} +func (x *GetRangeHashResponse_Body) GetType() grpc.ChecksumType { + if x != nil { + return x.Type + } + return 0 +} +func (x *GetRangeHashResponse_Body) SetType(v grpc.ChecksumType) { + x.Type = v +} +func (x *GetRangeHashResponse_Body) GetHashList() [][]byte { + if x != nil { + return x.HashList + } + return nil +} +func (x *GetRangeHashResponse_Body) SetHashList(v [][]byte) { + x.HashList = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRangeHashResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRangeHashResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"type\":" + out.RawString(prefix[1:]) + out.Int32(int32(x.Type)) + } + { + const prefix string = ",\"hashList\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.HashList { + if i != 0 { + out.RawByte(',') + } + out.Base64Bytes(x.HashList[i]) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRangeHashResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRangeHashResponse_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 "type": + { + var f grpc.ChecksumType + var parsedValue grpc.ChecksumType + switch v := in.Interface().(type) { + case string: + if vv, ok := grpc.ChecksumType_value[v]; ok { + parsedValue = grpc.ChecksumType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = grpc.ChecksumType(vv) + case float64: + parsedValue = grpc.ChecksumType(v) + } + f = parsedValue + x.Type = f + } + case "hashList": + { + var f []byte + var list [][]byte + in.Delim('[') + for !in.IsDelim(']') { + f = in.Bytes() + list = append(list, f) + in.WantComma() + } + x.HashList = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type GetRangeHashResponse struct { + Body *GetRangeHashResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*GetRangeHashResponse)(nil) + _ encoding.ProtoUnmarshaler = (*GetRangeHashResponse)(nil) + _ json.Marshaler = (*GetRangeHashResponse)(nil) + _ json.Unmarshaler = (*GetRangeHashResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *GetRangeHashResponse) 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 *GetRangeHashResponse) 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 *GetRangeHashResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *GetRangeHashResponse) 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 *GetRangeHashResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *GetRangeHashResponse) 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", "GetRangeHashResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(GetRangeHashResponse_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 *GetRangeHashResponse) GetBody() *GetRangeHashResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *GetRangeHashResponse) SetBody(v *GetRangeHashResponse_Body) { + x.Body = v +} +func (x *GetRangeHashResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *GetRangeHashResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *GetRangeHashResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *GetRangeHashResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *GetRangeHashResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *GetRangeHashResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *GetRangeHashResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *GetRangeHashResponse) 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 *GetRangeHashResponse_Body + f = new(GetRangeHashResponse_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() + } +} + +type PutSingleRequest_Body struct { + Object *Object `json:"object"` + CopiesNumber []uint32 `json:"copiesNumber"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutSingleRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*PutSingleRequest_Body)(nil) + _ json.Marshaler = (*PutSingleRequest_Body)(nil) + _ json.Unmarshaler = (*PutSingleRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutSingleRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + var n int + size += proto.NestedStructureSize(1, x.Object) + n, _ = proto.RepeatedUInt32Size(2, x.CopiesNumber) + size += n + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutSingleRequest_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 *PutSingleRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Object != nil && x.Object.StableSize() != 0 { + x.Object.EmitProtobuf(mm.AppendMessage(1)) + } + if len(x.CopiesNumber) != 0 { + mm.AppendUint32s(2, x.CopiesNumber) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutSingleRequest_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", "PutSingleRequest_Body") + } + switch fc.FieldNum { + case 1: // Object + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Object") + } + x.Object = new(Object) + if err := x.Object.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // CopiesNumber + data, ok := fc.UnpackUint32s(nil) + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "CopiesNumber") + } + x.CopiesNumber = data + } + } + return nil +} +func (x *PutSingleRequest_Body) GetObject() *Object { + if x != nil { + return x.Object + } + return nil +} +func (x *PutSingleRequest_Body) SetObject(v *Object) { + x.Object = v +} +func (x *PutSingleRequest_Body) GetCopiesNumber() []uint32 { + if x != nil { + return x.CopiesNumber + } + return nil +} +func (x *PutSingleRequest_Body) SetCopiesNumber(v []uint32) { + x.CopiesNumber = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutSingleRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutSingleRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"object\":" + out.RawString(prefix[1:]) + x.Object.MarshalEasyJSON(out) + } + { + const prefix string = ",\"copiesNumber\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.CopiesNumber { + if i != 0 { + out.RawByte(',') + } + out.Uint32(x.CopiesNumber[i]) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutSingleRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutSingleRequest_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 "object": + { + var f *Object + f = new(Object) + f.UnmarshalEasyJSON(in) + x.Object = f + } + case "copiesNumber": + { + var f uint32 + var list []uint32 + in.Delim('[') + for !in.IsDelim(']') { + f = in.Uint32() + list = append(list, f) + in.WantComma() + } + x.CopiesNumber = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type PutSingleRequest struct { + Body *PutSingleRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutSingleRequest)(nil) + _ encoding.ProtoUnmarshaler = (*PutSingleRequest)(nil) + _ json.Marshaler = (*PutSingleRequest)(nil) + _ json.Unmarshaler = (*PutSingleRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutSingleRequest) 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 *PutSingleRequest) 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 *PutSingleRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutSingleRequest) 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 *PutSingleRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutSingleRequest) 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", "PutSingleRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(PutSingleRequest_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 *PutSingleRequest) GetBody() *PutSingleRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *PutSingleRequest) SetBody(v *PutSingleRequest_Body) { + x.Body = v +} +func (x *PutSingleRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *PutSingleRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *PutSingleRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *PutSingleRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutSingleRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutSingleRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutSingleRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutSingleRequest) 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 *PutSingleRequest_Body + f = new(PutSingleRequest_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 PutSingleResponse_Body struct { +} + +var ( + _ encoding.ProtoMarshaler = (*PutSingleResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*PutSingleResponse_Body)(nil) + _ json.Marshaler = (*PutSingleResponse_Body)(nil) + _ json.Unmarshaler = (*PutSingleResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutSingleResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutSingleResponse_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 *PutSingleResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutSingleResponse_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", "PutSingleResponse_Body") + } + switch fc.FieldNum { + } + } + return nil +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutSingleResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutSingleResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutSingleResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutSingleResponse_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 { + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type PutSingleResponse struct { + Body *PutSingleResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*PutSingleResponse)(nil) + _ encoding.ProtoUnmarshaler = (*PutSingleResponse)(nil) + _ json.Marshaler = (*PutSingleResponse)(nil) + _ json.Unmarshaler = (*PutSingleResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PutSingleResponse) 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 *PutSingleResponse) 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 *PutSingleResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PutSingleResponse) 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 *PutSingleResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PutSingleResponse) 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", "PutSingleResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(PutSingleResponse_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 *PutSingleResponse) GetBody() *PutSingleResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *PutSingleResponse) SetBody(v *PutSingleResponse_Body) { + x.Body = v +} +func (x *PutSingleResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *PutSingleResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *PutSingleResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *PutSingleResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PutSingleResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PutSingleResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PutSingleResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PutSingleResponse) 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 *PutSingleResponse_Body + f = new(PutSingleResponse_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() + } +} + +type PatchRequest_Body_Patch struct { + SourceRange *Range `json:"sourceRange"` + Chunk []byte `json:"chunk"` +} + +var ( + _ encoding.ProtoMarshaler = (*PatchRequest_Body_Patch)(nil) + _ encoding.ProtoUnmarshaler = (*PatchRequest_Body_Patch)(nil) + _ json.Marshaler = (*PatchRequest_Body_Patch)(nil) + _ json.Unmarshaler = (*PatchRequest_Body_Patch)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PatchRequest_Body_Patch) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.SourceRange) + size += proto.BytesSize(2, x.Chunk) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PatchRequest_Body_Patch) 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 *PatchRequest_Body_Patch) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.SourceRange != nil && x.SourceRange.StableSize() != 0 { + x.SourceRange.EmitProtobuf(mm.AppendMessage(1)) + } + if len(x.Chunk) != 0 { + mm.AppendBytes(2, x.Chunk) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PatchRequest_Body_Patch) 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", "PatchRequest_Body_Patch") + } + switch fc.FieldNum { + case 1: // SourceRange + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SourceRange") + } + x.SourceRange = new(Range) + if err := x.SourceRange.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Chunk + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Chunk") + } + x.Chunk = data + } + } + return nil +} +func (x *PatchRequest_Body_Patch) GetSourceRange() *Range { + if x != nil { + return x.SourceRange + } + return nil +} +func (x *PatchRequest_Body_Patch) SetSourceRange(v *Range) { + x.SourceRange = v +} +func (x *PatchRequest_Body_Patch) GetChunk() []byte { + if x != nil { + return x.Chunk + } + return nil +} +func (x *PatchRequest_Body_Patch) SetChunk(v []byte) { + x.Chunk = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PatchRequest_Body_Patch) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PatchRequest_Body_Patch) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"sourceRange\":" + out.RawString(prefix[1:]) + x.SourceRange.MarshalEasyJSON(out) + } + { + const prefix string = ",\"chunk\":" + out.RawString(prefix) + out.Base64Bytes(x.Chunk) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PatchRequest_Body_Patch) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PatchRequest_Body_Patch) 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 "sourceRange": + { + var f *Range + f = new(Range) + f.UnmarshalEasyJSON(in) + x.SourceRange = f + } + case "chunk": + { + var f []byte + f = in.Bytes() + x.Chunk = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type PatchRequest_Body struct { + Address *grpc.Address `json:"address"` + NewAttributes []*Header_Attribute `json:"newAttributes"` + ReplaceAttributes bool `json:"replaceAttributes"` + Patch *PatchRequest_Body_Patch `json:"patch"` +} + +var ( + _ encoding.ProtoMarshaler = (*PatchRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*PatchRequest_Body)(nil) + _ json.Marshaler = (*PatchRequest_Body)(nil) + _ json.Unmarshaler = (*PatchRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PatchRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Address) + for i := range x.NewAttributes { + size += proto.NestedStructureSize(2, x.NewAttributes[i]) + } + size += proto.BoolSize(3, x.ReplaceAttributes) + size += proto.NestedStructureSize(4, x.Patch) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PatchRequest_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 *PatchRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Address != nil && x.Address.StableSize() != 0 { + x.Address.EmitProtobuf(mm.AppendMessage(1)) + } + for i := range x.NewAttributes { + if x.NewAttributes[i] != nil && x.NewAttributes[i].StableSize() != 0 { + x.NewAttributes[i].EmitProtobuf(mm.AppendMessage(2)) + } + } + if x.ReplaceAttributes { + mm.AppendBool(3, x.ReplaceAttributes) + } + if x.Patch != nil && x.Patch.StableSize() != 0 { + x.Patch.EmitProtobuf(mm.AppendMessage(4)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PatchRequest_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", "PatchRequest_Body") + } + switch fc.FieldNum { + case 1: // Address + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Address") + } + x.Address = new(grpc.Address) + if err := x.Address.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // NewAttributes + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "NewAttributes") + } + x.NewAttributes = append(x.NewAttributes, new(Header_Attribute)) + ff := x.NewAttributes[len(x.NewAttributes)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // ReplaceAttributes + data, ok := fc.Bool() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ReplaceAttributes") + } + x.ReplaceAttributes = data + case 4: // Patch + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Patch") + } + x.Patch = new(PatchRequest_Body_Patch) + if err := x.Patch.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *PatchRequest_Body) GetAddress() *grpc.Address { + if x != nil { + return x.Address + } + return nil +} +func (x *PatchRequest_Body) SetAddress(v *grpc.Address) { + x.Address = v +} +func (x *PatchRequest_Body) GetNewAttributes() []*Header_Attribute { + if x != nil { + return x.NewAttributes + } + return nil +} +func (x *PatchRequest_Body) SetNewAttributes(v []*Header_Attribute) { + x.NewAttributes = v +} +func (x *PatchRequest_Body) GetReplaceAttributes() bool { + if x != nil { + return x.ReplaceAttributes + } + return false +} +func (x *PatchRequest_Body) SetReplaceAttributes(v bool) { + x.ReplaceAttributes = v +} +func (x *PatchRequest_Body) GetPatch() *PatchRequest_Body_Patch { + if x != nil { + return x.Patch + } + return nil +} +func (x *PatchRequest_Body) SetPatch(v *PatchRequest_Body_Patch) { + x.Patch = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PatchRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PatchRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"address\":" + out.RawString(prefix[1:]) + x.Address.MarshalEasyJSON(out) + } + { + const prefix string = ",\"newAttributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.NewAttributes { + if i != 0 { + out.RawByte(',') + } + x.NewAttributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"replaceAttributes\":" + out.RawString(prefix) + out.Bool(x.ReplaceAttributes) + } + { + const prefix string = ",\"patch\":" + out.RawString(prefix) + x.Patch.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PatchRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PatchRequest_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 "address": + { + var f *grpc.Address + f = new(grpc.Address) + f.UnmarshalEasyJSON(in) + x.Address = f + } + case "newAttributes": + { + var f *Header_Attribute + var list []*Header_Attribute + in.Delim('[') + for !in.IsDelim(']') { + f = new(Header_Attribute) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.NewAttributes = list + in.Delim(']') + } + case "replaceAttributes": + { + var f bool + f = in.Bool() + x.ReplaceAttributes = f + } + case "patch": + { + var f *PatchRequest_Body_Patch + f = new(PatchRequest_Body_Patch) + f.UnmarshalEasyJSON(in) + x.Patch = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type PatchRequest struct { + Body *PatchRequest_Body `json:"body"` + MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*PatchRequest)(nil) + _ encoding.ProtoUnmarshaler = (*PatchRequest)(nil) + _ json.Marshaler = (*PatchRequest)(nil) + _ json.Unmarshaler = (*PatchRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PatchRequest) 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 *PatchRequest) 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 *PatchRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PatchRequest) 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 *PatchRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PatchRequest) 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", "PatchRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(PatchRequest_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 *PatchRequest) GetBody() *PatchRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *PatchRequest) SetBody(v *PatchRequest_Body) { + x.Body = v +} +func (x *PatchRequest) GetMetaHeader() *grpc1.RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *PatchRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { + x.MetaHeader = v +} +func (x *PatchRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *PatchRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PatchRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PatchRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PatchRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PatchRequest) 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 *PatchRequest_Body + f = new(PatchRequest_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 PatchResponse_Body struct { + ObjectId *grpc.ObjectID `json:"objectId"` +} + +var ( + _ encoding.ProtoMarshaler = (*PatchResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*PatchResponse_Body)(nil) + _ json.Marshaler = (*PatchResponse_Body)(nil) + _ json.Unmarshaler = (*PatchResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PatchResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.ObjectId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PatchResponse_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 *PatchResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + x.ObjectId.EmitProtobuf(mm.AppendMessage(1)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PatchResponse_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", "PatchResponse_Body") + } + switch fc.FieldNum { + case 1: // ObjectId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ObjectId") + } + x.ObjectId = new(grpc.ObjectID) + if err := x.ObjectId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *PatchResponse_Body) GetObjectId() *grpc.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} +func (x *PatchResponse_Body) SetObjectId(v *grpc.ObjectID) { + x.ObjectId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PatchResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PatchResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"objectId\":" + out.RawString(prefix[1:]) + x.ObjectId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PatchResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PatchResponse_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 "objectId": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.ObjectId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type PatchResponse struct { + Body *PatchResponse_Body `json:"body"` + MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*PatchResponse)(nil) + _ encoding.ProtoUnmarshaler = (*PatchResponse)(nil) + _ json.Marshaler = (*PatchResponse)(nil) + _ json.Unmarshaler = (*PatchResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *PatchResponse) 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 *PatchResponse) 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 *PatchResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *PatchResponse) 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 *PatchResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *PatchResponse) 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", "PatchResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(PatchResponse_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 *PatchResponse) GetBody() *PatchResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *PatchResponse) SetBody(v *PatchResponse_Body) { + x.Body = v +} +func (x *PatchResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *PatchResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *PatchResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *PatchResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *PatchResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *PatchResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *PatchResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *PatchResponse) 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 *PatchResponse_Body + f = new(PatchResponse_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() + } +} diff --git a/object/grpc/service_frostfs_fuzz.go b/object/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..f58ee01 --- /dev/null +++ b/object/grpc/service_frostfs_fuzz.go @@ -0,0 +1,387 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package object + +func DoFuzzProtoGetRequest(data []byte) int { + msg := new(GetRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONGetRequest(data []byte) int { + msg := new(GetRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoGetResponse(data []byte) int { + msg := new(GetResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONGetResponse(data []byte) int { + msg := new(GetResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoPutRequest(data []byte) int { + msg := new(PutRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONPutRequest(data []byte) int { + msg := new(PutRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoPutResponse(data []byte) int { + msg := new(PutResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONPutResponse(data []byte) int { + msg := new(PutResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoDeleteRequest(data []byte) int { + msg := new(DeleteRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONDeleteRequest(data []byte) int { + msg := new(DeleteRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoDeleteResponse(data []byte) int { + msg := new(DeleteResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONDeleteResponse(data []byte) int { + msg := new(DeleteResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoHeadRequest(data []byte) int { + msg := new(HeadRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONHeadRequest(data []byte) int { + msg := new(HeadRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoHeaderWithSignature(data []byte) int { + msg := new(HeaderWithSignature) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONHeaderWithSignature(data []byte) int { + msg := new(HeaderWithSignature) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoHeadResponse(data []byte) int { + msg := new(HeadResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONHeadResponse(data []byte) int { + msg := new(HeadResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoSearchRequest(data []byte) int { + msg := new(SearchRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONSearchRequest(data []byte) int { + msg := new(SearchRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoSearchResponse(data []byte) int { + msg := new(SearchResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONSearchResponse(data []byte) int { + msg := new(SearchResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoRange(data []byte) int { + msg := new(Range) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONRange(data []byte) int { + msg := new(Range) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoGetRangeRequest(data []byte) int { + msg := new(GetRangeRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONGetRangeRequest(data []byte) int { + msg := new(GetRangeRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoGetRangeResponse(data []byte) int { + msg := new(GetRangeResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONGetRangeResponse(data []byte) int { + msg := new(GetRangeResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoGetRangeHashRequest(data []byte) int { + msg := new(GetRangeHashRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONGetRangeHashRequest(data []byte) int { + msg := new(GetRangeHashRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoGetRangeHashResponse(data []byte) int { + msg := new(GetRangeHashResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONGetRangeHashResponse(data []byte) int { + msg := new(GetRangeHashResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoPutSingleRequest(data []byte) int { + msg := new(PutSingleRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONPutSingleRequest(data []byte) int { + msg := new(PutSingleRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoPutSingleResponse(data []byte) int { + msg := new(PutSingleResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONPutSingleResponse(data []byte) int { + msg := new(PutSingleResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoPatchRequest(data []byte) int { + msg := new(PatchRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONPatchRequest(data []byte) int { + msg := new(PatchRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoPatchResponse(data []byte) int { + msg := new(PatchResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONPatchResponse(data []byte) int { + msg := new(PatchResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/object/grpc/service_frostfs_test.go b/object/grpc/service_frostfs_test.go new file mode 100644 index 0000000..cb4baeb --- /dev/null +++ b/object/grpc/service_frostfs_test.go @@ -0,0 +1,211 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package object + +import ( + testing "testing" +) + +func FuzzProtoGetRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoGetRequest(data) + }) +} +func FuzzJSONGetRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONGetRequest(data) + }) +} +func FuzzProtoGetResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoGetResponse(data) + }) +} +func FuzzJSONGetResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONGetResponse(data) + }) +} +func FuzzProtoPutRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoPutRequest(data) + }) +} +func FuzzJSONPutRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONPutRequest(data) + }) +} +func FuzzProtoPutResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoPutResponse(data) + }) +} +func FuzzJSONPutResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONPutResponse(data) + }) +} +func FuzzProtoDeleteRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoDeleteRequest(data) + }) +} +func FuzzJSONDeleteRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONDeleteRequest(data) + }) +} +func FuzzProtoDeleteResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoDeleteResponse(data) + }) +} +func FuzzJSONDeleteResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONDeleteResponse(data) + }) +} +func FuzzProtoHeadRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoHeadRequest(data) + }) +} +func FuzzJSONHeadRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONHeadRequest(data) + }) +} +func FuzzProtoHeaderWithSignature(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoHeaderWithSignature(data) + }) +} +func FuzzJSONHeaderWithSignature(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONHeaderWithSignature(data) + }) +} +func FuzzProtoHeadResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoHeadResponse(data) + }) +} +func FuzzJSONHeadResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONHeadResponse(data) + }) +} +func FuzzProtoSearchRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoSearchRequest(data) + }) +} +func FuzzJSONSearchRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONSearchRequest(data) + }) +} +func FuzzProtoSearchResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoSearchResponse(data) + }) +} +func FuzzJSONSearchResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONSearchResponse(data) + }) +} +func FuzzProtoRange(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoRange(data) + }) +} +func FuzzJSONRange(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONRange(data) + }) +} +func FuzzProtoGetRangeRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoGetRangeRequest(data) + }) +} +func FuzzJSONGetRangeRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONGetRangeRequest(data) + }) +} +func FuzzProtoGetRangeResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoGetRangeResponse(data) + }) +} +func FuzzJSONGetRangeResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONGetRangeResponse(data) + }) +} +func FuzzProtoGetRangeHashRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoGetRangeHashRequest(data) + }) +} +func FuzzJSONGetRangeHashRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONGetRangeHashRequest(data) + }) +} +func FuzzProtoGetRangeHashResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoGetRangeHashResponse(data) + }) +} +func FuzzJSONGetRangeHashResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONGetRangeHashResponse(data) + }) +} +func FuzzProtoPutSingleRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoPutSingleRequest(data) + }) +} +func FuzzJSONPutSingleRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONPutSingleRequest(data) + }) +} +func FuzzProtoPutSingleResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoPutSingleResponse(data) + }) +} +func FuzzJSONPutSingleResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONPutSingleResponse(data) + }) +} +func FuzzProtoPatchRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoPatchRequest(data) + }) +} +func FuzzJSONPatchRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONPatchRequest(data) + }) +} +func FuzzProtoPatchResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoPatchResponse(data) + }) +} +func FuzzJSONPatchResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONPatchResponse(data) + }) +} diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 2494be9..687df99 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -331,7 +331,7 @@ type ObjectServiceClient interface { // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ // object not found in container; // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; + // the requested object has been marked as deleted. // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ // the requested range is out of bounds; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ @@ -855,7 +855,7 @@ type ObjectServiceServer interface { // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ // object not found in container; // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted; + // the requested object has been marked as deleted. // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ // the requested range is out of bounds; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ diff --git a/object/grpc/status.pb.go b/object/grpc/status.pb.go deleted file mode 100644 index 034fa1b..0000000 --- a/object/grpc/status.pb.go +++ /dev/null @@ -1,251 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.18.0 -// source: v2/object/grpc/status.proto - -package object - -import ( - reflect "reflect" - sync "sync" - - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type StatusCommon int32 - -const ( - StatusCommon_ACCESS_DENIED StatusCommon = 0 -) - -// Enum value maps for StatusCommon. -var ( - StatusCommon_name = map[int32]string{ - 0: "ACCESS_DENIED", - } - StatusCommon_value = map[string]int32{ - "ACCESS_DENIED": 0, - } -) - -func (x StatusCommon) Enum() *StatusCommon { - p := new(StatusCommon) - *p = x - return p -} - -func (x StatusCommon) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (StatusCommon) Descriptor() protoreflect.EnumDescriptor { - return file_v2_object_grpc_status_proto_enumTypes[0].Descriptor() -} - -func (StatusCommon) Type() protoreflect.EnumType { - return &file_v2_object_grpc_status_proto_enumTypes[0] -} - -func (x StatusCommon) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use StatusCommon.Descriptor instead. -func (StatusCommon) EnumDescriptor() ([]byte, []int) { - return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{0} -} - -type StatusPut int32 - -const ( - StatusPut_STATUS_PUT_INCOMPLETE StatusPut = 0 -) - -// Enum value maps for StatusPut. -var ( - StatusPut_name = map[int32]string{ - 0: "STATUS_PUT_INCOMPLETE", - } - StatusPut_value = map[string]int32{ - "STATUS_PUT_INCOMPLETE": 0, - } -) - -func (x StatusPut) Enum() *StatusPut { - p := new(StatusPut) - *p = x - return p -} - -func (x StatusPut) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (StatusPut) Descriptor() protoreflect.EnumDescriptor { - return file_v2_object_grpc_status_proto_enumTypes[1].Descriptor() -} - -func (StatusPut) Type() protoreflect.EnumType { - return &file_v2_object_grpc_status_proto_enumTypes[1] -} - -func (x StatusPut) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use StatusPut.Descriptor instead. -func (StatusPut) EnumDescriptor() ([]byte, []int) { - return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{1} -} - -type PutIncompleteDetail struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Statuses []*grpc.Status `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"` -} - -func (x *PutIncompleteDetail) Reset() { - *x = PutIncompleteDetail{} - if protoimpl.UnsafeEnabled { - mi := &file_v2_object_grpc_status_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PutIncompleteDetail) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutIncompleteDetail) ProtoMessage() {} - -func (x *PutIncompleteDetail) ProtoReflect() protoreflect.Message { - mi := &file_v2_object_grpc_status_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutIncompleteDetail.ProtoReflect.Descriptor instead. -func (*PutIncompleteDetail) Descriptor() ([]byte, []int) { - return file_v2_object_grpc_status_proto_rawDescGZIP(), []int{0} -} - -func (x *PutIncompleteDetail) GetStatuses() []*grpc.Status { - if x != nil { - return x.Statuses - } - return nil -} - -var File_v2_object_grpc_status_proto protoreflect.FileDescriptor - -var file_v2_object_grpc_status_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a, - 0x1a, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x13, 0x50, - 0x75, 0x74, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x12, 0x34, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x2a, 0x21, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x43, 0x43, 0x45, - 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x2a, 0x26, 0x0a, 0x09, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x50, 0x55, 0x54, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, - 0x45, 0x10, 0x00, 0x42, 0x56, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x6e, 0x73, 0x70, 0x63, 0x63, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x6f, 0x66, - 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, - 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_v2_object_grpc_status_proto_rawDescOnce sync.Once - file_v2_object_grpc_status_proto_rawDescData = file_v2_object_grpc_status_proto_rawDesc -) - -func file_v2_object_grpc_status_proto_rawDescGZIP() []byte { - file_v2_object_grpc_status_proto_rawDescOnce.Do(func() { - file_v2_object_grpc_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2_object_grpc_status_proto_rawDescData) - }) - return file_v2_object_grpc_status_proto_rawDescData -} - -var file_v2_object_grpc_status_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v2_object_grpc_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2_object_grpc_status_proto_goTypes = []interface{}{ - (StatusCommon)(0), // 0: neo.fs.v2.object.StatusCommon - (StatusPut)(0), // 1: neo.fs.v2.object.StatusPut - (*PutIncompleteDetail)(nil), // 2: neo.fs.v2.object.PutIncompleteDetail - (*grpc.Status)(nil), // 3: neo.fs.v2.status.Status -} -var file_v2_object_grpc_status_proto_depIdxs = []int32{ - 3, // 0: neo.fs.v2.object.PutIncompleteDetail.statuses:type_name -> neo.fs.v2.status.Status - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_v2_object_grpc_status_proto_init() } -func file_v2_object_grpc_status_proto_init() { - if File_v2_object_grpc_status_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_v2_object_grpc_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PutIncompleteDetail); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2_object_grpc_status_proto_rawDesc, - NumEnums: 2, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_v2_object_grpc_status_proto_goTypes, - DependencyIndexes: file_v2_object_grpc_status_proto_depIdxs, - EnumInfos: file_v2_object_grpc_status_proto_enumTypes, - MessageInfos: file_v2_object_grpc_status_proto_msgTypes, - }.Build() - File_v2_object_grpc_status_proto = out.File - file_v2_object_grpc_status_proto_rawDesc = nil - file_v2_object_grpc_status_proto_goTypes = nil - file_v2_object_grpc_status_proto_depIdxs = nil -} diff --git a/object/grpc/types.go b/object/grpc/types.go deleted file mode 100644 index 9a2cdea..0000000 --- a/object/grpc/types.go +++ /dev/null @@ -1,197 +0,0 @@ -package object - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" -) - -// SetKey sets key to the object attribute. -func (m *Header_Attribute) SetKey(v string) { - m.Key = v -} - -// SetValue sets value of the object attribute. -func (m *Header_Attribute) SetValue(v string) { - m.Value = v -} - -// SetParent sets identifier of the parent object. -func (m *Header_Split) SetParent(v *refs.ObjectID) { - m.Parent = v -} - -// SetPrevious sets identifier of the previous object in split-chain. -func (m *Header_Split) SetPrevious(v *refs.ObjectID) { - m.Previous = v -} - -// SetParentSignature sets signature of the parent object header. -func (m *Header_Split) SetParentSignature(v *refs.Signature) { - m.ParentSignature = v -} - -// SetParentHeader sets parent header structure. -func (m *Header_Split) SetParentHeader(v *Header) { - m.ParentHeader = v -} - -// SetChildren sets list of the identifiers of the child objects. -func (m *Header_Split) SetChildren(v []*refs.ObjectID) { - m.Children = v -} - -// SetSplitId sets split ID of the object. -func (m *Header_Split) SetSplitId(v []byte) { - m.SplitId = v -} - -// SetContainerId sets identifier of the container. -func (m *Header) SetContainerId(v *refs.ContainerID) { - m.ContainerId = v -} - -// SetOwnerId sets identifier of the object owner. -func (m *Header) SetOwnerId(v *refs.OwnerID) { - m.OwnerId = v -} - -// SetCreationEpoch sets creation epoch number. -func (m *Header) SetCreationEpoch(v uint64) { - m.CreationEpoch = v -} - -// SetVersion sets version of the object format. -func (m *Header) SetVersion(v *refs.Version) { - m.Version = v -} - -// SetPayloadLength sets length of the object payload. -func (m *Header) SetPayloadLength(v uint64) { - m.PayloadLength = v -} - -// SetPayloadHash sets hash of the object payload. -func (m *Header) SetPayloadHash(v *refs.Checksum) { - m.PayloadHash = v -} - -// SetObjectType sets type of the object. -func (m *Header) SetObjectType(v ObjectType) { - m.ObjectType = v -} - -// SetHomomorphicHash sets homomorphic hash of the object payload. -func (m *Header) SetHomomorphicHash(v *refs.Checksum) { - m.HomomorphicHash = v -} - -// SetSessionToken sets session token. -func (m *Header) SetSessionToken(v *session.SessionToken) { - m.SessionToken = v -} - -// SetAttributes sets list of the object attributes. -func (m *Header) SetAttributes(v []*Header_Attribute) { - m.Attributes = v -} - -// SetSplit sets split header. -func (m *Header) SetSplit(v *Header_Split) { - m.Split = v -} - -// SetObjectId sets identifier of the object. -func (m *Object) SetObjectId(v *refs.ObjectID) { - m.ObjectId = v -} - -// SetSignature sets signature of the object identifier. -func (m *Object) SetSignature(v *refs.Signature) { - m.Signature = v -} - -// SetHeader sets header of the object. -func (m *Object) SetHeader(v *Header) { - m.Header = v -} - -// SetPayload sets payload bytes of the object. -func (m *Object) SetPayload(v []byte) { - m.Payload = v -} - -// SetVersion sets version of the object. -func (m *ShortHeader) SetVersion(v *refs.Version) { - m.Version = v -} - -// SetCreationEpoch sets creation epoch number. -func (m *ShortHeader) SetCreationEpoch(v uint64) { - m.CreationEpoch = v -} - -// SetOwnerId sets identifier of the object owner. -func (m *ShortHeader) SetOwnerId(v *refs.OwnerID) { - m.OwnerId = v -} - -// SetObjectType sets type of the object. -func (m *ShortHeader) SetObjectType(v ObjectType) { - m.ObjectType = v -} - -// SetPayloadLength sets length of the object payload. -func (m *ShortHeader) SetPayloadLength(v uint64) { - m.PayloadLength = v -} - -// SetPayloadHash sets hash of the object payload. -func (m *ShortHeader) SetPayloadHash(v *refs.Checksum) { - m.PayloadHash = v -} - -// SetHomomorphicHash sets homomorphic hash of the object payload. -func (m *ShortHeader) SetHomomorphicHash(v *refs.Checksum) { - m.HomomorphicHash = v -} - -// SetSplitId sets id of split hierarchy. -func (m *SplitInfo) SetSplitId(v []byte) { - m.SplitId = v -} - -// SetLastPart sets id of most right child in split hierarchy. -func (m *SplitInfo) SetLastPart(v *refs.ObjectID) { - m.LastPart = v -} - -// SetLink sets id of linking object in split hierarchy. -func (m *SplitInfo) SetLink(v *refs.ObjectID) { - m.Link = v -} - -// FromString parses ObjectType from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *ObjectType) FromString(s string) bool { - i, ok := ObjectType_value[s] - if ok { - *x = ObjectType(i) - } - - return ok -} - -// FromString parses MatchType from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *MatchType) FromString(s string) bool { - i, ok := MatchType_value[s] - if ok { - *x = MatchType(i) - } - - return ok -} diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go deleted file mode 100644 index 2a5a2f9..0000000 --- a/object/grpc/types.pb.go +++ /dev/null @@ -1,1373 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: object/grpc/types.proto - -package object - -import ( - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Type of the object payload content. Only `REGULAR` type objects can be split, -// hence `TOMBSTONE` and `LOCK` payload is limited by the -// maximum object size. -// -// String presentation of object type is the same as definition: -// * REGULAR -// * TOMBSTONE -// * LOCK -type ObjectType int32 - -const ( - // Just a normal object - ObjectType_REGULAR ObjectType = 0 - // Used internally to identify deleted objects - ObjectType_TOMBSTONE ObjectType = 1 - // Object lock - ObjectType_LOCK ObjectType = 3 -) - -// Enum value maps for ObjectType. -var ( - ObjectType_name = map[int32]string{ - 0: "REGULAR", - 1: "TOMBSTONE", - 3: "LOCK", - } - ObjectType_value = map[string]int32{ - "REGULAR": 0, - "TOMBSTONE": 1, - "LOCK": 3, - } -) - -func (x ObjectType) Enum() *ObjectType { - p := new(ObjectType) - *p = x - return p -} - -func (x ObjectType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ObjectType) Descriptor() protoreflect.EnumDescriptor { - return file_object_grpc_types_proto_enumTypes[0].Descriptor() -} - -func (ObjectType) Type() protoreflect.EnumType { - return &file_object_grpc_types_proto_enumTypes[0] -} - -func (x ObjectType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ObjectType.Descriptor instead. -func (ObjectType) EnumDescriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{0} -} - -// Type of match expression -type MatchType int32 - -const ( - // Unknown. Not used - MatchType_MATCH_TYPE_UNSPECIFIED MatchType = 0 - // Full string match - MatchType_STRING_EQUAL MatchType = 1 - // Full string mismatch - MatchType_STRING_NOT_EQUAL MatchType = 2 - // Lack of key - MatchType_NOT_PRESENT MatchType = 3 - // String prefix match - MatchType_COMMON_PREFIX MatchType = 4 -) - -// Enum value maps for MatchType. -var ( - MatchType_name = map[int32]string{ - 0: "MATCH_TYPE_UNSPECIFIED", - 1: "STRING_EQUAL", - 2: "STRING_NOT_EQUAL", - 3: "NOT_PRESENT", - 4: "COMMON_PREFIX", - } - MatchType_value = map[string]int32{ - "MATCH_TYPE_UNSPECIFIED": 0, - "STRING_EQUAL": 1, - "STRING_NOT_EQUAL": 2, - "NOT_PRESENT": 3, - "COMMON_PREFIX": 4, - } -) - -func (x MatchType) Enum() *MatchType { - p := new(MatchType) - *p = x - return p -} - -func (x MatchType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MatchType) Descriptor() protoreflect.EnumDescriptor { - return file_object_grpc_types_proto_enumTypes[1].Descriptor() -} - -func (MatchType) Type() protoreflect.EnumType { - return &file_object_grpc_types_proto_enumTypes[1] -} - -func (x MatchType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MatchType.Descriptor instead. -func (MatchType) EnumDescriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{1} -} - -// Short header fields -type ShortHeader struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Object format version. Effectively, the version of API library used to - // create particular object. - Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Epoch when the object was created - CreationEpoch uint64 `protobuf:"varint,2,opt,name=creation_epoch,json=creationEpoch,proto3" json:"creation_epoch,omitempty"` - // Object's owner - OwnerId *grpc.OwnerID `protobuf:"bytes,3,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` - // Type of the object payload content - ObjectType ObjectType `protobuf:"varint,4,opt,name=object_type,json=objectType,proto3,enum=neo.fs.v2.object.ObjectType" json:"object_type,omitempty"` - // Size of payload in bytes. - // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown - PayloadLength uint64 `protobuf:"varint,5,opt,name=payload_length,json=payloadLength,proto3" json:"payload_length,omitempty"` - // Hash of payload bytes - PayloadHash *grpc.Checksum `protobuf:"bytes,6,opt,name=payload_hash,json=payloadHash,proto3" json:"payload_hash,omitempty"` - // Homomorphic hash of the object payload - HomomorphicHash *grpc.Checksum `protobuf:"bytes,7,opt,name=homomorphic_hash,json=homomorphicHash,proto3" json:"homomorphic_hash,omitempty"` -} - -func (x *ShortHeader) Reset() { - *x = ShortHeader{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ShortHeader) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ShortHeader) ProtoMessage() {} - -func (x *ShortHeader) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ShortHeader.ProtoReflect.Descriptor instead. -func (*ShortHeader) Descriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *ShortHeader) GetVersion() *grpc.Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *ShortHeader) GetCreationEpoch() uint64 { - if x != nil { - return x.CreationEpoch - } - return 0 -} - -func (x *ShortHeader) GetOwnerId() *grpc.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} - -func (x *ShortHeader) GetObjectType() ObjectType { - if x != nil { - return x.ObjectType - } - return ObjectType_REGULAR -} - -func (x *ShortHeader) GetPayloadLength() uint64 { - if x != nil { - return x.PayloadLength - } - return 0 -} - -func (x *ShortHeader) GetPayloadHash() *grpc.Checksum { - if x != nil { - return x.PayloadHash - } - return nil -} - -func (x *ShortHeader) GetHomomorphicHash() *grpc.Checksum { - if x != nil { - return x.HomomorphicHash - } - return nil -} - -// Object Header -type Header struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Object format version. Effectively, the version of API library used to - // create particular object - Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Object's container - ContainerId *grpc.ContainerID `protobuf:"bytes,2,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"` - // Object's owner - OwnerId *grpc.OwnerID `protobuf:"bytes,3,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` - // Object creation Epoch - CreationEpoch uint64 `protobuf:"varint,4,opt,name=creation_epoch,json=creationEpoch,proto3" json:"creation_epoch,omitempty"` - // Size of payload in bytes. - // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. - PayloadLength uint64 `protobuf:"varint,5,opt,name=payload_length,json=payloadLength,proto3" json:"payload_length,omitempty"` - // Hash of payload bytes - PayloadHash *grpc.Checksum `protobuf:"bytes,6,opt,name=payload_hash,json=payloadHash,proto3" json:"payload_hash,omitempty"` - // Type of the object payload content - ObjectType ObjectType `protobuf:"varint,7,opt,name=object_type,json=objectType,proto3,enum=neo.fs.v2.object.ObjectType" json:"object_type,omitempty"` - // Homomorphic hash of the object payload - HomomorphicHash *grpc.Checksum `protobuf:"bytes,8,opt,name=homomorphic_hash,json=homomorphicHash,proto3" json:"homomorphic_hash,omitempty"` - // Session token, if it was used during Object creation. Need it to verify - // integrity and authenticity out of Request scope. - SessionToken *grpc1.SessionToken `protobuf:"bytes,9,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` - // User-defined object attributes - Attributes []*Header_Attribute `protobuf:"bytes,10,rep,name=attributes,proto3" json:"attributes,omitempty"` - // Position of the object in the split hierarchy - Split *Header_Split `protobuf:"bytes,11,opt,name=split,proto3" json:"split,omitempty"` - // Erasure code chunk information. - Ec *Header_EC `protobuf:"bytes,12,opt,name=ec,proto3" json:"ec,omitempty"` -} - -func (x *Header) Reset() { - *x = Header{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Header) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Header) ProtoMessage() {} - -func (x *Header) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Header.ProtoReflect.Descriptor instead. -func (*Header) Descriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{1} -} - -func (x *Header) GetVersion() *grpc.Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *Header) GetContainerId() *grpc.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -func (x *Header) GetOwnerId() *grpc.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} - -func (x *Header) GetCreationEpoch() uint64 { - if x != nil { - return x.CreationEpoch - } - return 0 -} - -func (x *Header) GetPayloadLength() uint64 { - if x != nil { - return x.PayloadLength - } - return 0 -} - -func (x *Header) GetPayloadHash() *grpc.Checksum { - if x != nil { - return x.PayloadHash - } - return nil -} - -func (x *Header) GetObjectType() ObjectType { - if x != nil { - return x.ObjectType - } - return ObjectType_REGULAR -} - -func (x *Header) GetHomomorphicHash() *grpc.Checksum { - if x != nil { - return x.HomomorphicHash - } - return nil -} - -func (x *Header) GetSessionToken() *grpc1.SessionToken { - if x != nil { - return x.SessionToken - } - return nil -} - -func (x *Header) GetAttributes() []*Header_Attribute { - if x != nil { - return x.Attributes - } - return nil -} - -func (x *Header) GetSplit() *Header_Split { - if x != nil { - return x.Split - } - return nil -} - -func (x *Header) GetEc() *Header_EC { - if x != nil { - return x.Ec - } - return nil -} - -// Object structure. Object is immutable and content-addressed. It means -// `ObjectID` will change if the header or the payload changes. It's calculated -// as a hash of header field which contains hash of the object's payload. -// -// For non-regular object types payload format depends on object type specified -// in the header. -type Object struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Object's unique identifier. - ObjectId *grpc.ObjectID `protobuf:"bytes,1,opt,name=object_id,json=objectID,proto3" json:"object_id,omitempty"` - // Signed object_id - Signature *grpc.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - // Object metadata headers - Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` - // Payload bytes - Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (x *Object) Reset() { - *x = Object{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Object) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Object) ProtoMessage() {} - -func (x *Object) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Object.ProtoReflect.Descriptor instead. -func (*Object) Descriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{2} -} - -func (x *Object) GetObjectId() *grpc.ObjectID { - if x != nil { - return x.ObjectId - } - return nil -} - -func (x *Object) GetSignature() *grpc.Signature { - if x != nil { - return x.Signature - } - return nil -} - -func (x *Object) GetHeader() *Header { - if x != nil { - return x.Header - } - return nil -} - -func (x *Object) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -// Meta information of split hierarchy for object assembly. With the last part -// one can traverse linked list of split hierarchy back to the first part and -// assemble the original object. With a linking object one can assemble an -// object right from the object parts. -type SplitInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 16 byte UUID used to identify the split object hierarchy parts. - SplitId []byte `protobuf:"bytes,1,opt,name=split_id,json=splitId,proto3" json:"split_id,omitempty"` - // The identifier of the last object in split hierarchy parts. It contains - // split header with the original object header. - LastPart *grpc.ObjectID `protobuf:"bytes,2,opt,name=last_part,json=lastPart,proto3" json:"last_part,omitempty"` - // The identifier of a linking object for split hierarchy parts. It contains - // split header with the original object header and a sorted list of - // object parts. - Link *grpc.ObjectID `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"` -} - -func (x *SplitInfo) Reset() { - *x = SplitInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SplitInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SplitInfo) ProtoMessage() {} - -func (x *SplitInfo) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SplitInfo.ProtoReflect.Descriptor instead. -func (*SplitInfo) Descriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{3} -} - -func (x *SplitInfo) GetSplitId() []byte { - if x != nil { - return x.SplitId - } - return nil -} - -func (x *SplitInfo) GetLastPart() *grpc.ObjectID { - if x != nil { - return x.LastPart - } - return nil -} - -func (x *SplitInfo) GetLink() *grpc.ObjectID { - if x != nil { - return x.Link - } - return nil -} - -// Meta information for the erasure-encoded object. -type ECInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Chunk stored on the node. - Chunks []*ECInfo_Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"` -} - -func (x *ECInfo) Reset() { - *x = ECInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ECInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ECInfo) ProtoMessage() {} - -func (x *ECInfo) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ECInfo.ProtoReflect.Descriptor instead. -func (*ECInfo) Descriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{4} -} - -func (x *ECInfo) GetChunks() []*ECInfo_Chunk { - if x != nil { - return x.Chunks - } - return nil -} - -// `Attribute` is a user-defined Key-Value metadata pair attached to an -// object. -// -// Key name must be an object-unique valid UTF-8 string. Value can't be empty. -// Objects with duplicated attribute names or attributes with empty values -// will be considered invalid. -// -// There are some "well-known" attributes starting with `__SYSTEM__` -// (`__NEOFS__` is deprecated) prefix that affect system behaviour: -// -// - [ __SYSTEM__UPLOAD_ID ] \ -// (`__NEOFS__UPLOAD_ID` is deprecated) \ -// Marks smaller parts of a split bigger object -// - [ __SYSTEM__EXPIRATION_EPOCH ] \ -// (`__NEOFS__EXPIRATION_EPOCH` is deprecated) \ -// The epoch after which object with no LOCKs on it becomes unavailable. -// Locked object continues to be available until each of the LOCKs expire. -// - [ __SYSTEM__TICK_EPOCH ] \ -// (`__NEOFS__TICK_EPOCH` is deprecated) \ -// Decimal number that defines what epoch must produce -// object notification with UTF-8 object address in a -// body (`0` value produces notification right after -// object put) -// - [ __SYSTEM__TICK_TOPIC ] \ -// (`__NEOFS__TICK_TOPIC` is deprecated) \ -// UTF-8 string topic ID that is used for object notification -// -// And some well-known attributes used by applications only: -// -// - Name \ -// Human-friendly name -// - FileName \ -// File name to be associated with the object on saving -// - FilePath \ -// Full path to be associated with the object on saving. Should start with a -// '/' and use '/' as a delimiting symbol. Trailing '/' should be -// interpreted as a virtual directory marker. If an object has conflicting -// FilePath and FileName, FilePath should have higher priority, because it -// is used to construct the directory tree. FilePath with trailing '/' and -// non-empty FileName attribute should not be used together. -// - Timestamp \ -// User-defined local time of object creation in Unix Timestamp format -// - Content-Type \ -// MIME Content Type of object's payload -// -// For detailed description of each well-known attribute please see the -// corresponding section in NeoFS Technical Specification. -type Header_Attribute struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // string key to the object attribute - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // string value of the object attribute - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Header_Attribute) Reset() { - *x = Header_Attribute{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Header_Attribute) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Header_Attribute) ProtoMessage() {} - -func (x *Header_Attribute) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Header_Attribute.ProtoReflect.Descriptor instead. -func (*Header_Attribute) Descriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *Header_Attribute) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Header_Attribute) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// Bigger objects can be split into a chain of smaller objects. Information -// about inter-dependencies between spawned objects and how to re-construct -// the original one is in the `Split` headers. Parent and children objects -// must be within the same container. -type Header_Split struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the origin object. Known only to the minor child. - Parent *grpc.ObjectID `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` - // Identifier of the left split neighbor - Previous *grpc.ObjectID `protobuf:"bytes,2,opt,name=previous,proto3" json:"previous,omitempty"` - // `signature` field of the parent object. Used to reconstruct parent. - ParentSignature *grpc.Signature `protobuf:"bytes,3,opt,name=parent_signature,json=parentSignature,proto3" json:"parent_signature,omitempty"` - // `header` field of the parent object. Used to reconstruct parent. - ParentHeader *Header `protobuf:"bytes,4,opt,name=parent_header,json=parentHeader,proto3" json:"parent_header,omitempty"` - // List of identifiers of the objects generated by splitting current one. - Children []*grpc.ObjectID `protobuf:"bytes,5,rep,name=children,proto3" json:"children,omitempty"` - // 16 byte UUIDv4 used to identify the split object hierarchy parts. Must be - // unique inside container. All objects participating in the split must have - // the same `split_id` value. - SplitId []byte `protobuf:"bytes,6,opt,name=split_id,json=splitID,proto3" json:"split_id,omitempty"` -} - -func (x *Header_Split) Reset() { - *x = Header_Split{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Header_Split) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Header_Split) ProtoMessage() {} - -func (x *Header_Split) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Header_Split.ProtoReflect.Descriptor instead. -func (*Header_Split) Descriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{1, 1} -} - -func (x *Header_Split) GetParent() *grpc.ObjectID { - if x != nil { - return x.Parent - } - return nil -} - -func (x *Header_Split) GetPrevious() *grpc.ObjectID { - if x != nil { - return x.Previous - } - return nil -} - -func (x *Header_Split) GetParentSignature() *grpc.Signature { - if x != nil { - return x.ParentSignature - } - return nil -} - -func (x *Header_Split) GetParentHeader() *Header { - if x != nil { - return x.ParentHeader - } - return nil -} - -func (x *Header_Split) GetChildren() []*grpc.ObjectID { - if x != nil { - return x.Children - } - return nil -} - -func (x *Header_Split) GetSplitId() []byte { - if x != nil { - return x.SplitId - } - return nil -} - -// Erasure code can be applied to any object. -// Information about encoded object structure is stored in `EC` header. -// All objects belonging to a single EC group have the same `parent` field. -type Header_EC struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the origin object. Known to all chunks. - Parent *grpc.ObjectID `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` - // Index of this chunk. - Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` - // Total number of chunks in this split. - Total uint32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` - // Total length of a parent header. Used to trim padding zeroes. - HeaderLength uint32 `protobuf:"varint,4,opt,name=header_length,json=headerLength,proto3" json:"header_length,omitempty"` - // Chunk of a parent header. - Header []byte `protobuf:"bytes,5,opt,name=header,proto3" json:"header,omitempty"` - // As the origin object is EC-splitted its identifier is known to all - // chunks as parent. But parent itself can be a part of Split (does not - // relate to EC-split). In this case parent_split_id should be set. - ParentSplitId []byte `protobuf:"bytes,6,opt,name=parent_split_id,json=parentSplitID,proto3" json:"parent_split_id,omitempty"` - // EC-parent's parent ID. parent_split_parent_id is set if EC-parent, - // itself, is a part of Split and if an object ID of its parent is - // presented. The field allows to determine how EC-chunk is placed in Split - // hierarchy. - ParentSplitParentId *grpc.ObjectID `protobuf:"bytes,7,opt,name=parent_split_parent_id,json=parentSplitParentID,proto3" json:"parent_split_parent_id,omitempty"` - // EC parent's attributes. - ParentAttributes []*Header_Attribute `protobuf:"bytes,8,rep,name=parent_attributes,json=parentAttributes,proto3" json:"parent_attributes,omitempty"` -} - -func (x *Header_EC) Reset() { - *x = Header_EC{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Header_EC) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Header_EC) ProtoMessage() {} - -func (x *Header_EC) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Header_EC.ProtoReflect.Descriptor instead. -func (*Header_EC) Descriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{1, 2} -} - -func (x *Header_EC) GetParent() *grpc.ObjectID { - if x != nil { - return x.Parent - } - return nil -} - -func (x *Header_EC) GetIndex() uint32 { - if x != nil { - return x.Index - } - return 0 -} - -func (x *Header_EC) GetTotal() uint32 { - if x != nil { - return x.Total - } - return 0 -} - -func (x *Header_EC) GetHeaderLength() uint32 { - if x != nil { - return x.HeaderLength - } - return 0 -} - -func (x *Header_EC) GetHeader() []byte { - if x != nil { - return x.Header - } - return nil -} - -func (x *Header_EC) GetParentSplitId() []byte { - if x != nil { - return x.ParentSplitId - } - return nil -} - -func (x *Header_EC) GetParentSplitParentId() *grpc.ObjectID { - if x != nil { - return x.ParentSplitParentId - } - return nil -} - -func (x *Header_EC) GetParentAttributes() []*Header_Attribute { - if x != nil { - return x.ParentAttributes - } - return nil -} - -type ECInfo_Chunk struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Object ID of the chunk. - Id *grpc.ObjectID `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Index of the chunk. - Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` - // Total number of chunks in this split. - Total uint32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` -} - -func (x *ECInfo_Chunk) Reset() { - *x = ECInfo_Chunk{} - if protoimpl.UnsafeEnabled { - mi := &file_object_grpc_types_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ECInfo_Chunk) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ECInfo_Chunk) ProtoMessage() {} - -func (x *ECInfo_Chunk) ProtoReflect() protoreflect.Message { - mi := &file_object_grpc_types_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ECInfo_Chunk.ProtoReflect.Descriptor instead. -func (*ECInfo_Chunk) Descriptor() ([]byte, []int) { - return file_object_grpc_types_proto_rawDescGZIP(), []int{4, 0} -} - -func (x *ECInfo_Chunk) GetId() *grpc.ObjectID { - if x != nil { - return x.Id - } - return nil -} - -func (x *ECInfo_Chunk) GetIndex() uint32 { - if x != nil { - return x.Index - } - return 0 -} - -func (x *ECInfo_Chunk) GetTotal() uint32 { - if x != nil { - return x.Total - } - return 0 -} - -var File_object_grpc_types_proto protoreflect.FileDescriptor - -var file_object_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x1a, 0x15, 0x72, 0x65, 0x66, - 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x03, 0x0a, - 0x0b, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, 0x64, 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, - 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x03, 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, 0x3d, 0x0a, 0x0b, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x12, 0x3b, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, - 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x43, 0x0a, - 0x10, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, - 0x6d, 0x52, 0x0f, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x48, 0x61, - 0x73, 0x68, 0x22, 0x92, 0x0b, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 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, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, - 0x12, 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 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, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x12, 0x3b, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x75, 0x6d, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, - 0x3d, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x43, - 0x0a, 0x10, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x75, 0x6d, 0x52, 0x0f, 0x68, 0x6f, 0x6d, 0x6f, 0x6d, 0x6f, 0x72, 0x70, 0x68, 0x69, 0x63, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x42, 0x0a, 0x0a, 0x61, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2e, 0x48, 0x65, 0x61, 0x64, 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, 0x34, 0x0a, - 0x05, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x52, 0x05, 0x73, 0x70, - 0x6c, 0x69, 0x74, 0x12, 0x2b, 0x0a, 0x02, 0x65, 0x63, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x45, 0x43, 0x52, 0x02, 0x65, 0x63, - 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, 0x1a, 0xc5, 0x02, 0x0a, 0x05, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x12, - 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, - 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x70, - 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, - 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x3d, 0x0a, - 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x08, - 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x05, 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, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, - 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x1a, 0xe7, 0x02, - 0x0a, 0x02, 0x45, 0x43, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x26, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x12, 0x4d, 0x0a, 0x16, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, - 0x44, 0x52, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x4f, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x22, 0xc4, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, - 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x8b, - 0x01, 0x0a, 0x09, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, - 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, - 0x70, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x49, 0x44, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x12, 0x2c, - 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x9f, 0x01, 0x0a, - 0x06, 0x45, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x43, 0x49, 0x6e, 0x66, - 0x6f, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x1a, - 0x5d, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x28, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2a, 0x32, - 0x0a, 0x0a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, - 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x4f, 0x4d, - 0x42, 0x53, 0x54, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, 0x43, 0x4b, - 0x10, 0x03, 0x2a, 0x73, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, - 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x14, 0x0a, - 0x10, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, - 0x4c, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, - 0x4e, 0x54, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x50, - 0x52, 0x45, 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, - 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, - 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xaa, 0x02, 0x1a, - 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x41, 0x50, 0x49, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_object_grpc_types_proto_rawDescOnce sync.Once - file_object_grpc_types_proto_rawDescData = file_object_grpc_types_proto_rawDesc -) - -func file_object_grpc_types_proto_rawDescGZIP() []byte { - file_object_grpc_types_proto_rawDescOnce.Do(func() { - file_object_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_object_grpc_types_proto_rawDescData) - }) - return file_object_grpc_types_proto_rawDescData -} - -var file_object_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_object_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_object_grpc_types_proto_goTypes = []interface{}{ - (ObjectType)(0), // 0: neo.fs.v2.object.ObjectType - (MatchType)(0), // 1: neo.fs.v2.object.MatchType - (*ShortHeader)(nil), // 2: neo.fs.v2.object.ShortHeader - (*Header)(nil), // 3: neo.fs.v2.object.Header - (*Object)(nil), // 4: neo.fs.v2.object.Object - (*SplitInfo)(nil), // 5: neo.fs.v2.object.SplitInfo - (*ECInfo)(nil), // 6: neo.fs.v2.object.ECInfo - (*Header_Attribute)(nil), // 7: neo.fs.v2.object.Header.Attribute - (*Header_Split)(nil), // 8: neo.fs.v2.object.Header.Split - (*Header_EC)(nil), // 9: neo.fs.v2.object.Header.EC - (*ECInfo_Chunk)(nil), // 10: neo.fs.v2.object.ECInfo.Chunk - (*grpc.Version)(nil), // 11: neo.fs.v2.refs.Version - (*grpc.OwnerID)(nil), // 12: neo.fs.v2.refs.OwnerID - (*grpc.Checksum)(nil), // 13: neo.fs.v2.refs.Checksum - (*grpc.ContainerID)(nil), // 14: neo.fs.v2.refs.ContainerID - (*grpc1.SessionToken)(nil), // 15: neo.fs.v2.session.SessionToken - (*grpc.ObjectID)(nil), // 16: neo.fs.v2.refs.ObjectID - (*grpc.Signature)(nil), // 17: neo.fs.v2.refs.Signature -} -var file_object_grpc_types_proto_depIdxs = []int32{ - 11, // 0: neo.fs.v2.object.ShortHeader.version:type_name -> neo.fs.v2.refs.Version - 12, // 1: neo.fs.v2.object.ShortHeader.owner_id:type_name -> neo.fs.v2.refs.OwnerID - 0, // 2: neo.fs.v2.object.ShortHeader.object_type:type_name -> neo.fs.v2.object.ObjectType - 13, // 3: neo.fs.v2.object.ShortHeader.payload_hash:type_name -> neo.fs.v2.refs.Checksum - 13, // 4: neo.fs.v2.object.ShortHeader.homomorphic_hash:type_name -> neo.fs.v2.refs.Checksum - 11, // 5: neo.fs.v2.object.Header.version:type_name -> neo.fs.v2.refs.Version - 14, // 6: neo.fs.v2.object.Header.container_id:type_name -> neo.fs.v2.refs.ContainerID - 12, // 7: neo.fs.v2.object.Header.owner_id:type_name -> neo.fs.v2.refs.OwnerID - 13, // 8: neo.fs.v2.object.Header.payload_hash:type_name -> neo.fs.v2.refs.Checksum - 0, // 9: neo.fs.v2.object.Header.object_type:type_name -> neo.fs.v2.object.ObjectType - 13, // 10: neo.fs.v2.object.Header.homomorphic_hash:type_name -> neo.fs.v2.refs.Checksum - 15, // 11: neo.fs.v2.object.Header.session_token:type_name -> neo.fs.v2.session.SessionToken - 7, // 12: neo.fs.v2.object.Header.attributes:type_name -> neo.fs.v2.object.Header.Attribute - 8, // 13: neo.fs.v2.object.Header.split:type_name -> neo.fs.v2.object.Header.Split - 9, // 14: neo.fs.v2.object.Header.ec:type_name -> neo.fs.v2.object.Header.EC - 16, // 15: neo.fs.v2.object.Object.object_id:type_name -> neo.fs.v2.refs.ObjectID - 17, // 16: neo.fs.v2.object.Object.signature:type_name -> neo.fs.v2.refs.Signature - 3, // 17: neo.fs.v2.object.Object.header:type_name -> neo.fs.v2.object.Header - 16, // 18: neo.fs.v2.object.SplitInfo.last_part:type_name -> neo.fs.v2.refs.ObjectID - 16, // 19: neo.fs.v2.object.SplitInfo.link:type_name -> neo.fs.v2.refs.ObjectID - 10, // 20: neo.fs.v2.object.ECInfo.chunks:type_name -> neo.fs.v2.object.ECInfo.Chunk - 16, // 21: neo.fs.v2.object.Header.Split.parent:type_name -> neo.fs.v2.refs.ObjectID - 16, // 22: neo.fs.v2.object.Header.Split.previous:type_name -> neo.fs.v2.refs.ObjectID - 17, // 23: neo.fs.v2.object.Header.Split.parent_signature:type_name -> neo.fs.v2.refs.Signature - 3, // 24: neo.fs.v2.object.Header.Split.parent_header:type_name -> neo.fs.v2.object.Header - 16, // 25: neo.fs.v2.object.Header.Split.children:type_name -> neo.fs.v2.refs.ObjectID - 16, // 26: neo.fs.v2.object.Header.EC.parent:type_name -> neo.fs.v2.refs.ObjectID - 16, // 27: neo.fs.v2.object.Header.EC.parent_split_parent_id:type_name -> neo.fs.v2.refs.ObjectID - 7, // 28: neo.fs.v2.object.Header.EC.parent_attributes:type_name -> neo.fs.v2.object.Header.Attribute - 16, // 29: neo.fs.v2.object.ECInfo.Chunk.id:type_name -> neo.fs.v2.refs.ObjectID - 30, // [30:30] is the sub-list for method output_type - 30, // [30:30] is the sub-list for method input_type - 30, // [30:30] is the sub-list for extension type_name - 30, // [30:30] is the sub-list for extension extendee - 0, // [0:30] is the sub-list for field type_name -} - -func init() { file_object_grpc_types_proto_init() } -func file_object_grpc_types_proto_init() { - if File_object_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_object_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShortHeader); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Header); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SplitInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ECInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Header_Attribute); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Header_Split); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Header_EC); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_object_grpc_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ECInfo_Chunk); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_object_grpc_types_proto_rawDesc, - NumEnums: 2, - NumMessages: 9, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_object_grpc_types_proto_goTypes, - DependencyIndexes: file_object_grpc_types_proto_depIdxs, - EnumInfos: file_object_grpc_types_proto_enumTypes, - MessageInfos: file_object_grpc_types_proto_msgTypes, - }.Build() - File_object_grpc_types_proto = out.File - file_object_grpc_types_proto_rawDesc = nil - file_object_grpc_types_proto_goTypes = nil - file_object_grpc_types_proto_depIdxs = nil -} diff --git a/object/grpc/types_frostfs.pb.go b/object/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..492ee48 --- /dev/null +++ b/object/grpc/types_frostfs.pb.go @@ -0,0 +1,2621 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package object + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type ObjectType int32 + +const ( + ObjectType_REGULAR ObjectType = 0 + ObjectType_TOMBSTONE ObjectType = 1 + ObjectType_LOCK ObjectType = 3 +) + +var ( + ObjectType_name = map[int32]string{ + 0: "REGULAR", + 1: "TOMBSTONE", + 3: "LOCK", + } + ObjectType_value = map[string]int32{ + "REGULAR": 0, + "TOMBSTONE": 1, + "LOCK": 3, + } +) + +func (x ObjectType) String() string { + if v, ok := ObjectType_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *ObjectType) FromString(s string) bool { + if v, ok := ObjectType_value[s]; ok { + *x = ObjectType(v) + return true + } + return false +} + +type MatchType int32 + +const ( + MatchType_MATCH_TYPE_UNSPECIFIED MatchType = 0 + MatchType_STRING_EQUAL MatchType = 1 + MatchType_STRING_NOT_EQUAL MatchType = 2 + MatchType_NOT_PRESENT MatchType = 3 + MatchType_COMMON_PREFIX MatchType = 4 +) + +var ( + MatchType_name = map[int32]string{ + 0: "MATCH_TYPE_UNSPECIFIED", + 1: "STRING_EQUAL", + 2: "STRING_NOT_EQUAL", + 3: "NOT_PRESENT", + 4: "COMMON_PREFIX", + } + MatchType_value = map[string]int32{ + "MATCH_TYPE_UNSPECIFIED": 0, + "STRING_EQUAL": 1, + "STRING_NOT_EQUAL": 2, + "NOT_PRESENT": 3, + "COMMON_PREFIX": 4, + } +) + +func (x MatchType) String() string { + if v, ok := MatchType_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *MatchType) FromString(s string) bool { + if v, ok := MatchType_value[s]; ok { + *x = MatchType(v) + return true + } + return false +} + +type ShortHeader struct { + Version *grpc.Version `json:"version"` + CreationEpoch uint64 `json:"creationEpoch"` + OwnerId *grpc.OwnerID `json:"ownerID"` + ObjectType ObjectType `json:"objectType"` + PayloadLength uint64 `json:"payloadLength"` + PayloadHash *grpc.Checksum `json:"payloadHash"` + HomomorphicHash *grpc.Checksum `json:"homomorphicHash"` +} + +var ( + _ encoding.ProtoMarshaler = (*ShortHeader)(nil) + _ encoding.ProtoUnmarshaler = (*ShortHeader)(nil) + _ json.Marshaler = (*ShortHeader)(nil) + _ json.Unmarshaler = (*ShortHeader)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ShortHeader) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Version) + size += proto.UInt64Size(2, x.CreationEpoch) + size += proto.NestedStructureSize(3, x.OwnerId) + size += proto.EnumSize(4, int32(x.ObjectType)) + size += proto.UInt64Size(5, x.PayloadLength) + size += proto.NestedStructureSize(6, x.PayloadHash) + size += proto.NestedStructureSize(7, x.HomomorphicHash) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ShortHeader) 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 *ShortHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Version != nil && x.Version.StableSize() != 0 { + x.Version.EmitProtobuf(mm.AppendMessage(1)) + } + if x.CreationEpoch != 0 { + mm.AppendUint64(2, x.CreationEpoch) + } + if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + x.OwnerId.EmitProtobuf(mm.AppendMessage(3)) + } + if int32(x.ObjectType) != 0 { + mm.AppendInt32(4, int32(x.ObjectType)) + } + if x.PayloadLength != 0 { + mm.AppendUint64(5, x.PayloadLength) + } + if x.PayloadHash != nil && x.PayloadHash.StableSize() != 0 { + x.PayloadHash.EmitProtobuf(mm.AppendMessage(6)) + } + if x.HomomorphicHash != nil && x.HomomorphicHash.StableSize() != 0 { + x.HomomorphicHash.EmitProtobuf(mm.AppendMessage(7)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ShortHeader) 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", "ShortHeader") + } + 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: // CreationEpoch + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "CreationEpoch") + } + x.CreationEpoch = data + case 3: // 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 4: // ObjectType + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ObjectType") + } + x.ObjectType = ObjectType(data) + case 5: // PayloadLength + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "PayloadLength") + } + x.PayloadLength = data + case 6: // PayloadHash + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "PayloadHash") + } + x.PayloadHash = new(grpc.Checksum) + if err := x.PayloadHash.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 7: // HomomorphicHash + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "HomomorphicHash") + } + x.HomomorphicHash = new(grpc.Checksum) + if err := x.HomomorphicHash.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *ShortHeader) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} +func (x *ShortHeader) SetVersion(v *grpc.Version) { + x.Version = v +} +func (x *ShortHeader) GetCreationEpoch() uint64 { + if x != nil { + return x.CreationEpoch + } + return 0 +} +func (x *ShortHeader) SetCreationEpoch(v uint64) { + x.CreationEpoch = v +} +func (x *ShortHeader) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *ShortHeader) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} +func (x *ShortHeader) GetObjectType() ObjectType { + if x != nil { + return x.ObjectType + } + return 0 +} +func (x *ShortHeader) SetObjectType(v ObjectType) { + x.ObjectType = v +} +func (x *ShortHeader) GetPayloadLength() uint64 { + if x != nil { + return x.PayloadLength + } + return 0 +} +func (x *ShortHeader) SetPayloadLength(v uint64) { + x.PayloadLength = v +} +func (x *ShortHeader) GetPayloadHash() *grpc.Checksum { + if x != nil { + return x.PayloadHash + } + return nil +} +func (x *ShortHeader) SetPayloadHash(v *grpc.Checksum) { + x.PayloadHash = v +} +func (x *ShortHeader) GetHomomorphicHash() *grpc.Checksum { + if x != nil { + return x.HomomorphicHash + } + return nil +} +func (x *ShortHeader) SetHomomorphicHash(v *grpc.Checksum) { + x.HomomorphicHash = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ShortHeader) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"version\":" + out.RawString(prefix[1:]) + x.Version.MarshalEasyJSON(out) + } + { + const prefix string = ",\"creationEpoch\":" + out.RawString(prefix) + out.Uint64(x.CreationEpoch) + } + { + const prefix string = ",\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"objectType\":" + out.RawString(prefix) + out.Int32(int32(x.ObjectType)) + } + { + const prefix string = ",\"payloadLength\":" + out.RawString(prefix) + out.Uint64(x.PayloadLength) + } + { + const prefix string = ",\"payloadHash\":" + out.RawString(prefix) + x.PayloadHash.MarshalEasyJSON(out) + } + { + const prefix string = ",\"homomorphicHash\":" + out.RawString(prefix) + x.HomomorphicHash.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ShortHeader) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ShortHeader) 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 "creationEpoch": + { + var f uint64 + f = in.Uint64() + x.CreationEpoch = f + } + case "ownerID": + { + var f *grpc.OwnerID + f = new(grpc.OwnerID) + f.UnmarshalEasyJSON(in) + x.OwnerId = f + } + case "objectType": + { + var f ObjectType + var parsedValue ObjectType + switch v := in.Interface().(type) { + case string: + if vv, ok := ObjectType_value[v]; ok { + parsedValue = ObjectType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = ObjectType(vv) + case float64: + parsedValue = ObjectType(v) + } + f = parsedValue + x.ObjectType = f + } + case "payloadLength": + { + var f uint64 + f = in.Uint64() + x.PayloadLength = f + } + case "payloadHash": + { + var f *grpc.Checksum + f = new(grpc.Checksum) + f.UnmarshalEasyJSON(in) + x.PayloadHash = f + } + case "homomorphicHash": + { + var f *grpc.Checksum + f = new(grpc.Checksum) + f.UnmarshalEasyJSON(in) + x.HomomorphicHash = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Header_Attribute struct { + Key string `json:"key"` + Value string `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*Header_Attribute)(nil) + _ encoding.ProtoUnmarshaler = (*Header_Attribute)(nil) + _ json.Marshaler = (*Header_Attribute)(nil) + _ json.Unmarshaler = (*Header_Attribute)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Header_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 *Header_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 *Header_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 *Header_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", "Header_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 *Header_Attribute) GetKey() string { + if x != nil { + return x.Key + } + return "" +} +func (x *Header_Attribute) SetKey(v string) { + x.Key = v +} +func (x *Header_Attribute) GetValue() string { + if x != nil { + return x.Value + } + return "" +} +func (x *Header_Attribute) SetValue(v string) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Header_Attribute) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Header_Attribute) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"key\":" + out.RawString(prefix[1:]) + out.String(x.Key) + } + { + const prefix string = ",\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Header_Attribute) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Header_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 Header_Split struct { + Parent *grpc.ObjectID `json:"parent"` + Previous *grpc.ObjectID `json:"previous"` + ParentSignature *grpc.Signature `json:"parentSignature"` + ParentHeader *Header `json:"parentHeader"` + Children []*grpc.ObjectID `json:"children"` + SplitId []byte `json:"splitID"` +} + +var ( + _ encoding.ProtoMarshaler = (*Header_Split)(nil) + _ encoding.ProtoUnmarshaler = (*Header_Split)(nil) + _ json.Marshaler = (*Header_Split)(nil) + _ json.Unmarshaler = (*Header_Split)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Header_Split) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Parent) + size += proto.NestedStructureSize(2, x.Previous) + size += proto.NestedStructureSize(3, x.ParentSignature) + size += proto.NestedStructureSize(4, x.ParentHeader) + for i := range x.Children { + size += proto.NestedStructureSize(5, x.Children[i]) + } + size += proto.BytesSize(6, x.SplitId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Header_Split) 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 *Header_Split) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Parent != nil && x.Parent.StableSize() != 0 { + x.Parent.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Previous != nil && x.Previous.StableSize() != 0 { + x.Previous.EmitProtobuf(mm.AppendMessage(2)) + } + if x.ParentSignature != nil && x.ParentSignature.StableSize() != 0 { + x.ParentSignature.EmitProtobuf(mm.AppendMessage(3)) + } + if x.ParentHeader != nil && x.ParentHeader.StableSize() != 0 { + x.ParentHeader.EmitProtobuf(mm.AppendMessage(4)) + } + for i := range x.Children { + if x.Children[i] != nil && x.Children[i].StableSize() != 0 { + x.Children[i].EmitProtobuf(mm.AppendMessage(5)) + } + } + if len(x.SplitId) != 0 { + mm.AppendBytes(6, x.SplitId) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Header_Split) 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", "Header_Split") + } + switch fc.FieldNum { + case 1: // Parent + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Parent") + } + x.Parent = new(grpc.ObjectID) + if err := x.Parent.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Previous + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Previous") + } + x.Previous = new(grpc.ObjectID) + if err := x.Previous.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // ParentSignature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ParentSignature") + } + x.ParentSignature = new(grpc.Signature) + if err := x.ParentSignature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 4: // ParentHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ParentHeader") + } + x.ParentHeader = new(Header) + if err := x.ParentHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 5: // Children + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Children") + } + x.Children = append(x.Children, new(grpc.ObjectID)) + ff := x.Children[len(x.Children)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 6: // SplitId + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SplitId") + } + x.SplitId = data + } + } + return nil +} +func (x *Header_Split) GetParent() *grpc.ObjectID { + if x != nil { + return x.Parent + } + return nil +} +func (x *Header_Split) SetParent(v *grpc.ObjectID) { + x.Parent = v +} +func (x *Header_Split) GetPrevious() *grpc.ObjectID { + if x != nil { + return x.Previous + } + return nil +} +func (x *Header_Split) SetPrevious(v *grpc.ObjectID) { + x.Previous = v +} +func (x *Header_Split) GetParentSignature() *grpc.Signature { + if x != nil { + return x.ParentSignature + } + return nil +} +func (x *Header_Split) SetParentSignature(v *grpc.Signature) { + x.ParentSignature = v +} +func (x *Header_Split) GetParentHeader() *Header { + if x != nil { + return x.ParentHeader + } + return nil +} +func (x *Header_Split) SetParentHeader(v *Header) { + x.ParentHeader = v +} +func (x *Header_Split) GetChildren() []*grpc.ObjectID { + if x != nil { + return x.Children + } + return nil +} +func (x *Header_Split) SetChildren(v []*grpc.ObjectID) { + x.Children = v +} +func (x *Header_Split) GetSplitId() []byte { + if x != nil { + return x.SplitId + } + return nil +} +func (x *Header_Split) SetSplitId(v []byte) { + x.SplitId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Header_Split) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"parent\":" + out.RawString(prefix[1:]) + x.Parent.MarshalEasyJSON(out) + } + { + const prefix string = ",\"previous\":" + out.RawString(prefix) + x.Previous.MarshalEasyJSON(out) + } + { + const prefix string = ",\"parentSignature\":" + out.RawString(prefix) + x.ParentSignature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"parentHeader\":" + out.RawString(prefix) + x.ParentHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"children\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Children { + if i != 0 { + out.RawByte(',') + } + x.Children[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"splitID\":" + out.RawString(prefix) + out.Base64Bytes(x.SplitId) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Header_Split) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Header_Split) 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 "parent": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.Parent = f + } + case "previous": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.Previous = f + } + case "parentSignature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.ParentSignature = f + } + case "parentHeader": + { + var f *Header + f = new(Header) + f.UnmarshalEasyJSON(in) + x.ParentHeader = f + } + case "children": + { + var f *grpc.ObjectID + var list []*grpc.ObjectID + in.Delim('[') + for !in.IsDelim(']') { + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Children = list + in.Delim(']') + } + case "splitID": + { + var f []byte + f = in.Bytes() + x.SplitId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Header_EC struct { + Parent *grpc.ObjectID `json:"parent"` + Index uint32 `json:"index"` + Total uint32 `json:"total"` + HeaderLength uint32 `json:"headerLength"` + Header []byte `json:"header"` + ParentSplitId []byte `json:"parentSplitID"` + ParentSplitParentId *grpc.ObjectID `json:"parentSplitParentID"` + ParentAttributes []*Header_Attribute `json:"parentAttributes"` +} + +var ( + _ encoding.ProtoMarshaler = (*Header_EC)(nil) + _ encoding.ProtoUnmarshaler = (*Header_EC)(nil) + _ json.Marshaler = (*Header_EC)(nil) + _ json.Unmarshaler = (*Header_EC)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Header_EC) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Parent) + size += proto.UInt32Size(2, x.Index) + size += proto.UInt32Size(3, x.Total) + size += proto.UInt32Size(4, x.HeaderLength) + size += proto.BytesSize(5, x.Header) + size += proto.BytesSize(6, x.ParentSplitId) + size += proto.NestedStructureSize(7, x.ParentSplitParentId) + for i := range x.ParentAttributes { + size += proto.NestedStructureSize(8, x.ParentAttributes[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Header_EC) 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 *Header_EC) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Parent != nil && x.Parent.StableSize() != 0 { + x.Parent.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Index != 0 { + mm.AppendUint32(2, x.Index) + } + if x.Total != 0 { + mm.AppendUint32(3, x.Total) + } + if x.HeaderLength != 0 { + mm.AppendUint32(4, x.HeaderLength) + } + if len(x.Header) != 0 { + mm.AppendBytes(5, x.Header) + } + if len(x.ParentSplitId) != 0 { + mm.AppendBytes(6, x.ParentSplitId) + } + if x.ParentSplitParentId != nil && x.ParentSplitParentId.StableSize() != 0 { + x.ParentSplitParentId.EmitProtobuf(mm.AppendMessage(7)) + } + for i := range x.ParentAttributes { + if x.ParentAttributes[i] != nil && x.ParentAttributes[i].StableSize() != 0 { + x.ParentAttributes[i].EmitProtobuf(mm.AppendMessage(8)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Header_EC) 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", "Header_EC") + } + switch fc.FieldNum { + case 1: // Parent + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Parent") + } + x.Parent = new(grpc.ObjectID) + if err := x.Parent.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Index + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Index") + } + x.Index = data + case 3: // Total + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Total") + } + x.Total = data + case 4: // HeaderLength + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "HeaderLength") + } + x.HeaderLength = data + case 5: // Header + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Header") + } + x.Header = data + case 6: // ParentSplitId + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ParentSplitId") + } + x.ParentSplitId = data + case 7: // ParentSplitParentId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ParentSplitParentId") + } + x.ParentSplitParentId = new(grpc.ObjectID) + if err := x.ParentSplitParentId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 8: // ParentAttributes + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ParentAttributes") + } + x.ParentAttributes = append(x.ParentAttributes, new(Header_Attribute)) + ff := x.ParentAttributes[len(x.ParentAttributes)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Header_EC) GetParent() *grpc.ObjectID { + if x != nil { + return x.Parent + } + return nil +} +func (x *Header_EC) SetParent(v *grpc.ObjectID) { + x.Parent = v +} +func (x *Header_EC) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} +func (x *Header_EC) SetIndex(v uint32) { + x.Index = v +} +func (x *Header_EC) GetTotal() uint32 { + if x != nil { + return x.Total + } + return 0 +} +func (x *Header_EC) SetTotal(v uint32) { + x.Total = v +} +func (x *Header_EC) GetHeaderLength() uint32 { + if x != nil { + return x.HeaderLength + } + return 0 +} +func (x *Header_EC) SetHeaderLength(v uint32) { + x.HeaderLength = v +} +func (x *Header_EC) GetHeader() []byte { + if x != nil { + return x.Header + } + return nil +} +func (x *Header_EC) SetHeader(v []byte) { + x.Header = v +} +func (x *Header_EC) GetParentSplitId() []byte { + if x != nil { + return x.ParentSplitId + } + return nil +} +func (x *Header_EC) SetParentSplitId(v []byte) { + x.ParentSplitId = v +} +func (x *Header_EC) GetParentSplitParentId() *grpc.ObjectID { + if x != nil { + return x.ParentSplitParentId + } + return nil +} +func (x *Header_EC) SetParentSplitParentId(v *grpc.ObjectID) { + x.ParentSplitParentId = v +} +func (x *Header_EC) GetParentAttributes() []*Header_Attribute { + if x != nil { + return x.ParentAttributes + } + return nil +} +func (x *Header_EC) SetParentAttributes(v []*Header_Attribute) { + x.ParentAttributes = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Header_EC) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"parent\":" + out.RawString(prefix[1:]) + x.Parent.MarshalEasyJSON(out) + } + { + const prefix string = ",\"index\":" + out.RawString(prefix) + out.Uint32(x.Index) + } + { + const prefix string = ",\"total\":" + out.RawString(prefix) + out.Uint32(x.Total) + } + { + const prefix string = ",\"headerLength\":" + out.RawString(prefix) + out.Uint32(x.HeaderLength) + } + { + const prefix string = ",\"header\":" + out.RawString(prefix) + out.Base64Bytes(x.Header) + } + { + const prefix string = ",\"parentSplitID\":" + out.RawString(prefix) + out.Base64Bytes(x.ParentSplitId) + } + { + const prefix string = ",\"parentSplitParentID\":" + out.RawString(prefix) + x.ParentSplitParentId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"parentAttributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.ParentAttributes { + if i != 0 { + out.RawByte(',') + } + x.ParentAttributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Header_EC) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Header_EC) 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 "parent": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.Parent = f + } + case "index": + { + var f uint32 + f = in.Uint32() + x.Index = f + } + case "total": + { + var f uint32 + f = in.Uint32() + x.Total = f + } + case "headerLength": + { + var f uint32 + f = in.Uint32() + x.HeaderLength = f + } + case "header": + { + var f []byte + f = in.Bytes() + x.Header = f + } + case "parentSplitID": + { + var f []byte + f = in.Bytes() + x.ParentSplitId = f + } + case "parentSplitParentID": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.ParentSplitParentId = f + } + case "parentAttributes": + { + var f *Header_Attribute + var list []*Header_Attribute + in.Delim('[') + for !in.IsDelim(']') { + f = new(Header_Attribute) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.ParentAttributes = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Header struct { + Version *grpc.Version `json:"version"` + ContainerId *grpc.ContainerID `json:"containerID"` + OwnerId *grpc.OwnerID `json:"ownerID"` + CreationEpoch uint64 `json:"creationEpoch"` + PayloadLength uint64 `json:"payloadLength"` + PayloadHash *grpc.Checksum `json:"payloadHash"` + ObjectType ObjectType `json:"objectType"` + HomomorphicHash *grpc.Checksum `json:"homomorphicHash"` + SessionToken *grpc1.SessionToken `json:"sessionToken"` + Attributes []*Header_Attribute `json:"attributes"` + Split *Header_Split `json:"split"` + Ec *Header_EC `json:"ec"` +} + +var ( + _ encoding.ProtoMarshaler = (*Header)(nil) + _ encoding.ProtoUnmarshaler = (*Header)(nil) + _ json.Marshaler = (*Header)(nil) + _ json.Unmarshaler = (*Header)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Header) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Version) + size += proto.NestedStructureSize(2, x.ContainerId) + size += proto.NestedStructureSize(3, x.OwnerId) + size += proto.UInt64Size(4, x.CreationEpoch) + size += proto.UInt64Size(5, x.PayloadLength) + size += proto.NestedStructureSize(6, x.PayloadHash) + size += proto.EnumSize(7, int32(x.ObjectType)) + size += proto.NestedStructureSize(8, x.HomomorphicHash) + size += proto.NestedStructureSize(9, x.SessionToken) + for i := range x.Attributes { + size += proto.NestedStructureSize(10, x.Attributes[i]) + } + size += proto.NestedStructureSize(11, x.Split) + size += proto.NestedStructureSize(12, x.Ec) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Header) 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 *Header) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Version != nil && x.Version.StableSize() != 0 { + x.Version.EmitProtobuf(mm.AppendMessage(1)) + } + if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + x.ContainerId.EmitProtobuf(mm.AppendMessage(2)) + } + if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + x.OwnerId.EmitProtobuf(mm.AppendMessage(3)) + } + if x.CreationEpoch != 0 { + mm.AppendUint64(4, x.CreationEpoch) + } + if x.PayloadLength != 0 { + mm.AppendUint64(5, x.PayloadLength) + } + if x.PayloadHash != nil && x.PayloadHash.StableSize() != 0 { + x.PayloadHash.EmitProtobuf(mm.AppendMessage(6)) + } + if int32(x.ObjectType) != 0 { + mm.AppendInt32(7, int32(x.ObjectType)) + } + if x.HomomorphicHash != nil && x.HomomorphicHash.StableSize() != 0 { + x.HomomorphicHash.EmitProtobuf(mm.AppendMessage(8)) + } + if x.SessionToken != nil && x.SessionToken.StableSize() != 0 { + x.SessionToken.EmitProtobuf(mm.AppendMessage(9)) + } + for i := range x.Attributes { + if x.Attributes[i] != nil && x.Attributes[i].StableSize() != 0 { + x.Attributes[i].EmitProtobuf(mm.AppendMessage(10)) + } + } + if x.Split != nil && x.Split.StableSize() != 0 { + x.Split.EmitProtobuf(mm.AppendMessage(11)) + } + if x.Ec != nil && x.Ec.StableSize() != 0 { + x.Ec.EmitProtobuf(mm.AppendMessage(12)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Header) 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", "Header") + } + 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: // ContainerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerId") + } + x.ContainerId = new(grpc.ContainerID) + if err := x.ContainerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // 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 4: // CreationEpoch + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "CreationEpoch") + } + x.CreationEpoch = data + case 5: // PayloadLength + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "PayloadLength") + } + x.PayloadLength = data + case 6: // PayloadHash + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "PayloadHash") + } + x.PayloadHash = new(grpc.Checksum) + if err := x.PayloadHash.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 7: // ObjectType + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ObjectType") + } + x.ObjectType = ObjectType(data) + case 8: // HomomorphicHash + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "HomomorphicHash") + } + x.HomomorphicHash = new(grpc.Checksum) + if err := x.HomomorphicHash.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 9: // SessionToken + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SessionToken") + } + x.SessionToken = new(grpc1.SessionToken) + if err := x.SessionToken.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 10: // Attributes + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Attributes") + } + x.Attributes = append(x.Attributes, new(Header_Attribute)) + ff := x.Attributes[len(x.Attributes)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 11: // Split + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Split") + } + x.Split = new(Header_Split) + if err := x.Split.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 12: // Ec + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Ec") + } + x.Ec = new(Header_EC) + if err := x.Ec.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Header) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} +func (x *Header) SetVersion(v *grpc.Version) { + x.Version = v +} +func (x *Header) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} +func (x *Header) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} +func (x *Header) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *Header) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} +func (x *Header) GetCreationEpoch() uint64 { + if x != nil { + return x.CreationEpoch + } + return 0 +} +func (x *Header) SetCreationEpoch(v uint64) { + x.CreationEpoch = v +} +func (x *Header) GetPayloadLength() uint64 { + if x != nil { + return x.PayloadLength + } + return 0 +} +func (x *Header) SetPayloadLength(v uint64) { + x.PayloadLength = v +} +func (x *Header) GetPayloadHash() *grpc.Checksum { + if x != nil { + return x.PayloadHash + } + return nil +} +func (x *Header) SetPayloadHash(v *grpc.Checksum) { + x.PayloadHash = v +} +func (x *Header) GetObjectType() ObjectType { + if x != nil { + return x.ObjectType + } + return 0 +} +func (x *Header) SetObjectType(v ObjectType) { + x.ObjectType = v +} +func (x *Header) GetHomomorphicHash() *grpc.Checksum { + if x != nil { + return x.HomomorphicHash + } + return nil +} +func (x *Header) SetHomomorphicHash(v *grpc.Checksum) { + x.HomomorphicHash = v +} +func (x *Header) GetSessionToken() *grpc1.SessionToken { + if x != nil { + return x.SessionToken + } + return nil +} +func (x *Header) SetSessionToken(v *grpc1.SessionToken) { + x.SessionToken = v +} +func (x *Header) GetAttributes() []*Header_Attribute { + if x != nil { + return x.Attributes + } + return nil +} +func (x *Header) SetAttributes(v []*Header_Attribute) { + x.Attributes = v +} +func (x *Header) GetSplit() *Header_Split { + if x != nil { + return x.Split + } + return nil +} +func (x *Header) SetSplit(v *Header_Split) { + x.Split = v +} +func (x *Header) GetEc() *Header_EC { + if x != nil { + return x.Ec + } + return nil +} +func (x *Header) SetEc(v *Header_EC) { + x.Ec = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Header) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Header) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"version\":" + out.RawString(prefix[1:]) + x.Version.MarshalEasyJSON(out) + } + { + const prefix string = ",\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"creationEpoch\":" + out.RawString(prefix) + out.Uint64(x.CreationEpoch) + } + { + const prefix string = ",\"payloadLength\":" + out.RawString(prefix) + out.Uint64(x.PayloadLength) + } + { + const prefix string = ",\"payloadHash\":" + out.RawString(prefix) + x.PayloadHash.MarshalEasyJSON(out) + } + { + const prefix string = ",\"objectType\":" + out.RawString(prefix) + out.Int32(int32(x.ObjectType)) + } + { + const prefix string = ",\"homomorphicHash\":" + out.RawString(prefix) + x.HomomorphicHash.MarshalEasyJSON(out) + } + { + const prefix string = ",\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) + } + { + const prefix string = ",\"attributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Attributes { + if i != 0 { + out.RawByte(',') + } + x.Attributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"split\":" + out.RawString(prefix) + x.Split.MarshalEasyJSON(out) + } + { + const prefix string = ",\"ec\":" + out.RawString(prefix) + x.Ec.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Header) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Header) 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 "containerID": + { + var f *grpc.ContainerID + f = new(grpc.ContainerID) + f.UnmarshalEasyJSON(in) + x.ContainerId = f + } + case "ownerID": + { + var f *grpc.OwnerID + f = new(grpc.OwnerID) + f.UnmarshalEasyJSON(in) + x.OwnerId = f + } + case "creationEpoch": + { + var f uint64 + f = in.Uint64() + x.CreationEpoch = f + } + case "payloadLength": + { + var f uint64 + f = in.Uint64() + x.PayloadLength = f + } + case "payloadHash": + { + var f *grpc.Checksum + f = new(grpc.Checksum) + f.UnmarshalEasyJSON(in) + x.PayloadHash = f + } + case "objectType": + { + var f ObjectType + var parsedValue ObjectType + switch v := in.Interface().(type) { + case string: + if vv, ok := ObjectType_value[v]; ok { + parsedValue = ObjectType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = ObjectType(vv) + case float64: + parsedValue = ObjectType(v) + } + f = parsedValue + x.ObjectType = f + } + case "homomorphicHash": + { + var f *grpc.Checksum + f = new(grpc.Checksum) + f.UnmarshalEasyJSON(in) + x.HomomorphicHash = f + } + case "sessionToken": + { + var f *grpc1.SessionToken + f = new(grpc1.SessionToken) + f.UnmarshalEasyJSON(in) + x.SessionToken = f + } + case "attributes": + { + var f *Header_Attribute + var list []*Header_Attribute + in.Delim('[') + for !in.IsDelim(']') { + f = new(Header_Attribute) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Attributes = list + in.Delim(']') + } + case "split": + { + var f *Header_Split + f = new(Header_Split) + f.UnmarshalEasyJSON(in) + x.Split = f + } + case "ec": + { + var f *Header_EC + f = new(Header_EC) + f.UnmarshalEasyJSON(in) + x.Ec = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Object struct { + ObjectId *grpc.ObjectID `json:"objectID"` + Signature *grpc.Signature `json:"signature"` + Header *Header `json:"header"` + Payload []byte `json:"payload"` +} + +var ( + _ encoding.ProtoMarshaler = (*Object)(nil) + _ encoding.ProtoUnmarshaler = (*Object)(nil) + _ json.Marshaler = (*Object)(nil) + _ json.Unmarshaler = (*Object)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Object) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.ObjectId) + size += proto.NestedStructureSize(2, x.Signature) + size += proto.NestedStructureSize(3, x.Header) + size += proto.BytesSize(4, x.Payload) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Object) 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 *Object) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + x.ObjectId.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil && x.Signature.StableSize() != 0 { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Header != nil && x.Header.StableSize() != 0 { + x.Header.EmitProtobuf(mm.AppendMessage(3)) + } + if len(x.Payload) != 0 { + mm.AppendBytes(4, x.Payload) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Object) 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", "Object") + } + switch fc.FieldNum { + case 1: // ObjectId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ObjectId") + } + x.ObjectId = new(grpc.ObjectID) + if err := x.ObjectId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Signature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Signature") + } + x.Signature = new(grpc.Signature) + if err := x.Signature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // Header + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Header") + } + x.Header = new(Header) + if err := x.Header.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 4: // Payload + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Payload") + } + x.Payload = data + } + } + return nil +} +func (x *Object) GetObjectId() *grpc.ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} +func (x *Object) SetObjectId(v *grpc.ObjectID) { + x.ObjectId = v +} +func (x *Object) GetSignature() *grpc.Signature { + if x != nil { + return x.Signature + } + return nil +} +func (x *Object) SetSignature(v *grpc.Signature) { + x.Signature = v +} +func (x *Object) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil +} +func (x *Object) SetHeader(v *Header) { + x.Header = v +} +func (x *Object) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} +func (x *Object) SetPayload(v []byte) { + x.Payload = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Object) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Object) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"objectID\":" + out.RawString(prefix[1:]) + x.ObjectId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) + } + { + const prefix string = ",\"payload\":" + out.RawString(prefix) + out.Base64Bytes(x.Payload) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Object) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Object) 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 "objectID": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.ObjectId = f + } + case "signature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.Signature = f + } + case "header": + { + var f *Header + f = new(Header) + f.UnmarshalEasyJSON(in) + x.Header = f + } + case "payload": + { + var f []byte + f = in.Bytes() + x.Payload = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type SplitInfo struct { + SplitId []byte `json:"splitId"` + LastPart *grpc.ObjectID `json:"lastPart"` + Link *grpc.ObjectID `json:"link"` +} + +var ( + _ encoding.ProtoMarshaler = (*SplitInfo)(nil) + _ encoding.ProtoUnmarshaler = (*SplitInfo)(nil) + _ json.Marshaler = (*SplitInfo)(nil) + _ json.Unmarshaler = (*SplitInfo)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *SplitInfo) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.SplitId) + size += proto.NestedStructureSize(2, x.LastPart) + size += proto.NestedStructureSize(3, x.Link) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *SplitInfo) 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 *SplitInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.SplitId) != 0 { + mm.AppendBytes(1, x.SplitId) + } + if x.LastPart != nil && x.LastPart.StableSize() != 0 { + x.LastPart.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Link != nil && x.Link.StableSize() != 0 { + x.Link.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *SplitInfo) 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", "SplitInfo") + } + switch fc.FieldNum { + case 1: // SplitId + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SplitId") + } + x.SplitId = data + case 2: // LastPart + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "LastPart") + } + x.LastPart = new(grpc.ObjectID) + if err := x.LastPart.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // Link + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Link") + } + x.Link = new(grpc.ObjectID) + if err := x.Link.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *SplitInfo) GetSplitId() []byte { + if x != nil { + return x.SplitId + } + return nil +} +func (x *SplitInfo) SetSplitId(v []byte) { + x.SplitId = v +} +func (x *SplitInfo) GetLastPart() *grpc.ObjectID { + if x != nil { + return x.LastPart + } + return nil +} +func (x *SplitInfo) SetLastPart(v *grpc.ObjectID) { + x.LastPart = v +} +func (x *SplitInfo) GetLink() *grpc.ObjectID { + if x != nil { + return x.Link + } + return nil +} +func (x *SplitInfo) SetLink(v *grpc.ObjectID) { + x.Link = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *SplitInfo) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *SplitInfo) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"splitId\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.SplitId) + } + { + const prefix string = ",\"lastPart\":" + out.RawString(prefix) + x.LastPart.MarshalEasyJSON(out) + } + { + const prefix string = ",\"link\":" + out.RawString(prefix) + x.Link.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *SplitInfo) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *SplitInfo) 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 "splitId": + { + var f []byte + f = in.Bytes() + x.SplitId = f + } + case "lastPart": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.LastPart = f + } + case "link": + { + var f *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.Link = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ECInfo_Chunk struct { + Id *grpc.ObjectID `json:"id"` + Index uint32 `json:"index"` + Total uint32 `json:"total"` +} + +var ( + _ encoding.ProtoMarshaler = (*ECInfo_Chunk)(nil) + _ encoding.ProtoUnmarshaler = (*ECInfo_Chunk)(nil) + _ json.Marshaler = (*ECInfo_Chunk)(nil) + _ json.Unmarshaler = (*ECInfo_Chunk)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ECInfo_Chunk) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Id) + size += proto.UInt32Size(2, x.Index) + size += proto.UInt32Size(3, x.Total) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ECInfo_Chunk) 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 *ECInfo_Chunk) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Id != nil && x.Id.StableSize() != 0 { + x.Id.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Index != 0 { + mm.AppendUint32(2, x.Index) + } + if x.Total != 0 { + mm.AppendUint32(3, x.Total) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ECInfo_Chunk) 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", "ECInfo_Chunk") + } + switch fc.FieldNum { + case 1: // Id + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Id") + } + x.Id = new(grpc.ObjectID) + if err := x.Id.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Index + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Index") + } + x.Index = data + case 3: // Total + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Total") + } + x.Total = data + } + } + return nil +} +func (x *ECInfo_Chunk) GetId() *grpc.ObjectID { + if x != nil { + return x.Id + } + return nil +} +func (x *ECInfo_Chunk) SetId(v *grpc.ObjectID) { + x.Id = v +} +func (x *ECInfo_Chunk) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} +func (x *ECInfo_Chunk) SetIndex(v uint32) { + x.Index = v +} +func (x *ECInfo_Chunk) GetTotal() uint32 { + if x != nil { + return x.Total + } + return 0 +} +func (x *ECInfo_Chunk) SetTotal(v uint32) { + x.Total = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ECInfo_Chunk) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ECInfo_Chunk) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"id\":" + out.RawString(prefix[1:]) + x.Id.MarshalEasyJSON(out) + } + { + const prefix string = ",\"index\":" + out.RawString(prefix) + out.Uint32(x.Index) + } + { + const prefix string = ",\"total\":" + out.RawString(prefix) + out.Uint32(x.Total) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ECInfo_Chunk) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ECInfo_Chunk) 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 *grpc.ObjectID + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + x.Id = f + } + case "index": + { + var f uint32 + f = in.Uint32() + x.Index = f + } + case "total": + { + var f uint32 + f = in.Uint32() + x.Total = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ECInfo struct { + Chunks []*ECInfo_Chunk `json:"chunks"` +} + +var ( + _ encoding.ProtoMarshaler = (*ECInfo)(nil) + _ encoding.ProtoUnmarshaler = (*ECInfo)(nil) + _ json.Marshaler = (*ECInfo)(nil) + _ json.Unmarshaler = (*ECInfo)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ECInfo) StableSize() (size int) { + if x == nil { + return 0 + } + for i := range x.Chunks { + size += proto.NestedStructureSize(1, x.Chunks[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ECInfo) 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 *ECInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + for i := range x.Chunks { + if x.Chunks[i] != nil && x.Chunks[i].StableSize() != 0 { + x.Chunks[i].EmitProtobuf(mm.AppendMessage(1)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ECInfo) 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", "ECInfo") + } + switch fc.FieldNum { + case 1: // Chunks + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Chunks") + } + x.Chunks = append(x.Chunks, new(ECInfo_Chunk)) + ff := x.Chunks[len(x.Chunks)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *ECInfo) GetChunks() []*ECInfo_Chunk { + if x != nil { + return x.Chunks + } + return nil +} +func (x *ECInfo) SetChunks(v []*ECInfo_Chunk) { + x.Chunks = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ECInfo) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ECInfo) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"chunks\":" + out.RawString(prefix[1:]) + out.RawByte('[') + for i := range x.Chunks { + if i != 0 { + out.RawByte(',') + } + x.Chunks[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ECInfo) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ECInfo) 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 "chunks": + { + var f *ECInfo_Chunk + var list []*ECInfo_Chunk + in.Delim('[') + for !in.IsDelim(']') { + f = new(ECInfo_Chunk) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Chunks = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/object/grpc/types_frostfs_fuzz.go b/object/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..8491638 --- /dev/null +++ b/object/grpc/types_frostfs_fuzz.go @@ -0,0 +1,102 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package object + +func DoFuzzProtoShortHeader(data []byte) int { + msg := new(ShortHeader) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONShortHeader(data []byte) int { + msg := new(ShortHeader) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoHeader(data []byte) int { + msg := new(Header) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONHeader(data []byte) int { + msg := new(Header) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoObject(data []byte) int { + msg := new(Object) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONObject(data []byte) int { + msg := new(Object) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoSplitInfo(data []byte) int { + msg := new(SplitInfo) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONSplitInfo(data []byte) int { + msg := new(SplitInfo) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoECInfo(data []byte) int { + msg := new(ECInfo) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONECInfo(data []byte) int { + msg := new(ECInfo) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/object/grpc/types_frostfs_test.go b/object/grpc/types_frostfs_test.go new file mode 100644 index 0000000..11825be --- /dev/null +++ b/object/grpc/types_frostfs_test.go @@ -0,0 +1,61 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package object + +import ( + testing "testing" +) + +func FuzzProtoShortHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoShortHeader(data) + }) +} +func FuzzJSONShortHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONShortHeader(data) + }) +} +func FuzzProtoHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoHeader(data) + }) +} +func FuzzJSONHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONHeader(data) + }) +} +func FuzzProtoObject(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoObject(data) + }) +} +func FuzzJSONObject(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONObject(data) + }) +} +func FuzzProtoSplitInfo(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoSplitInfo(data) + }) +} +func FuzzJSONSplitInfo(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONSplitInfo(data) + }) +} +func FuzzProtoECInfo(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoECInfo(data) + }) +} +func FuzzJSONECInfo(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONECInfo(data) + }) +} diff --git a/refs/grpc/types.go b/refs/grpc/types.go deleted file mode 100644 index cdb69aa..0000000 --- a/refs/grpc/types.go +++ /dev/null @@ -1,97 +0,0 @@ -package refs - -// SetValue sets container identifier in a binary format. -func (x *ContainerID) SetValue(v []byte) { - x.Value = v -} - -// SetValue sets object identifier in a binary format. -func (x *ObjectID) SetValue(v []byte) { - x.Value = v -} - -// SetValue sets owner identifier in a binary format. -func (x *OwnerID) SetValue(v []byte) { - x.Value = v -} - -// SetContainerId sets container identifier of the address. -func (x *Address) SetContainerId(v *ContainerID) { - x.ContainerId = v -} - -// SetObjectId sets object identifier of the address. -func (x *Address) SetObjectId(v *ObjectID) { - x.ObjectId = v -} - -// SetType in generic checksum structure. -func (x *Checksum) SetType(v ChecksumType) { - x.Type = v -} - -// SetSum in generic checksum structure. -func (x *Checksum) SetSum(v []byte) { - x.Sum = v -} - -// SetMajor sets major version number. -func (x *Version) SetMajor(v uint32) { - x.Major = v -} - -// SetMinor sets minor version number. -func (x *Version) SetMinor(v uint32) { - x.Minor = v -} - -// SetKey sets public key in a binary format. -func (x *Signature) SetKey(v []byte) { - x.Key = v -} - -// SetSign sets signature. -func (x *Signature) SetSign(v []byte) { - x.Sign = v -} - -// SetScheme sets signature scheme. -func (x *Signature) SetScheme(s SignatureScheme) { - x.Scheme = s -} - -// SetKey sets public key in a binary format. -func (x *SignatureRFC6979) SetKey(v []byte) { - x.Key = v -} - -// SetSign sets signature. -func (x *SignatureRFC6979) SetSign(v []byte) { - x.Sign = v -} - -// FromString parses SignatureScheme from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *SignatureScheme) FromString(s string) bool { - i, ok := SignatureScheme_value[s] - if ok { - *x = SignatureScheme(i) - } - - return ok -} - -// FromString parses ChecksumType from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *ChecksumType) FromString(s string) bool { - i, ok := ChecksumType_value[s] - if ok { - *x = ChecksumType(i) - } - - return ok -} diff --git a/refs/grpc/types.pb.go b/refs/grpc/types.pb.go deleted file mode 100644 index ab3ae42..0000000 --- a/refs/grpc/types.pb.go +++ /dev/null @@ -1,852 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: refs/grpc/types.proto - -package refs - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Signature scheme describes digital signing scheme used for (key, signature) -// pair. -type SignatureScheme int32 - -const ( - // ECDSA with SHA-512 hashing (FIPS 186-3) - SignatureScheme_ECDSA_SHA512 SignatureScheme = 0 - // Deterministic ECDSA with SHA-256 hashing (RFC 6979) - SignatureScheme_ECDSA_RFC6979_SHA256 SignatureScheme = 1 - // Deterministic ECDSA with SHA-256 hashing using WalletConnect API. - // Here the algorithm is the same, but the message format differs. - SignatureScheme_ECDSA_RFC6979_SHA256_WALLET_CONNECT SignatureScheme = 2 -) - -// Enum value maps for SignatureScheme. -var ( - SignatureScheme_name = map[int32]string{ - 0: "ECDSA_SHA512", - 1: "ECDSA_RFC6979_SHA256", - 2: "ECDSA_RFC6979_SHA256_WALLET_CONNECT", - } - SignatureScheme_value = map[string]int32{ - "ECDSA_SHA512": 0, - "ECDSA_RFC6979_SHA256": 1, - "ECDSA_RFC6979_SHA256_WALLET_CONNECT": 2, - } -) - -func (x SignatureScheme) Enum() *SignatureScheme { - p := new(SignatureScheme) - *p = x - return p -} - -func (x SignatureScheme) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SignatureScheme) Descriptor() protoreflect.EnumDescriptor { - return file_refs_grpc_types_proto_enumTypes[0].Descriptor() -} - -func (SignatureScheme) Type() protoreflect.EnumType { - return &file_refs_grpc_types_proto_enumTypes[0] -} - -func (x SignatureScheme) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SignatureScheme.Descriptor instead. -func (SignatureScheme) EnumDescriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{0} -} - -// Checksum algorithm type. -type ChecksumType int32 - -const ( - // Unknown. Not used - ChecksumType_CHECKSUM_TYPE_UNSPECIFIED ChecksumType = 0 - // Tillich-Zemor homomorphic hash function - ChecksumType_TZ ChecksumType = 1 - // SHA-256 - ChecksumType_SHA256 ChecksumType = 2 -) - -// Enum value maps for ChecksumType. -var ( - ChecksumType_name = map[int32]string{ - 0: "CHECKSUM_TYPE_UNSPECIFIED", - 1: "TZ", - 2: "SHA256", - } - ChecksumType_value = map[string]int32{ - "CHECKSUM_TYPE_UNSPECIFIED": 0, - "TZ": 1, - "SHA256": 2, - } -) - -func (x ChecksumType) Enum() *ChecksumType { - p := new(ChecksumType) - *p = x - return p -} - -func (x ChecksumType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ChecksumType) Descriptor() protoreflect.EnumDescriptor { - return file_refs_grpc_types_proto_enumTypes[1].Descriptor() -} - -func (ChecksumType) Type() protoreflect.EnumType { - return &file_refs_grpc_types_proto_enumTypes[1] -} - -func (x ChecksumType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ChecksumType.Descriptor instead. -func (ChecksumType) EnumDescriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{1} -} - -// Objects in NeoFS are addressed by their ContainerID and ObjectID. -// -// String presentation of `Address` is a concatenation of string encoded -// `ContainerID` and `ObjectID` delimited by '/' character. -type Address struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Container identifier - ContainerId *ContainerID `protobuf:"bytes,1,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"` - // Object identifier - ObjectId *ObjectID `protobuf:"bytes,2,opt,name=object_id,json=objectID,proto3" json:"object_id,omitempty"` -} - -func (x *Address) Reset() { - *x = Address{} - if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Address) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Address) ProtoMessage() {} - -func (x *Address) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Address.ProtoReflect.Descriptor instead. -func (*Address) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *Address) GetContainerId() *ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -func (x *Address) GetObjectId() *ObjectID { - if x != nil { - return x.ObjectId - } - return nil -} - -// NeoFS Object unique identifier. Objects are immutable and content-addressed. -// It means `ObjectID` will change if the `header` or the `payload` changes. -// -// `ObjectID` is a 32 byte long -// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of -// the object's `header` field, which, in it's turn, contains the hash of the -// object's payload. -// -// String presentation is a -// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. -// -// JSON value will be data encoded as a string using standard base64 -// encoding with paddings. Either -// [standard](https://tools.ietf.org/html/rfc4648#section-4) or -// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding -// with/without paddings are accepted. -type ObjectID struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Object identifier in a binary format - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *ObjectID) Reset() { - *x = ObjectID{} - if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObjectID) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObjectID) ProtoMessage() {} - -func (x *ObjectID) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ObjectID.ProtoReflect.Descriptor instead. -func (*ObjectID) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{1} -} - -func (x *ObjectID) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -// NeoFS container identifier. Container structures are immutable and -// content-addressed. -// -// `ContainerID` is a 32 byte long -// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of -// stable-marshalled container message. -// -// String presentation is a -// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. -// -// JSON value will be data encoded as a string using standard base64 -// encoding with paddings. Either -// [standard](https://tools.ietf.org/html/rfc4648#section-4) or -// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding -// with/without paddings are accepted. -type ContainerID struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Container identifier in a binary format. - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *ContainerID) Reset() { - *x = ContainerID{} - if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ContainerID) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContainerID) ProtoMessage() {} - -func (x *ContainerID) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ContainerID.ProtoReflect.Descriptor instead. -func (*ContainerID) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{2} -} - -func (x *ContainerID) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -// `OwnerID` is a derivative of a user's main public key. The transformation -// algorithm is the same as for Neo3 wallet addresses. Neo3 wallet address can -// be directly used as `OwnerID`. -// -// `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte -// followed by 20 bytes of ScrptHash and 4 bytes of checksum. -// -// String presentation is a [Base58 -// Check](https://en.bitcoin.it/wiki/Base58Check_encoding) Encoded string. -// -// JSON value will be data encoded as a string using standard base64 -// encoding with paddings. Either -// [standard](https://tools.ietf.org/html/rfc4648#section-4) or -// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding -// with/without paddings are accepted. -type OwnerID struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of the container owner in a binary format - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *OwnerID) Reset() { - *x = OwnerID{} - if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OwnerID) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OwnerID) ProtoMessage() {} - -func (x *OwnerID) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OwnerID.ProtoReflect.Descriptor instead. -func (*OwnerID) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{3} -} - -func (x *OwnerID) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -// API version used by a node. -// -// String presentation is a Semantic Versioning 2.0.0 compatible version string -// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor -// number. -type Version struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Major API version - Major uint32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` - // Minor API version - Minor uint32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` -} - -func (x *Version) Reset() { - *x = Version{} - if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Version) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Version) ProtoMessage() {} - -func (x *Version) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Version.ProtoReflect.Descriptor instead. -func (*Version) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{4} -} - -func (x *Version) GetMajor() uint32 { - if x != nil { - return x.Major - } - return 0 -} - -func (x *Version) GetMinor() uint32 { - if x != nil { - return x.Minor - } - return 0 -} - -// Signature of something in NeoFS. -type Signature struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Public key used for signing - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Signature - Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature,proto3" json:"sign,omitempty"` - // Scheme contains digital signature scheme identifier - Scheme SignatureScheme `protobuf:"varint,3,opt,name=scheme,proto3,enum=neo.fs.v2.refs.SignatureScheme" json:"scheme,omitempty"` -} - -func (x *Signature) Reset() { - *x = Signature{} - if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Signature) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Signature) ProtoMessage() {} - -func (x *Signature) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Signature.ProtoReflect.Descriptor instead. -func (*Signature) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{5} -} - -func (x *Signature) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *Signature) GetSign() []byte { - if x != nil { - return x.Sign - } - return nil -} - -func (x *Signature) GetScheme() SignatureScheme { - if x != nil { - return x.Scheme - } - return SignatureScheme_ECDSA_SHA512 -} - -// RFC 6979 signature. -type SignatureRFC6979 struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Public key used for signing - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Deterministic ECDSA with SHA-256 hashing - Sign []byte `protobuf:"bytes,2,opt,name=sign,json=signature,proto3" json:"sign,omitempty"` -} - -func (x *SignatureRFC6979) Reset() { - *x = SignatureRFC6979{} - if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignatureRFC6979) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignatureRFC6979) ProtoMessage() {} - -func (x *SignatureRFC6979) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignatureRFC6979.ProtoReflect.Descriptor instead. -func (*SignatureRFC6979) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{6} -} - -func (x *SignatureRFC6979) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *SignatureRFC6979) GetSign() []byte { - if x != nil { - return x.Sign - } - return nil -} - -// Checksum message. -// Depending on checksum algorithm type, the string presentation may vary: -// -// - TZ \ -// Hex encoded string without `0x` prefix -// - SHA256 \ -// Hex encoded string without `0x` prefix -type Checksum struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Checksum algorithm type - Type ChecksumType `protobuf:"varint,1,opt,name=type,proto3,enum=neo.fs.v2.refs.ChecksumType" json:"type,omitempty"` - // Checksum itself - Sum []byte `protobuf:"bytes,2,opt,name=sum,proto3" json:"sum,omitempty"` -} - -func (x *Checksum) Reset() { - *x = Checksum{} - if protoimpl.UnsafeEnabled { - mi := &file_refs_grpc_types_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Checksum) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Checksum) ProtoMessage() {} - -func (x *Checksum) ProtoReflect() protoreflect.Message { - mi := &file_refs_grpc_types_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Checksum.ProtoReflect.Descriptor instead. -func (*Checksum) Descriptor() ([]byte, []int) { - return file_refs_grpc_types_proto_rawDescGZIP(), []int{7} -} - -func (x *Checksum) GetType() ChecksumType { - if x != nil { - return x.Type - } - return ChecksumType_CHECKSUM_TYPE_UNSPECIFIED -} - -func (x *Checksum) GetSum() []byte { - if x != nil { - return x.Sum - } - return nil -} - -var File_refs_grpc_types_proto protoreflect.FileDescriptor - -var file_refs_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x09, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, - 0x52, 0x08, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x22, 0x20, 0x0a, 0x08, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x23, 0x0a, 0x0b, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x1f, 0x0a, 0x07, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x35, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, - 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x61, - 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x22, 0x6f, 0x0a, 0x09, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, - 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x65, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x10, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x4e, 0x0a, 0x08, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x2a, 0x66, 0x0a, 0x0f, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x0c, - 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x00, 0x12, 0x18, - 0x0a, 0x14, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f, - 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x45, 0x43, 0x44, 0x53, - 0x41, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x37, 0x39, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, - 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x10, - 0x02, 0x2a, 0x41, 0x0a, 0x0c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x53, 0x55, 0x4d, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x06, 0x0a, 0x02, 0x54, 0x5a, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x48, 0x41, 0x32, - 0x35, 0x36, 0x10, 0x02, 0x42, 0x5b, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, - 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, - 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x3b, 0x72, 0x65, 0x66, 0x73, 0xaa, 0x02, 0x18, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x52, 0x65, 0x66, - 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_refs_grpc_types_proto_rawDescOnce sync.Once - file_refs_grpc_types_proto_rawDescData = file_refs_grpc_types_proto_rawDesc -) - -func file_refs_grpc_types_proto_rawDescGZIP() []byte { - file_refs_grpc_types_proto_rawDescOnce.Do(func() { - file_refs_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_refs_grpc_types_proto_rawDescData) - }) - return file_refs_grpc_types_proto_rawDescData -} - -var file_refs_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_refs_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_refs_grpc_types_proto_goTypes = []interface{}{ - (SignatureScheme)(0), // 0: neo.fs.v2.refs.SignatureScheme - (ChecksumType)(0), // 1: neo.fs.v2.refs.ChecksumType - (*Address)(nil), // 2: neo.fs.v2.refs.Address - (*ObjectID)(nil), // 3: neo.fs.v2.refs.ObjectID - (*ContainerID)(nil), // 4: neo.fs.v2.refs.ContainerID - (*OwnerID)(nil), // 5: neo.fs.v2.refs.OwnerID - (*Version)(nil), // 6: neo.fs.v2.refs.Version - (*Signature)(nil), // 7: neo.fs.v2.refs.Signature - (*SignatureRFC6979)(nil), // 8: neo.fs.v2.refs.SignatureRFC6979 - (*Checksum)(nil), // 9: neo.fs.v2.refs.Checksum -} -var file_refs_grpc_types_proto_depIdxs = []int32{ - 4, // 0: neo.fs.v2.refs.Address.container_id:type_name -> neo.fs.v2.refs.ContainerID - 3, // 1: neo.fs.v2.refs.Address.object_id:type_name -> neo.fs.v2.refs.ObjectID - 0, // 2: neo.fs.v2.refs.Signature.scheme:type_name -> neo.fs.v2.refs.SignatureScheme - 1, // 3: neo.fs.v2.refs.Checksum.type:type_name -> neo.fs.v2.refs.ChecksumType - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_refs_grpc_types_proto_init() } -func file_refs_grpc_types_proto_init() { - if File_refs_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_refs_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Address); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_refs_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectID); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_refs_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerID); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_refs_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OwnerID); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_refs_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Version); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_refs_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Signature); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_refs_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignatureRFC6979); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_refs_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Checksum); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_refs_grpc_types_proto_rawDesc, - NumEnums: 2, - NumMessages: 8, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_refs_grpc_types_proto_goTypes, - DependencyIndexes: file_refs_grpc_types_proto_depIdxs, - EnumInfos: file_refs_grpc_types_proto_enumTypes, - MessageInfos: file_refs_grpc_types_proto_msgTypes, - }.Build() - File_refs_grpc_types_proto = out.File - file_refs_grpc_types_proto_rawDesc = nil - file_refs_grpc_types_proto_goTypes = nil - file_refs_grpc_types_proto_depIdxs = nil -} diff --git a/refs/grpc/types_frostfs.pb.go b/refs/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..881a06f --- /dev/null +++ b/refs/grpc/types_frostfs.pb.go @@ -0,0 +1,1343 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package refs + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type SignatureScheme int32 + +const ( + SignatureScheme_ECDSA_SHA512 SignatureScheme = 0 + SignatureScheme_ECDSA_RFC6979_SHA256 SignatureScheme = 1 + SignatureScheme_ECDSA_RFC6979_SHA256_WALLET_CONNECT SignatureScheme = 2 +) + +var ( + SignatureScheme_name = map[int32]string{ + 0: "ECDSA_SHA512", + 1: "ECDSA_RFC6979_SHA256", + 2: "ECDSA_RFC6979_SHA256_WALLET_CONNECT", + } + SignatureScheme_value = map[string]int32{ + "ECDSA_SHA512": 0, + "ECDSA_RFC6979_SHA256": 1, + "ECDSA_RFC6979_SHA256_WALLET_CONNECT": 2, + } +) + +func (x SignatureScheme) String() string { + if v, ok := SignatureScheme_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *SignatureScheme) FromString(s string) bool { + if v, ok := SignatureScheme_value[s]; ok { + *x = SignatureScheme(v) + return true + } + return false +} + +type ChecksumType int32 + +const ( + ChecksumType_CHECKSUM_TYPE_UNSPECIFIED ChecksumType = 0 + ChecksumType_TZ ChecksumType = 1 + ChecksumType_SHA256 ChecksumType = 2 +) + +var ( + ChecksumType_name = map[int32]string{ + 0: "CHECKSUM_TYPE_UNSPECIFIED", + 1: "TZ", + 2: "SHA256", + } + ChecksumType_value = map[string]int32{ + "CHECKSUM_TYPE_UNSPECIFIED": 0, + "TZ": 1, + "SHA256": 2, + } +) + +func (x ChecksumType) String() string { + if v, ok := ChecksumType_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *ChecksumType) FromString(s string) bool { + if v, ok := ChecksumType_value[s]; ok { + *x = ChecksumType(v) + return true + } + return false +} + +type Address struct { + ContainerId *ContainerID `json:"containerID"` + ObjectId *ObjectID `json:"objectID"` +} + +var ( + _ encoding.ProtoMarshaler = (*Address)(nil) + _ encoding.ProtoUnmarshaler = (*Address)(nil) + _ json.Marshaler = (*Address)(nil) + _ json.Unmarshaler = (*Address)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Address) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.ContainerId) + size += proto.NestedStructureSize(2, x.ObjectId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Address) 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 *Address) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) + } + if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + x.ObjectId.EmitProtobuf(mm.AppendMessage(2)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Address) 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", "Address") + } + switch fc.FieldNum { + case 1: // ContainerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerId") + } + x.ContainerId = new(ContainerID) + if err := x.ContainerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // ObjectId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ObjectId") + } + x.ObjectId = new(ObjectID) + if err := x.ObjectId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Address) GetContainerId() *ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} +func (x *Address) SetContainerId(v *ContainerID) { + x.ContainerId = v +} +func (x *Address) GetObjectId() *ObjectID { + if x != nil { + return x.ObjectId + } + return nil +} +func (x *Address) SetObjectId(v *ObjectID) { + x.ObjectId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Address) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Address) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"containerID\":" + out.RawString(prefix[1:]) + x.ContainerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"objectID\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Address) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Address) 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 "containerID": + { + var f *ContainerID + f = new(ContainerID) + f.UnmarshalEasyJSON(in) + x.ContainerId = f + } + case "objectID": + { + var f *ObjectID + f = new(ObjectID) + f.UnmarshalEasyJSON(in) + x.ObjectId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ObjectID struct { + Value []byte `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*ObjectID)(nil) + _ encoding.ProtoUnmarshaler = (*ObjectID)(nil) + _ json.Marshaler = (*ObjectID)(nil) + _ json.Unmarshaler = (*ObjectID)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ObjectID) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.Value) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ObjectID) 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 *ObjectID) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Value) != 0 { + mm.AppendBytes(1, x.Value) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ObjectID) 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", "ObjectID") + } + switch fc.FieldNum { + case 1: // Value + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + } + } + return nil +} +func (x *ObjectID) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} +func (x *ObjectID) SetValue(v []byte) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ObjectID) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ObjectID) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"value\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ObjectID) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ObjectID) 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 []byte + f = in.Bytes() + x.Value = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ContainerID struct { + Value []byte `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*ContainerID)(nil) + _ encoding.ProtoUnmarshaler = (*ContainerID)(nil) + _ json.Marshaler = (*ContainerID)(nil) + _ json.Unmarshaler = (*ContainerID)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ContainerID) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.Value) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ContainerID) 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 *ContainerID) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Value) != 0 { + mm.AppendBytes(1, x.Value) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ContainerID) 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", "ContainerID") + } + switch fc.FieldNum { + case 1: // Value + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + } + } + return nil +} +func (x *ContainerID) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} +func (x *ContainerID) SetValue(v []byte) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ContainerID) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ContainerID) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"value\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ContainerID) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ContainerID) 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 []byte + f = in.Bytes() + x.Value = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type OwnerID struct { + Value []byte `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*OwnerID)(nil) + _ encoding.ProtoUnmarshaler = (*OwnerID)(nil) + _ json.Marshaler = (*OwnerID)(nil) + _ json.Unmarshaler = (*OwnerID)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *OwnerID) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.Value) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *OwnerID) 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 *OwnerID) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Value) != 0 { + mm.AppendBytes(1, x.Value) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *OwnerID) 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", "OwnerID") + } + switch fc.FieldNum { + case 1: // Value + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + } + } + return nil +} +func (x *OwnerID) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} +func (x *OwnerID) SetValue(v []byte) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *OwnerID) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *OwnerID) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"value\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *OwnerID) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *OwnerID) 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 []byte + f = in.Bytes() + x.Value = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Version struct { + Major uint32 `json:"major"` + Minor uint32 `json:"minor"` +} + +var ( + _ encoding.ProtoMarshaler = (*Version)(nil) + _ encoding.ProtoUnmarshaler = (*Version)(nil) + _ json.Marshaler = (*Version)(nil) + _ json.Unmarshaler = (*Version)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Version) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt32Size(1, x.Major) + size += proto.UInt32Size(2, x.Minor) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Version) 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 *Version) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Major != 0 { + mm.AppendUint32(1, x.Major) + } + if x.Minor != 0 { + mm.AppendUint32(2, x.Minor) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Version) 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", "Version") + } + switch fc.FieldNum { + case 1: // Major + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Major") + } + x.Major = data + case 2: // Minor + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Minor") + } + x.Minor = data + } + } + return nil +} +func (x *Version) GetMajor() uint32 { + if x != nil { + return x.Major + } + return 0 +} +func (x *Version) SetMajor(v uint32) { + x.Major = v +} +func (x *Version) GetMinor() uint32 { + if x != nil { + return x.Minor + } + return 0 +} +func (x *Version) SetMinor(v uint32) { + x.Minor = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Version) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Version) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"major\":" + out.RawString(prefix[1:]) + out.Uint32(x.Major) + } + { + const prefix string = ",\"minor\":" + out.RawString(prefix) + out.Uint32(x.Minor) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Version) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Version) 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 "major": + { + var f uint32 + f = in.Uint32() + x.Major = f + } + case "minor": + { + var f uint32 + f = in.Uint32() + x.Minor = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Signature struct { + Key []byte `json:"key"` + Sign []byte `json:"signature"` + Scheme SignatureScheme `json:"scheme"` +} + +var ( + _ encoding.ProtoMarshaler = (*Signature)(nil) + _ encoding.ProtoUnmarshaler = (*Signature)(nil) + _ json.Marshaler = (*Signature)(nil) + _ json.Unmarshaler = (*Signature)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Signature) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.Key) + size += proto.BytesSize(2, x.Sign) + size += proto.EnumSize(3, int32(x.Scheme)) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Signature) 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 *Signature) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Key) != 0 { + mm.AppendBytes(1, x.Key) + } + if len(x.Sign) != 0 { + mm.AppendBytes(2, x.Sign) + } + if int32(x.Scheme) != 0 { + mm.AppendInt32(3, int32(x.Scheme)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Signature) 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", "Signature") + } + switch fc.FieldNum { + case 1: // Key + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Key") + } + x.Key = data + case 2: // Sign + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Sign") + } + x.Sign = data + case 3: // Scheme + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Scheme") + } + x.Scheme = SignatureScheme(data) + } + } + return nil +} +func (x *Signature) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} +func (x *Signature) SetKey(v []byte) { + x.Key = v +} +func (x *Signature) GetSign() []byte { + if x != nil { + return x.Sign + } + return nil +} +func (x *Signature) SetSign(v []byte) { + x.Sign = v +} +func (x *Signature) GetScheme() SignatureScheme { + if x != nil { + return x.Scheme + } + return 0 +} +func (x *Signature) SetScheme(v SignatureScheme) { + x.Scheme = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Signature) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Signature) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"key\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.Key) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + out.Base64Bytes(x.Sign) + } + { + const prefix string = ",\"scheme\":" + out.RawString(prefix) + out.Int32(int32(x.Scheme)) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Signature) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Signature) 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 []byte + f = in.Bytes() + x.Key = f + } + case "signature": + { + var f []byte + f = in.Bytes() + x.Sign = f + } + case "scheme": + { + var f SignatureScheme + var parsedValue SignatureScheme + switch v := in.Interface().(type) { + case string: + if vv, ok := SignatureScheme_value[v]; ok { + parsedValue = SignatureScheme(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = SignatureScheme(vv) + case float64: + parsedValue = SignatureScheme(v) + } + f = parsedValue + x.Scheme = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type SignatureRFC6979 struct { + Key []byte `json:"key"` + Sign []byte `json:"signature"` +} + +var ( + _ encoding.ProtoMarshaler = (*SignatureRFC6979)(nil) + _ encoding.ProtoUnmarshaler = (*SignatureRFC6979)(nil) + _ json.Marshaler = (*SignatureRFC6979)(nil) + _ json.Unmarshaler = (*SignatureRFC6979)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *SignatureRFC6979) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.Key) + size += proto.BytesSize(2, x.Sign) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *SignatureRFC6979) 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 *SignatureRFC6979) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Key) != 0 { + mm.AppendBytes(1, x.Key) + } + if len(x.Sign) != 0 { + mm.AppendBytes(2, x.Sign) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *SignatureRFC6979) 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", "SignatureRFC6979") + } + switch fc.FieldNum { + case 1: // Key + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Key") + } + x.Key = data + case 2: // Sign + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Sign") + } + x.Sign = data + } + } + return nil +} +func (x *SignatureRFC6979) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} +func (x *SignatureRFC6979) SetKey(v []byte) { + x.Key = v +} +func (x *SignatureRFC6979) GetSign() []byte { + if x != nil { + return x.Sign + } + return nil +} +func (x *SignatureRFC6979) SetSign(v []byte) { + x.Sign = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *SignatureRFC6979) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *SignatureRFC6979) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"key\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.Key) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + out.Base64Bytes(x.Sign) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *SignatureRFC6979) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *SignatureRFC6979) 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 []byte + f = in.Bytes() + x.Key = f + } + case "signature": + { + var f []byte + f = in.Bytes() + x.Sign = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Checksum struct { + Type ChecksumType `json:"type"` + Sum []byte `json:"sum"` +} + +var ( + _ encoding.ProtoMarshaler = (*Checksum)(nil) + _ encoding.ProtoUnmarshaler = (*Checksum)(nil) + _ json.Marshaler = (*Checksum)(nil) + _ json.Unmarshaler = (*Checksum)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Checksum) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.Type)) + size += proto.BytesSize(2, x.Sum) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Checksum) 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 *Checksum) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.Type) != 0 { + mm.AppendInt32(1, int32(x.Type)) + } + if len(x.Sum) != 0 { + mm.AppendBytes(2, x.Sum) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Checksum) 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", "Checksum") + } + switch fc.FieldNum { + case 1: // Type + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Type") + } + x.Type = ChecksumType(data) + case 2: // Sum + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Sum") + } + x.Sum = data + } + } + return nil +} +func (x *Checksum) GetType() ChecksumType { + if x != nil { + return x.Type + } + return 0 +} +func (x *Checksum) SetType(v ChecksumType) { + x.Type = v +} +func (x *Checksum) GetSum() []byte { + if x != nil { + return x.Sum + } + return nil +} +func (x *Checksum) SetSum(v []byte) { + x.Sum = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Checksum) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Checksum) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"type\":" + out.RawString(prefix[1:]) + out.Int32(int32(x.Type)) + } + { + const prefix string = ",\"sum\":" + out.RawString(prefix) + out.Base64Bytes(x.Sum) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Checksum) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Checksum) 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 ChecksumType + var parsedValue ChecksumType + switch v := in.Interface().(type) { + case string: + if vv, ok := ChecksumType_value[v]; ok { + parsedValue = ChecksumType(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = ChecksumType(vv) + case float64: + parsedValue = ChecksumType(v) + } + f = parsedValue + x.Type = f + } + case "sum": + { + var f []byte + f = in.Bytes() + x.Sum = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/refs/grpc/types_frostfs_fuzz.go b/refs/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..a64a9bf --- /dev/null +++ b/refs/grpc/types_frostfs_fuzz.go @@ -0,0 +1,159 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package refs + +func DoFuzzProtoAddress(data []byte) int { + msg := new(Address) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONAddress(data []byte) int { + msg := new(Address) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoObjectID(data []byte) int { + msg := new(ObjectID) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONObjectID(data []byte) int { + msg := new(ObjectID) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoContainerID(data []byte) int { + msg := new(ContainerID) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONContainerID(data []byte) int { + msg := new(ContainerID) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoOwnerID(data []byte) int { + msg := new(OwnerID) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONOwnerID(data []byte) int { + msg := new(OwnerID) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoVersion(data []byte) int { + msg := new(Version) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONVersion(data []byte) int { + msg := new(Version) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoSignature(data []byte) int { + msg := new(Signature) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONSignature(data []byte) int { + msg := new(Signature) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoSignatureRFC6979(data []byte) int { + msg := new(SignatureRFC6979) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONSignatureRFC6979(data []byte) int { + msg := new(SignatureRFC6979) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoChecksum(data []byte) int { + msg := new(Checksum) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONChecksum(data []byte) int { + msg := new(Checksum) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/refs/grpc/types_frostfs_test.go b/refs/grpc/types_frostfs_test.go new file mode 100644 index 0000000..9b19892 --- /dev/null +++ b/refs/grpc/types_frostfs_test.go @@ -0,0 +1,91 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package refs + +import ( + testing "testing" +) + +func FuzzProtoAddress(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoAddress(data) + }) +} +func FuzzJSONAddress(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONAddress(data) + }) +} +func FuzzProtoObjectID(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoObjectID(data) + }) +} +func FuzzJSONObjectID(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONObjectID(data) + }) +} +func FuzzProtoContainerID(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoContainerID(data) + }) +} +func FuzzJSONContainerID(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONContainerID(data) + }) +} +func FuzzProtoOwnerID(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoOwnerID(data) + }) +} +func FuzzJSONOwnerID(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONOwnerID(data) + }) +} +func FuzzProtoVersion(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoVersion(data) + }) +} +func FuzzJSONVersion(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONVersion(data) + }) +} +func FuzzProtoSignature(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoSignature(data) + }) +} +func FuzzJSONSignature(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONSignature(data) + }) +} +func FuzzProtoSignatureRFC6979(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoSignatureRFC6979(data) + }) +} +func FuzzJSONSignatureRFC6979(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONSignatureRFC6979(data) + }) +} +func FuzzProtoChecksum(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoChecksum(data) + }) +} +func FuzzJSONChecksum(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONChecksum(data) + }) +} diff --git a/rpc/client/client.go b/rpc/client/client.go index 7e914db..d9ce2fc 100644 --- a/rpc/client/client.go +++ b/rpc/client/client.go @@ -1,6 +1,7 @@ package client import ( + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) @@ -20,6 +21,7 @@ func New(opts ...Option) *Client { opt(&c.cfg) } + c.grpcDialOpts = append(c.grpcDialOpts, grpc.WithDefaultCallOptions(grpc.ForceCodec(encoding.ProtoCodec{}))) if c.tlsCfg != nil { c.grpcDialOpts = append(c.grpcDialOpts, grpc.WithTransportCredentials(credentials.NewTLS(c.tlsCfg))) } diff --git a/rpc/message/encoding.go b/rpc/message/encoding.go index 715f015..d656acd 100644 --- a/rpc/message/encoding.go +++ b/rpc/message/encoding.go @@ -1,17 +1,14 @@ package message import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc" - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" + "encoding/json" ) // GRPCConvertedMessage is an interface // of the gRPC message that is used // for Message encoding/decoding. type GRPCConvertedMessage interface { - grpc.Message - proto.Message + UnmarshalProtobuf([]byte) error } // Unmarshal decodes m from its Protobuf binary representation @@ -19,7 +16,7 @@ type GRPCConvertedMessage interface { // // gm should be tof the same type as the m.ToGRPCMessage() return. func Unmarshal(m Message, data []byte, gm GRPCConvertedMessage) error { - if err := proto.Unmarshal(data, gm); err != nil { + if err := gm.UnmarshalProtobuf(data); err != nil { return err } @@ -28,21 +25,16 @@ func Unmarshal(m Message, data []byte, gm GRPCConvertedMessage) error { // MarshalJSON encodes m to Protobuf JSON representation. func MarshalJSON(m Message) ([]byte, error) { - return protojson.MarshalOptions{ - EmitUnpopulated: true, - }.Marshal( - m.ToGRPCMessage().(proto.Message), - ) + return json.Marshal(m.ToGRPCMessage()) } // UnmarshalJSON decodes m from its Protobuf JSON representation // via related gRPC message. // // gm should be tof the same type as the m.ToGRPCMessage() return. -func UnmarshalJSON(m Message, data []byte, gm GRPCConvertedMessage) error { - if err := protojson.Unmarshal(data, gm); err != nil { +func UnmarshalJSON(m Message, data []byte, gm any) error { + if err := json.Unmarshal(data, gm); err != nil { return err } - return m.FromGRPCMessage(gm) } diff --git a/rpc/netmap.go b/rpc/netmap.go index 38bdd6d..8119477 100644 --- a/rpc/netmap.go +++ b/rpc/netmap.go @@ -37,7 +37,6 @@ func NetworkInfo( opts ...client.CallOption, ) (*netmap.NetworkInfoResponse, error) { resp := new(netmap.NetworkInfoResponse) - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceNetmap, rpcNetmapNetInfo), req, resp, opts...) if err != nil { return nil, err diff --git a/session/convert.go b/session/convert.go index 4197935..b7f334e 100644 --- a/session/convert.go +++ b/session/convert.go @@ -460,7 +460,7 @@ func (r *RequestMetaHeader) FromGRPCMessage(m grpc.Message) error { r.epoch = v.GetEpoch() r.ttl = v.GetTtl() - r.netMagic = v.GetNetworkMagic() + r.netMagic = v.GetMagicNumber() return nil } diff --git a/session/grpc/service.go b/session/grpc/service.go deleted file mode 100644 index 6e02328..0000000 --- a/session/grpc/service.go +++ /dev/null @@ -1,55 +0,0 @@ -package session - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" -) - -// SetOwnerId sets identifier of the session initiator. -func (m *CreateRequest_Body) SetOwnerId(v *refs.OwnerID) { - m.OwnerId = v -} - -// SetExpiration sets lifetime of the session. -func (m *CreateRequest_Body) SetExpiration(v uint64) { - m.Expiration = v -} - -// SetBody sets body of the request. -func (m *CreateRequest) SetBody(v *CreateRequest_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the request. -func (m *CreateRequest) SetMetaHeader(v *RequestMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the request. -func (m *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) { - m.VerifyHeader = v -} - -// SetId sets identifier of the session token. -func (m *CreateResponse_Body) SetId(v []byte) { - m.Id = v -} - -// SetSessionKey sets session public key in a binary format. -func (m *CreateResponse_Body) SetSessionKey(v []byte) { - m.SessionKey = v -} - -// SetBody sets body of the response. -func (m *CreateResponse) SetBody(v *CreateResponse_Body) { - m.Body = v -} - -// SetMetaHeader sets meta header of the response. -func (m *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) { - m.MetaHeader = v -} - -// SetVerifyHeader sets verification header of the response. -func (m *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) { - m.VerifyHeader = v -} diff --git a/session/grpc/service.pb.go b/session/grpc/service.pb.go deleted file mode 100644 index b5e999f..0000000 --- a/session/grpc/service.pb.go +++ /dev/null @@ -1,458 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: session/grpc/service.proto - -package session - -import ( - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Information necessary for opening a session. -type CreateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of a create session token request message. - Body *CreateRequest_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *RequestMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *RequestVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *CreateRequest) Reset() { - *x = CreateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRequest) ProtoMessage() {} - -func (x *CreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. -func (*CreateRequest) Descriptor() ([]byte, []int) { - return file_session_grpc_service_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateRequest) GetBody() *CreateRequest_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Information about the opened session. -type CreateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Body of create session token response message. - Body *CreateResponse_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - MetaHeader *ResponseMetaHeader `protobuf:"bytes,2,opt,name=meta_header,json=metaHeader,proto3" json:"meta_header,omitempty"` - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - VerifyHeader *ResponseVerificationHeader `protobuf:"bytes,3,opt,name=verify_header,json=verifyHeader,proto3" json:"verify_header,omitempty"` -} - -func (x *CreateResponse) Reset() { - *x = CreateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateResponse) ProtoMessage() {} - -func (x *CreateResponse) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead. -func (*CreateResponse) Descriptor() ([]byte, []int) { - return file_session_grpc_service_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateResponse) GetBody() *CreateResponse_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} - -func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} - -// Session creation request body -type CreateRequest_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Session initiating user's or node's key derived `OwnerID` - OwnerId *grpc.OwnerID `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` - // Session expiration `Epoch` - Expiration uint64 `protobuf:"varint,2,opt,name=expiration,proto3" json:"expiration,omitempty"` -} - -func (x *CreateRequest_Body) Reset() { - *x = CreateRequest_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRequest_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRequest_Body) ProtoMessage() {} - -func (x *CreateRequest_Body) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRequest_Body.ProtoReflect.Descriptor instead. -func (*CreateRequest_Body) Descriptor() ([]byte, []int) { - return file_session_grpc_service_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} - -func (x *CreateRequest_Body) GetExpiration() uint64 { - if x != nil { - return x.Expiration - } - return 0 -} - -// Session creation response body -type CreateResponse_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Identifier of a newly created session - Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Public key used for session - SessionKey []byte `protobuf:"bytes,2,opt,name=session_key,json=sessionKey,proto3" json:"session_key,omitempty"` -} - -func (x *CreateResponse_Body) Reset() { - *x = CreateResponse_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateResponse_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateResponse_Body) ProtoMessage() {} - -func (x *CreateResponse_Body) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateResponse_Body.ProtoReflect.Descriptor instead. -func (*CreateResponse_Body) Descriptor() ([]byte, []int) { - return file_session_grpc_service_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *CreateResponse_Body) GetId() []byte { - if x != nil { - return x.Id - } - return nil -} - -func (x *CreateResponse_Body) GetSessionKey() []byte { - if x != nil { - return x.SessionKey - } - return nil -} - -var File_session_grpc_service_proto protoreflect.FileDescriptor - -var file_session_grpc_service_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, - 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xc0, 0x02, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x45, 0x0a, - 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, - 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x5a, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x32, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, - 0x66, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0xa1, 0x02, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, - 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x12, 0x46, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, - 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, - 0x6d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x0d, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x79, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x37, - 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x32, 0x5f, 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x64, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x2e, - 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, - 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0xaa, 0x02, 0x1b, 0x4e, 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_session_grpc_service_proto_rawDescOnce sync.Once - file_session_grpc_service_proto_rawDescData = file_session_grpc_service_proto_rawDesc -) - -func file_session_grpc_service_proto_rawDescGZIP() []byte { - file_session_grpc_service_proto_rawDescOnce.Do(func() { - file_session_grpc_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_session_grpc_service_proto_rawDescData) - }) - return file_session_grpc_service_proto_rawDescData -} - -var file_session_grpc_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_session_grpc_service_proto_goTypes = []interface{}{ - (*CreateRequest)(nil), // 0: neo.fs.v2.session.CreateRequest - (*CreateResponse)(nil), // 1: neo.fs.v2.session.CreateResponse - (*CreateRequest_Body)(nil), // 2: neo.fs.v2.session.CreateRequest.Body - (*CreateResponse_Body)(nil), // 3: neo.fs.v2.session.CreateResponse.Body - (*RequestMetaHeader)(nil), // 4: neo.fs.v2.session.RequestMetaHeader - (*RequestVerificationHeader)(nil), // 5: neo.fs.v2.session.RequestVerificationHeader - (*ResponseMetaHeader)(nil), // 6: neo.fs.v2.session.ResponseMetaHeader - (*ResponseVerificationHeader)(nil), // 7: neo.fs.v2.session.ResponseVerificationHeader - (*grpc.OwnerID)(nil), // 8: neo.fs.v2.refs.OwnerID -} -var file_session_grpc_service_proto_depIdxs = []int32{ - 2, // 0: neo.fs.v2.session.CreateRequest.body:type_name -> neo.fs.v2.session.CreateRequest.Body - 4, // 1: neo.fs.v2.session.CreateRequest.meta_header:type_name -> neo.fs.v2.session.RequestMetaHeader - 5, // 2: neo.fs.v2.session.CreateRequest.verify_header:type_name -> neo.fs.v2.session.RequestVerificationHeader - 3, // 3: neo.fs.v2.session.CreateResponse.body:type_name -> neo.fs.v2.session.CreateResponse.Body - 6, // 4: neo.fs.v2.session.CreateResponse.meta_header:type_name -> neo.fs.v2.session.ResponseMetaHeader - 7, // 5: neo.fs.v2.session.CreateResponse.verify_header:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 8, // 6: neo.fs.v2.session.CreateRequest.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID - 0, // 7: neo.fs.v2.session.SessionService.Create:input_type -> neo.fs.v2.session.CreateRequest - 1, // 8: neo.fs.v2.session.SessionService.Create:output_type -> neo.fs.v2.session.CreateResponse - 8, // [8:9] is the sub-list for method output_type - 7, // [7:8] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_session_grpc_service_proto_init() } -func file_session_grpc_service_proto_init() { - if File_session_grpc_service_proto != nil { - return - } - file_session_grpc_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_session_grpc_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRequest_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateResponse_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_session_grpc_service_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_session_grpc_service_proto_goTypes, - DependencyIndexes: file_session_grpc_service_proto_depIdxs, - MessageInfos: file_session_grpc_service_proto_msgTypes, - }.Build() - File_session_grpc_service_proto = out.File - file_session_grpc_service_proto_rawDesc = nil - file_session_grpc_service_proto_goTypes = nil - file_session_grpc_service_proto_depIdxs = nil -} diff --git a/session/grpc/service_frostfs.pb.go b/session/grpc/service_frostfs.pb.go new file mode 100644 index 0000000..cfec4d6 --- /dev/null +++ b/session/grpc/service_frostfs.pb.go @@ -0,0 +1,781 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package session + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type CreateRequest_Body struct { + OwnerId *grpc.OwnerID `json:"ownerId"` + Expiration uint64 `json:"expiration"` +} + +var ( + _ encoding.ProtoMarshaler = (*CreateRequest_Body)(nil) + _ encoding.ProtoUnmarshaler = (*CreateRequest_Body)(nil) + _ json.Marshaler = (*CreateRequest_Body)(nil) + _ json.Unmarshaler = (*CreateRequest_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *CreateRequest_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.OwnerId) + size += proto.UInt64Size(2, x.Expiration) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *CreateRequest_Body) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *CreateRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Expiration != 0 { + mm.AppendUint64(2, x.Expiration) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *CreateRequest_Body) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "CreateRequest_Body") + } + switch fc.FieldNum { + case 1: // OwnerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "OwnerId") + } + x.OwnerId = new(grpc.OwnerID) + if err := x.OwnerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Expiration + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Expiration") + } + x.Expiration = data + } + } + return nil +} +func (x *CreateRequest_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *CreateRequest_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} +func (x *CreateRequest_Body) GetExpiration() uint64 { + if x != nil { + return x.Expiration + } + return 0 +} +func (x *CreateRequest_Body) SetExpiration(v uint64) { + x.Expiration = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *CreateRequest_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"ownerId\":" + out.RawString(prefix[1:]) + x.OwnerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"expiration\":" + out.RawString(prefix) + out.Uint64(x.Expiration) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *CreateRequest_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *CreateRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "ownerId": + { + var f *grpc.OwnerID + f = new(grpc.OwnerID) + f.UnmarshalEasyJSON(in) + x.OwnerId = f + } + case "expiration": + { + var f uint64 + f = in.Uint64() + x.Expiration = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type CreateRequest struct { + Body *CreateRequest_Body `json:"body"` + MetaHeader *RequestMetaHeader `json:"metaHeader"` + VerifyHeader *RequestVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*CreateRequest)(nil) + _ encoding.ProtoUnmarshaler = (*CreateRequest)(nil) + _ json.Marshaler = (*CreateRequest)(nil) + _ json.Unmarshaler = (*CreateRequest)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *CreateRequest) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.MetaHeader) + size += proto.NestedStructureSize(3, x.VerifyHeader) + return size +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *CreateRequest) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *CreateRequest) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *CreateRequest) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *CreateRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *CreateRequest) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "CreateRequest") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(CreateRequest_Body) + if err := x.Body.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MetaHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") + } + x.MetaHeader = new(RequestMetaHeader) + if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // VerifyHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") + } + x.VerifyHeader = new(RequestVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *CreateRequest) GetBody() *CreateRequest_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *CreateRequest) SetBody(v *CreateRequest_Body) { + x.Body = v +} +func (x *CreateRequest) GetMetaHeader() *RequestMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *CreateRequest) SetMetaHeader(v *RequestMetaHeader) { + x.MetaHeader = v +} +func (x *CreateRequest) GetVerifyHeader() *RequestVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *CreateRequest) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *CreateRequest) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *CreateRequest) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "body": + { + var f *CreateRequest_Body + f = new(CreateRequest_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *RequestMetaHeader + f = new(RequestMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *RequestVerificationHeader + f = new(RequestVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type CreateResponse_Body struct { + Id []byte `json:"id"` + SessionKey []byte `json:"sessionKey"` +} + +var ( + _ encoding.ProtoMarshaler = (*CreateResponse_Body)(nil) + _ encoding.ProtoUnmarshaler = (*CreateResponse_Body)(nil) + _ json.Marshaler = (*CreateResponse_Body)(nil) + _ json.Unmarshaler = (*CreateResponse_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *CreateResponse_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.Id) + size += proto.BytesSize(2, x.SessionKey) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *CreateResponse_Body) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *CreateResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Id) != 0 { + mm.AppendBytes(1, x.Id) + } + if len(x.SessionKey) != 0 { + mm.AppendBytes(2, x.SessionKey) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *CreateResponse_Body) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "CreateResponse_Body") + } + switch fc.FieldNum { + case 1: // Id + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Id") + } + x.Id = data + case 2: // SessionKey + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SessionKey") + } + x.SessionKey = data + } + } + return nil +} +func (x *CreateResponse_Body) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} +func (x *CreateResponse_Body) SetId(v []byte) { + x.Id = v +} +func (x *CreateResponse_Body) GetSessionKey() []byte { + if x != nil { + return x.SessionKey + } + return nil +} +func (x *CreateResponse_Body) SetSessionKey(v []byte) { + x.SessionKey = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *CreateResponse_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"id\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.Id) + } + { + const prefix string = ",\"sessionKey\":" + out.RawString(prefix) + out.Base64Bytes(x.SessionKey) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *CreateResponse_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *CreateResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "id": + { + var f []byte + f = in.Bytes() + x.Id = f + } + case "sessionKey": + { + var f []byte + f = in.Bytes() + x.SessionKey = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type CreateResponse struct { + Body *CreateResponse_Body `json:"body"` + MetaHeader *ResponseMetaHeader `json:"metaHeader"` + VerifyHeader *ResponseVerificationHeader `json:"verifyHeader"` +} + +var ( + _ encoding.ProtoMarshaler = (*CreateResponse)(nil) + _ encoding.ProtoUnmarshaler = (*CreateResponse)(nil) + _ json.Marshaler = (*CreateResponse)(nil) + _ json.Unmarshaler = (*CreateResponse)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *CreateResponse) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.MetaHeader) + size += proto.NestedStructureSize(3, x.VerifyHeader) + return size +} + +// ReadSignedData fills buf with signed data of x. +// If buffer length is less than x.SignedDataSize(), new buffer is allocated. +// +// Returns any error encountered which did not allow writing the data completely. +// Otherwise, returns the buffer in which the data is written. +// +// Structures with the same field values have the same signed data. +func (x *CreateResponse) SignedDataSize() int { + return x.GetBody().StableSize() +} + +// SignedDataSize returns size of the request signed data in bytes. +// +// Structures with the same field values have the same signed data size. +func (x *CreateResponse) ReadSignedData(buf []byte) ([]byte, error) { + return x.GetBody().MarshalProtobuf(buf), nil +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *CreateResponse) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *CreateResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) + } + if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *CreateResponse) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "CreateResponse") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(CreateResponse_Body) + if err := x.Body.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MetaHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MetaHeader") + } + x.MetaHeader = new(ResponseMetaHeader) + if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // VerifyHeader + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader") + } + x.VerifyHeader = new(ResponseVerificationHeader) + if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *CreateResponse) GetBody() *CreateResponse_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *CreateResponse) SetBody(v *CreateResponse_Body) { + x.Body = v +} +func (x *CreateResponse) GetMetaHeader() *ResponseMetaHeader { + if x != nil { + return x.MetaHeader + } + return nil +} +func (x *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) { + x.MetaHeader = v +} +func (x *CreateResponse) GetVerifyHeader() *ResponseVerificationHeader { + if x != nil { + return x.VerifyHeader + } + return nil +} +func (x *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) { + x.VerifyHeader = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *CreateResponse) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } + { + const prefix string = ",\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *CreateResponse) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *CreateResponse) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "body": + { + var f *CreateResponse_Body + f = new(CreateResponse_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "metaHeader": + { + var f *ResponseMetaHeader + f = new(ResponseMetaHeader) + f.UnmarshalEasyJSON(in) + x.MetaHeader = f + } + case "verifyHeader": + { + var f *ResponseVerificationHeader + f = new(ResponseVerificationHeader) + f.UnmarshalEasyJSON(in) + x.VerifyHeader = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/session/grpc/service_frostfs_fuzz.go b/session/grpc/service_frostfs_fuzz.go new file mode 100644 index 0000000..759361c --- /dev/null +++ b/session/grpc/service_frostfs_fuzz.go @@ -0,0 +1,45 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package session + +func DoFuzzProtoCreateRequest(data []byte) int { + msg := new(CreateRequest) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONCreateRequest(data []byte) int { + msg := new(CreateRequest) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoCreateResponse(data []byte) int { + msg := new(CreateResponse) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONCreateResponse(data []byte) int { + msg := new(CreateResponse) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/session/grpc/service_frostfs_test.go b/session/grpc/service_frostfs_test.go new file mode 100644 index 0000000..fc8664e --- /dev/null +++ b/session/grpc/service_frostfs_test.go @@ -0,0 +1,31 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package session + +import ( + testing "testing" +) + +func FuzzProtoCreateRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoCreateRequest(data) + }) +} +func FuzzJSONCreateRequest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONCreateRequest(data) + }) +} +func FuzzProtoCreateResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoCreateResponse(data) + }) +} +func FuzzJSONCreateResponse(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONCreateResponse(data) + }) +} diff --git a/session/grpc/types.go b/session/grpc/types.go deleted file mode 100644 index 857c45e..0000000 --- a/session/grpc/types.go +++ /dev/null @@ -1,246 +0,0 @@ -package session - -import ( - acl "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - status "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" -) - -// SetKey sets key to the X-Header. -func (m *XHeader) SetKey(v string) { - m.Key = v -} - -// SetValue sets value of the X-Header. -func (m *XHeader) SetValue(v string) { - m.Value = v -} - -// SetExp sets epoch number of the token expiration. -func (m *SessionToken_Body_TokenLifetime) SetExp(v uint64) { - m.Exp = v -} - -// SetNbf sets starting epoch number of the token. -func (m *SessionToken_Body_TokenLifetime) SetNbf(v uint64) { - m.Nbf = v -} - -// SetIat sets the number of the epoch in which the token was issued. -func (m *SessionToken_Body_TokenLifetime) SetIat(v uint64) { - m.Iat = v -} - -// SetId sets identifier of the session token. -func (m *SessionToken_Body) SetId(v []byte) { - m.Id = v -} - -// SetOwnerId sets identifier of the session token owner. -func (m *SessionToken_Body) SetOwnerId(v *refs.OwnerID) { - m.OwnerId = v -} - -// SetLifetime sets lifetime of the session token. -func (m *SessionToken_Body) SetLifetime(v *SessionToken_Body_TokenLifetime) { - m.Lifetime = v -} - -// SetSessionKey sets public session key in a binary format. -func (m *SessionToken_Body) SetSessionKey(v []byte) { - m.SessionKey = v -} - -// SetObjectAddressContext sets object context of the session token. -func (m *SessionToken_Body) SetObject(v *ObjectSessionContext) { - m.Context = &SessionToken_Body_Object{ - Object: v, - } -} - -// SetContainer sets container context of the session token. -func (m *SessionToken_Body) SetContainer(v *ContainerSessionContext) { - m.Context = &SessionToken_Body_Container{ - Container: v, - } -} - -// SetTarget specifies objects involved in the object session. -func (m *ObjectSessionContext) SetTarget(tgt *ObjectSessionContext_Target) { - m.Target = tgt -} - -// SetVerb sets type of request for which the token is issued. -func (m *ObjectSessionContext) SetVerb(v ObjectSessionContext_Verb) { - m.Verb = v -} - -// SetVerb sets type of request for which the token is issued. -func (x *ContainerSessionContext) SetVerb(v ContainerSessionContext_Verb) { - x.Verb = v -} - -// SetWildcard sets wildcard flag of the container session. -func (x *ContainerSessionContext) SetWildcard(v bool) { - x.Wildcard = v -} - -// SetContainerId sets identifier of the container related to the session. -func (x *ContainerSessionContext) SetContainerId(v *refs.ContainerID) { - x.ContainerId = v -} - -// SetBody sets session token body. -func (m *SessionToken) SetBody(v *SessionToken_Body) { - m.Body = v -} - -// SetSignature sets session token signature. -func (m *SessionToken) SetSignature(v *refs.Signature) { - m.Signature = v -} - -// SetVersion sets client protocol version. -func (m *RequestMetaHeader) SetVersion(v *refs.Version) { - m.Version = v -} - -// SetEpoch sets client local epoch. -func (m *RequestMetaHeader) SetEpoch(v uint64) { - m.Epoch = v -} - -// SetTtl sets request TTL. -func (m *RequestMetaHeader) SetTtl(v uint32) { - m.Ttl = v -} - -// SetXHeaders sets request X-Headers. -func (m *RequestMetaHeader) SetXHeaders(v []*XHeader) { - m.XHeaders = v -} - -// SetSessionToken sets session token of the request. -func (m *RequestMetaHeader) SetSessionToken(v *SessionToken) { - m.SessionToken = v -} - -// SetBearerToken sets bearer token of the request. -func (m *RequestMetaHeader) SetBearerToken(v *acl.BearerToken) { - m.BearerToken = v -} - -// SetOrigin sets origin request meta header. -func (m *RequestMetaHeader) SetOrigin(v *RequestMetaHeader) { - m.Origin = v -} - -// GetNetworkMagic returns NeoFS network magic. -func (m *RequestMetaHeader) GetNetworkMagic() uint64 { - if m != nil { - return m.MagicNumber - } - - return 0 -} - -// SetMagicNumber sets NeoFS network magic. -func (m *RequestMetaHeader) SetMagicNumber(v uint64) { - m.MagicNumber = v -} - -// SetVersion sets server protocol version. -func (m *ResponseMetaHeader) SetVersion(v *refs.Version) { - m.Version = v -} - -// SetEpoch sets server local epoch. -func (m *ResponseMetaHeader) SetEpoch(v uint64) { - m.Epoch = v -} - -// SetTtl sets response TTL. -func (m *ResponseMetaHeader) SetTtl(v uint32) { - m.Ttl = v -} - -// SetXHeaders sets response X-Headers. -func (m *ResponseMetaHeader) SetXHeaders(v []*XHeader) { - m.XHeaders = v -} - -// SetOrigin sets origin response meta header. -func (m *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader) { - m.Origin = v -} - -// SetStatus sets response status. -func (m *ResponseMetaHeader) SetStatus(v *status.Status) { - m.Status = v -} - -// SetBodySignature sets signature of the request body. -func (m *RequestVerificationHeader) SetBodySignature(v *refs.Signature) { - m.BodySignature = v -} - -// SetMetaSignature sets signature of the request meta. -func (m *RequestVerificationHeader) SetMetaSignature(v *refs.Signature) { - m.MetaSignature = v -} - -// SetOriginSignature sets signature of the origin verification header of the request. -func (m *RequestVerificationHeader) SetOriginSignature(v *refs.Signature) { - m.OriginSignature = v -} - -// SetOrigin sets origin verification header of the request. -func (m *RequestVerificationHeader) SetOrigin(v *RequestVerificationHeader) { - m.Origin = v -} - -// SetBodySignature sets signature of the response body. -func (m *ResponseVerificationHeader) SetBodySignature(v *refs.Signature) { - m.BodySignature = v -} - -// SetMetaSignature sets signature of the response meta. -func (m *ResponseVerificationHeader) SetMetaSignature(v *refs.Signature) { - m.MetaSignature = v -} - -// SetOriginSignature sets signature of the origin verification header of the response. -func (m *ResponseVerificationHeader) SetOriginSignature(v *refs.Signature) { - m.OriginSignature = v -} - -// SetOrigin sets origin verification header of the response. -func (m *ResponseVerificationHeader) SetOrigin(v *ResponseVerificationHeader) { - m.Origin = v -} - -// FromString parses ObjectSessionContext_Verb from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *ObjectSessionContext_Verb) FromString(s string) bool { - i, ok := ObjectSessionContext_Verb_value[s] - if ok { - *x = ObjectSessionContext_Verb(i) - } - - return ok -} - -// FromString parses ContainerSessionContext_Verb from a string representation, -// It is a reverse action to String(). -// -// Returns true if s was parsed successfully. -func (x *ContainerSessionContext_Verb) FromString(s string) bool { - i, ok := ContainerSessionContext_Verb_value[s] - if ok { - *x = ContainerSessionContext_Verb(i) - } - - return ok -} diff --git a/session/grpc/types.pb.go b/session/grpc/types.pb.go deleted file mode 100644 index 9f51743..0000000 --- a/session/grpc/types.pb.go +++ /dev/null @@ -1,1451 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: session/grpc/types.proto - -package session - -import ( - grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - grpc2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Object request verbs -type ObjectSessionContext_Verb int32 - -const ( - // Unknown verb - ObjectSessionContext_VERB_UNSPECIFIED ObjectSessionContext_Verb = 0 - // Refers to object.Put RPC call - ObjectSessionContext_PUT ObjectSessionContext_Verb = 1 - // Refers to object.Get RPC call - ObjectSessionContext_GET ObjectSessionContext_Verb = 2 - // Refers to object.Head RPC call - ObjectSessionContext_HEAD ObjectSessionContext_Verb = 3 - // Refers to object.Search RPC call - ObjectSessionContext_SEARCH ObjectSessionContext_Verb = 4 - // Refers to object.Delete RPC call - ObjectSessionContext_DELETE ObjectSessionContext_Verb = 5 - // Refers to object.GetRange RPC call - ObjectSessionContext_RANGE ObjectSessionContext_Verb = 6 - // Refers to object.GetRangeHash RPC call - ObjectSessionContext_RANGEHASH ObjectSessionContext_Verb = 7 - // Refers to object.Patch RPC call - ObjectSessionContext_PATCH ObjectSessionContext_Verb = 8 -) - -// Enum value maps for ObjectSessionContext_Verb. -var ( - ObjectSessionContext_Verb_name = map[int32]string{ - 0: "VERB_UNSPECIFIED", - 1: "PUT", - 2: "GET", - 3: "HEAD", - 4: "SEARCH", - 5: "DELETE", - 6: "RANGE", - 7: "RANGEHASH", - 8: "PATCH", - } - ObjectSessionContext_Verb_value = map[string]int32{ - "VERB_UNSPECIFIED": 0, - "PUT": 1, - "GET": 2, - "HEAD": 3, - "SEARCH": 4, - "DELETE": 5, - "RANGE": 6, - "RANGEHASH": 7, - "PATCH": 8, - } -) - -func (x ObjectSessionContext_Verb) Enum() *ObjectSessionContext_Verb { - p := new(ObjectSessionContext_Verb) - *p = x - return p -} - -func (x ObjectSessionContext_Verb) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ObjectSessionContext_Verb) Descriptor() protoreflect.EnumDescriptor { - return file_session_grpc_types_proto_enumTypes[0].Descriptor() -} - -func (ObjectSessionContext_Verb) Type() protoreflect.EnumType { - return &file_session_grpc_types_proto_enumTypes[0] -} - -func (x ObjectSessionContext_Verb) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ObjectSessionContext_Verb.Descriptor instead. -func (ObjectSessionContext_Verb) EnumDescriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{0, 0} -} - -// Container request verbs -type ContainerSessionContext_Verb int32 - -const ( - // Unknown verb - ContainerSessionContext_VERB_UNSPECIFIED ContainerSessionContext_Verb = 0 - // Refers to container.Put RPC call - ContainerSessionContext_PUT ContainerSessionContext_Verb = 1 - // Refers to container.Delete RPC call - ContainerSessionContext_DELETE ContainerSessionContext_Verb = 2 - // Refers to container.SetExtendedACL RPC call - ContainerSessionContext_SETEACL ContainerSessionContext_Verb = 3 -) - -// Enum value maps for ContainerSessionContext_Verb. -var ( - ContainerSessionContext_Verb_name = map[int32]string{ - 0: "VERB_UNSPECIFIED", - 1: "PUT", - 2: "DELETE", - 3: "SETEACL", - } - ContainerSessionContext_Verb_value = map[string]int32{ - "VERB_UNSPECIFIED": 0, - "PUT": 1, - "DELETE": 2, - "SETEACL": 3, - } -) - -func (x ContainerSessionContext_Verb) Enum() *ContainerSessionContext_Verb { - p := new(ContainerSessionContext_Verb) - *p = x - return p -} - -func (x ContainerSessionContext_Verb) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ContainerSessionContext_Verb) Descriptor() protoreflect.EnumDescriptor { - return file_session_grpc_types_proto_enumTypes[1].Descriptor() -} - -func (ContainerSessionContext_Verb) Type() protoreflect.EnumType { - return &file_session_grpc_types_proto_enumTypes[1] -} - -func (x ContainerSessionContext_Verb) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ContainerSessionContext_Verb.Descriptor instead. -func (ContainerSessionContext_Verb) EnumDescriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{1, 0} -} - -// Context information for Session Tokens related to ObjectService requests -type ObjectSessionContext struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Type of request for which the token is issued - Verb ObjectSessionContext_Verb `protobuf:"varint,1,opt,name=verb,proto3,enum=neo.fs.v2.session.ObjectSessionContext_Verb" json:"verb,omitempty"` - // Object session target. MUST be correctly formed and set. If `objects` - // field is not empty, then the session applies only to these elements, - // otherwise, to all objects from the specified container. - Target *ObjectSessionContext_Target `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` -} - -func (x *ObjectSessionContext) Reset() { - *x = ObjectSessionContext{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObjectSessionContext) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObjectSessionContext) ProtoMessage() {} - -func (x *ObjectSessionContext) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ObjectSessionContext.ProtoReflect.Descriptor instead. -func (*ObjectSessionContext) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *ObjectSessionContext) GetVerb() ObjectSessionContext_Verb { - if x != nil { - return x.Verb - } - return ObjectSessionContext_VERB_UNSPECIFIED -} - -func (x *ObjectSessionContext) GetTarget() *ObjectSessionContext_Target { - if x != nil { - return x.Target - } - return nil -} - -// Context information for Session Tokens related to ContainerService requests. -type ContainerSessionContext struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Type of request for which the token is issued - Verb ContainerSessionContext_Verb `protobuf:"varint,1,opt,name=verb,proto3,enum=neo.fs.v2.session.ContainerSessionContext_Verb" json:"verb,omitempty"` - // Spreads the action to all owner containers. - // If set, container_id field is ignored. - Wildcard bool `protobuf:"varint,2,opt,name=wildcard,proto3" json:"wildcard,omitempty"` - // Particular container to which the action applies. - // Ignored if wildcard flag is set. - ContainerId *grpc.ContainerID `protobuf:"bytes,3,opt,name=container_id,json=containerID,proto3" json:"container_id,omitempty"` -} - -func (x *ContainerSessionContext) Reset() { - *x = ContainerSessionContext{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ContainerSessionContext) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContainerSessionContext) ProtoMessage() {} - -func (x *ContainerSessionContext) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ContainerSessionContext.ProtoReflect.Descriptor instead. -func (*ContainerSessionContext) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{1} -} - -func (x *ContainerSessionContext) GetVerb() ContainerSessionContext_Verb { - if x != nil { - return x.Verb - } - return ContainerSessionContext_VERB_UNSPECIFIED -} - -func (x *ContainerSessionContext) GetWildcard() bool { - if x != nil { - return x.Wildcard - } - return false -} - -func (x *ContainerSessionContext) GetContainerId() *grpc.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} - -// NeoFS Session Token. -type SessionToken struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Session Token contains the proof of trust between peers to be attached in - // requests for further verification. Please see corresponding section of - // NeoFS Technical Specification for details. - Body *SessionToken_Body `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - // Signature of `SessionToken` information - Signature *grpc.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (x *SessionToken) Reset() { - *x = SessionToken{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionToken) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionToken) ProtoMessage() {} - -func (x *SessionToken) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionToken.ProtoReflect.Descriptor instead. -func (*SessionToken) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{2} -} - -func (x *SessionToken) GetBody() *SessionToken_Body { - if x != nil { - return x.Body - } - return nil -} - -func (x *SessionToken) GetSignature() *grpc.Signature { - if x != nil { - return x.Signature - } - return nil -} - -// Extended headers for Request/Response. They may contain any user-defined -// headers to be interpreted on application level. -// -// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests -// or Responses with duplicated header names or headers with empty values will -// be considered invalid. -// -// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` -// is deprecated) prefix that affect system behaviour: -// -// - [ __SYSTEM__NETMAP_EPOCH ] \ -// (`__NEOFS__NETMAP_EPOCH` is deprecated) \ -// Netmap epoch to use for object placement calculation. The `value` is string -// encoded `uint64` in decimal presentation. If set to '0' or not set, the -// current epoch only will be used. -// - [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ -// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ -// If object can't be found using current epoch's netmap, this header limits -// how many past epochs the node can look up through. The `value` is string -// encoded `uint64` in decimal presentation. If set to '0' or not set, only -// the current epoch will be used. -type XHeader struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Key of the X-Header - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Value of the X-Header - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *XHeader) Reset() { - *x = XHeader{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *XHeader) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*XHeader) ProtoMessage() {} - -func (x *XHeader) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use XHeader.ProtoReflect.Descriptor instead. -func (*XHeader) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{3} -} - -func (x *XHeader) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *XHeader) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// Meta information attached to the request. When forwarded between peers, -// request meta headers are folded in matryoshka style. -type RequestMetaHeader struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Peer's API version used - Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Peer's local epoch number. Set to 0 if unknown. - Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` - // Maximum number of intermediate nodes in the request route - Ttl uint32 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"` - // Request X-Headers - XHeaders []*XHeader `protobuf:"bytes,4,rep,name=x_headers,json=xHeaders,proto3" json:"x_headers,omitempty"` - // Session token within which the request is sent - SessionToken *SessionToken `protobuf:"bytes,5,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"` - // `BearerToken` with eACL overrides for the request - BearerToken *grpc1.BearerToken `protobuf:"bytes,6,opt,name=bearer_token,json=bearerToken,proto3" json:"bearer_token,omitempty"` - // `RequestMetaHeader` of the origin request - Origin *RequestMetaHeader `protobuf:"bytes,7,opt,name=origin,proto3" json:"origin,omitempty"` - // NeoFS network magic. Must match the value for the network - // that the server belongs to. - MagicNumber uint64 `protobuf:"varint,8,opt,name=magic_number,json=magicNumber,proto3" json:"magic_number,omitempty"` -} - -func (x *RequestMetaHeader) Reset() { - *x = RequestMetaHeader{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RequestMetaHeader) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RequestMetaHeader) ProtoMessage() {} - -func (x *RequestMetaHeader) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RequestMetaHeader.ProtoReflect.Descriptor instead. -func (*RequestMetaHeader) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{4} -} - -func (x *RequestMetaHeader) GetVersion() *grpc.Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *RequestMetaHeader) GetEpoch() uint64 { - if x != nil { - return x.Epoch - } - return 0 -} - -func (x *RequestMetaHeader) GetTtl() uint32 { - if x != nil { - return x.Ttl - } - return 0 -} - -func (x *RequestMetaHeader) GetXHeaders() []*XHeader { - if x != nil { - return x.XHeaders - } - return nil -} - -func (x *RequestMetaHeader) GetSessionToken() *SessionToken { - if x != nil { - return x.SessionToken - } - return nil -} - -func (x *RequestMetaHeader) GetBearerToken() *grpc1.BearerToken { - if x != nil { - return x.BearerToken - } - return nil -} - -func (x *RequestMetaHeader) GetOrigin() *RequestMetaHeader { - if x != nil { - return x.Origin - } - return nil -} - -func (x *RequestMetaHeader) GetMagicNumber() uint64 { - if x != nil { - return x.MagicNumber - } - return 0 -} - -// Information about the response -type ResponseMetaHeader struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Peer's API version used - Version *grpc.Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Peer's local epoch number - Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` - // Maximum number of intermediate nodes in the request route - Ttl uint32 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"` - // Response X-Headers - XHeaders []*XHeader `protobuf:"bytes,4,rep,name=x_headers,json=xHeaders,proto3" json:"x_headers,omitempty"` - // `ResponseMetaHeader` of the origin request - Origin *ResponseMetaHeader `protobuf:"bytes,5,opt,name=origin,proto3" json:"origin,omitempty"` - // Status return - Status *grpc2.Status `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *ResponseMetaHeader) Reset() { - *x = ResponseMetaHeader{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResponseMetaHeader) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResponseMetaHeader) ProtoMessage() {} - -func (x *ResponseMetaHeader) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResponseMetaHeader.ProtoReflect.Descriptor instead. -func (*ResponseMetaHeader) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{5} -} - -func (x *ResponseMetaHeader) GetVersion() *grpc.Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *ResponseMetaHeader) GetEpoch() uint64 { - if x != nil { - return x.Epoch - } - return 0 -} - -func (x *ResponseMetaHeader) GetTtl() uint32 { - if x != nil { - return x.Ttl - } - return 0 -} - -func (x *ResponseMetaHeader) GetXHeaders() []*XHeader { - if x != nil { - return x.XHeaders - } - return nil -} - -func (x *ResponseMetaHeader) GetOrigin() *ResponseMetaHeader { - if x != nil { - return x.Origin - } - return nil -} - -func (x *ResponseMetaHeader) GetStatus() *grpc2.Status { - if x != nil { - return x.Status - } - return nil -} - -// Verification info for the request signed by all intermediate nodes. -type RequestVerificationHeader struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Request Body signature. Should be generated once by the request initiator. - BodySignature *grpc.Signature `protobuf:"bytes,1,opt,name=body_signature,json=bodySignature,proto3" json:"body_signature,omitempty"` - // Request Meta signature is added and signed by each intermediate node - MetaSignature *grpc.Signature `protobuf:"bytes,2,opt,name=meta_signature,json=metaSignature,proto3" json:"meta_signature,omitempty"` - // Signature of previous hops - OriginSignature *grpc.Signature `protobuf:"bytes,3,opt,name=origin_signature,json=originSignature,proto3" json:"origin_signature,omitempty"` - // Chain of previous hops signatures - Origin *RequestVerificationHeader `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` -} - -func (x *RequestVerificationHeader) Reset() { - *x = RequestVerificationHeader{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RequestVerificationHeader) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RequestVerificationHeader) ProtoMessage() {} - -func (x *RequestVerificationHeader) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RequestVerificationHeader.ProtoReflect.Descriptor instead. -func (*RequestVerificationHeader) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{6} -} - -func (x *RequestVerificationHeader) GetBodySignature() *grpc.Signature { - if x != nil { - return x.BodySignature - } - return nil -} - -func (x *RequestVerificationHeader) GetMetaSignature() *grpc.Signature { - if x != nil { - return x.MetaSignature - } - return nil -} - -func (x *RequestVerificationHeader) GetOriginSignature() *grpc.Signature { - if x != nil { - return x.OriginSignature - } - return nil -} - -func (x *RequestVerificationHeader) GetOrigin() *RequestVerificationHeader { - if x != nil { - return x.Origin - } - return nil -} - -// Verification info for the response signed by all intermediate nodes -type ResponseVerificationHeader struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Response Body signature. Should be generated once by an answering node. - BodySignature *grpc.Signature `protobuf:"bytes,1,opt,name=body_signature,json=bodySignature,proto3" json:"body_signature,omitempty"` - // Response Meta signature is added and signed by each intermediate node - MetaSignature *grpc.Signature `protobuf:"bytes,2,opt,name=meta_signature,json=metaSignature,proto3" json:"meta_signature,omitempty"` - // Signature of previous hops - OriginSignature *grpc.Signature `protobuf:"bytes,3,opt,name=origin_signature,json=originSignature,proto3" json:"origin_signature,omitempty"` - // Chain of previous hops signatures - Origin *ResponseVerificationHeader `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` -} - -func (x *ResponseVerificationHeader) Reset() { - *x = ResponseVerificationHeader{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResponseVerificationHeader) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResponseVerificationHeader) ProtoMessage() {} - -func (x *ResponseVerificationHeader) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResponseVerificationHeader.ProtoReflect.Descriptor instead. -func (*ResponseVerificationHeader) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{7} -} - -func (x *ResponseVerificationHeader) GetBodySignature() *grpc.Signature { - if x != nil { - return x.BodySignature - } - return nil -} - -func (x *ResponseVerificationHeader) GetMetaSignature() *grpc.Signature { - if x != nil { - return x.MetaSignature - } - return nil -} - -func (x *ResponseVerificationHeader) GetOriginSignature() *grpc.Signature { - if x != nil { - return x.OriginSignature - } - return nil -} - -func (x *ResponseVerificationHeader) GetOrigin() *ResponseVerificationHeader { - if x != nil { - return x.Origin - } - return nil -} - -// Carries objects involved in the object session. -type ObjectSessionContext_Target struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Indicates which container the session is spread to. Field MUST be set - // and correct. - Container *grpc.ContainerID `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"` - // Indicates which objects the session is spread to. Objects are expected - // to be stored in the NeoFS container referenced by `container` field. - // Each element MUST have correct format. - Objects []*grpc.ObjectID `protobuf:"bytes,2,rep,name=objects,proto3" json:"objects,omitempty"` -} - -func (x *ObjectSessionContext_Target) Reset() { - *x = ObjectSessionContext_Target{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObjectSessionContext_Target) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObjectSessionContext_Target) ProtoMessage() {} - -func (x *ObjectSessionContext_Target) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ObjectSessionContext_Target.ProtoReflect.Descriptor instead. -func (*ObjectSessionContext_Target) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *ObjectSessionContext_Target) GetContainer() *grpc.ContainerID { - if x != nil { - return x.Container - } - return nil -} - -func (x *ObjectSessionContext_Target) GetObjects() []*grpc.ObjectID { - if x != nil { - return x.Objects - } - return nil -} - -// Session Token body -type SessionToken_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Token identifier is a valid UUIDv4 in binary form - Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Identifier of the session initiator - OwnerId *grpc.OwnerID `protobuf:"bytes,2,opt,name=owner_id,json=ownerID,proto3" json:"owner_id,omitempty"` - // Lifetime of the session - Lifetime *SessionToken_Body_TokenLifetime `protobuf:"bytes,3,opt,name=lifetime,proto3" json:"lifetime,omitempty"` - // Public key used in session - SessionKey []byte `protobuf:"bytes,4,opt,name=session_key,json=sessionKey,proto3" json:"session_key,omitempty"` - // Session Context information - // - // Types that are assignable to Context: - // - // *SessionToken_Body_Object - // *SessionToken_Body_Container - Context isSessionToken_Body_Context `protobuf_oneof:"context"` -} - -func (x *SessionToken_Body) Reset() { - *x = SessionToken_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionToken_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionToken_Body) ProtoMessage() {} - -func (x *SessionToken_Body) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionToken_Body.ProtoReflect.Descriptor instead. -func (*SessionToken_Body) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *SessionToken_Body) GetId() []byte { - if x != nil { - return x.Id - } - return nil -} - -func (x *SessionToken_Body) GetOwnerId() *grpc.OwnerID { - if x != nil { - return x.OwnerId - } - return nil -} - -func (x *SessionToken_Body) GetLifetime() *SessionToken_Body_TokenLifetime { - if x != nil { - return x.Lifetime - } - return nil -} - -func (x *SessionToken_Body) GetSessionKey() []byte { - if x != nil { - return x.SessionKey - } - return nil -} - -func (m *SessionToken_Body) GetContext() isSessionToken_Body_Context { - if m != nil { - return m.Context - } - return nil -} - -func (x *SessionToken_Body) GetObject() *ObjectSessionContext { - if x, ok := x.GetContext().(*SessionToken_Body_Object); ok { - return x.Object - } - return nil -} - -func (x *SessionToken_Body) GetContainer() *ContainerSessionContext { - if x, ok := x.GetContext().(*SessionToken_Body_Container); ok { - return x.Container - } - return nil -} - -type isSessionToken_Body_Context interface { - isSessionToken_Body_Context() -} - -type SessionToken_Body_Object struct { - // ObjectService session context - Object *ObjectSessionContext `protobuf:"bytes,5,opt,name=object,proto3,oneof"` -} - -type SessionToken_Body_Container struct { - // ContainerService session context - Container *ContainerSessionContext `protobuf:"bytes,6,opt,name=container,proto3,oneof"` -} - -func (*SessionToken_Body_Object) isSessionToken_Body_Context() {} - -func (*SessionToken_Body_Container) isSessionToken_Body_Context() {} - -// Lifetime parameters of the token. Field names taken from rfc7519. -type SessionToken_Body_TokenLifetime struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Expiration Epoch - Exp uint64 `protobuf:"varint,1,opt,name=exp,proto3" json:"exp,omitempty"` - // Not valid before Epoch - Nbf uint64 `protobuf:"varint,2,opt,name=nbf,proto3" json:"nbf,omitempty"` - // Issued at Epoch - Iat uint64 `protobuf:"varint,3,opt,name=iat,proto3" json:"iat,omitempty"` -} - -func (x *SessionToken_Body_TokenLifetime) Reset() { - *x = SessionToken_Body_TokenLifetime{} - if protoimpl.UnsafeEnabled { - mi := &file_session_grpc_types_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionToken_Body_TokenLifetime) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionToken_Body_TokenLifetime) ProtoMessage() {} - -func (x *SessionToken_Body_TokenLifetime) ProtoReflect() protoreflect.Message { - mi := &file_session_grpc_types_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionToken_Body_TokenLifetime.ProtoReflect.Descriptor instead. -func (*SessionToken_Body_TokenLifetime) Descriptor() ([]byte, []int) { - return file_session_grpc_types_proto_rawDescGZIP(), []int{2, 0, 0} -} - -func (x *SessionToken_Body_TokenLifetime) GetExp() uint64 { - if x != nil { - return x.Exp - } - return 0 -} - -func (x *SessionToken_Body_TokenLifetime) GetNbf() uint64 { - if x != nil { - return x.Nbf - } - return 0 -} - -func (x *SessionToken_Body_TokenLifetime) GetIat() uint64 { - if x != nil { - return x.Iat - } - return 0 -} - -var File_session_grpc_types_proto protoreflect.FileDescriptor - -var file_session_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x15, 0x72, - 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x61, 0x63, 0x6c, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x90, 0x03, 0x0a, 0x14, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x40, 0x0a, 0x04, - 0x76, 0x65, 0x72, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x78, 0x74, 0x2e, 0x56, 0x65, 0x72, 0x62, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12, 0x46, - 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x1a, 0x77, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x12, 0x39, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, - 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 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, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, - 0x75, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x45, 0x52, 0x42, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, - 0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x02, 0x12, - 0x08, 0x0a, 0x04, 0x48, 0x45, 0x41, 0x44, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x45, 0x41, - 0x52, 0x43, 0x48, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, - 0x05, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, - 0x52, 0x41, 0x4e, 0x47, 0x45, 0x48, 0x41, 0x53, 0x48, 0x10, 0x07, 0x12, 0x09, 0x0a, 0x05, 0x50, - 0x41, 0x54, 0x43, 0x48, 0x10, 0x08, 0x22, 0xfa, 0x01, 0x0a, 0x17, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x76, 0x65, 0x72, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x2f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x56, 0x65, 0x72, - 0x62, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x69, 0x6c, 0x64, 0x63, - 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x6c, 0x64, 0x63, - 0x61, 0x72, 0x64, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, - 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x49, 0x44, 0x22, 0x3e, 0x0a, 0x04, 0x56, 0x65, 0x72, 0x62, 0x12, 0x14, 0x0a, 0x10, 0x56, - 0x45, 0x52, 0x42, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, - 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x54, 0x45, 0x41, 0x43, - 0x4c, 0x10, 0x03, 0x22, 0xa0, 0x04, 0x0a, 0x0c, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x38, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 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, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x37, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, - 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x9c, 0x03, 0x0a, 0x04, 0x42, 0x6f, 0x64, 0x79, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, - 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, 0x4e, 0x0a, 0x08, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, - 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x08, 0x6c, 0x69, 0x66, 0x65, - 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x41, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, - 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x4a, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x1a, 0x45, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, - 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x62, 0x66, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6e, 0x62, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x61, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x69, 0x61, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x31, 0x0a, 0x07, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 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, 0x22, 0x8d, 0x03, 0x0a, 0x11, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 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, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x37, 0x0a, 0x09, 0x78, 0x5f, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x08, 0x78, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x62, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x61, 0x63, 0x6c, 0x2e, - 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0b, 0x62, 0x65, 0x61, - 0x72, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3c, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x18, 0x07, 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, 0x06, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x5f, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, - 0x67, 0x69, 0x63, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x99, 0x02, 0x0a, 0x12, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x48, 0x65, 0x61, 0x64, 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, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x37, 0x0a, 0x09, 0x78, - 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2e, 0x58, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x08, 0x78, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x05, - 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, 0x06, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xab, 0x02, 0x0a, 0x19, 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, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, - 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, 0x6f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, - 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 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, 0x06, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x22, 0xad, 0x02, 0x0a, 0x1a, 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, 0x12, 0x40, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, - 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, - 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, - 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x45, 0x0a, 0x06, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 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, 0x06, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x42, 0x64, 0x5a, 0x44, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, - 0x66, 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, - 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x3b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0xaa, 0x02, 0x1b, 0x4e, 0x65, - 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, - 0x49, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_session_grpc_types_proto_rawDescOnce sync.Once - file_session_grpc_types_proto_rawDescData = file_session_grpc_types_proto_rawDesc -) - -func file_session_grpc_types_proto_rawDescGZIP() []byte { - file_session_grpc_types_proto_rawDescOnce.Do(func() { - file_session_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_session_grpc_types_proto_rawDescData) - }) - return file_session_grpc_types_proto_rawDescData -} - -var file_session_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_session_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_session_grpc_types_proto_goTypes = []interface{}{ - (ObjectSessionContext_Verb)(0), // 0: neo.fs.v2.session.ObjectSessionContext.Verb - (ContainerSessionContext_Verb)(0), // 1: neo.fs.v2.session.ContainerSessionContext.Verb - (*ObjectSessionContext)(nil), // 2: neo.fs.v2.session.ObjectSessionContext - (*ContainerSessionContext)(nil), // 3: neo.fs.v2.session.ContainerSessionContext - (*SessionToken)(nil), // 4: neo.fs.v2.session.SessionToken - (*XHeader)(nil), // 5: neo.fs.v2.session.XHeader - (*RequestMetaHeader)(nil), // 6: neo.fs.v2.session.RequestMetaHeader - (*ResponseMetaHeader)(nil), // 7: neo.fs.v2.session.ResponseMetaHeader - (*RequestVerificationHeader)(nil), // 8: neo.fs.v2.session.RequestVerificationHeader - (*ResponseVerificationHeader)(nil), // 9: neo.fs.v2.session.ResponseVerificationHeader - (*ObjectSessionContext_Target)(nil), // 10: neo.fs.v2.session.ObjectSessionContext.Target - (*SessionToken_Body)(nil), // 11: neo.fs.v2.session.SessionToken.Body - (*SessionToken_Body_TokenLifetime)(nil), // 12: neo.fs.v2.session.SessionToken.Body.TokenLifetime - (*grpc.ContainerID)(nil), // 13: neo.fs.v2.refs.ContainerID - (*grpc.Signature)(nil), // 14: neo.fs.v2.refs.Signature - (*grpc.Version)(nil), // 15: neo.fs.v2.refs.Version - (*grpc1.BearerToken)(nil), // 16: neo.fs.v2.acl.BearerToken - (*grpc2.Status)(nil), // 17: neo.fs.v2.status.Status - (*grpc.ObjectID)(nil), // 18: neo.fs.v2.refs.ObjectID - (*grpc.OwnerID)(nil), // 19: neo.fs.v2.refs.OwnerID -} -var file_session_grpc_types_proto_depIdxs = []int32{ - 0, // 0: neo.fs.v2.session.ObjectSessionContext.verb:type_name -> neo.fs.v2.session.ObjectSessionContext.Verb - 10, // 1: neo.fs.v2.session.ObjectSessionContext.target:type_name -> neo.fs.v2.session.ObjectSessionContext.Target - 1, // 2: neo.fs.v2.session.ContainerSessionContext.verb:type_name -> neo.fs.v2.session.ContainerSessionContext.Verb - 13, // 3: neo.fs.v2.session.ContainerSessionContext.container_id:type_name -> neo.fs.v2.refs.ContainerID - 11, // 4: neo.fs.v2.session.SessionToken.body:type_name -> neo.fs.v2.session.SessionToken.Body - 14, // 5: neo.fs.v2.session.SessionToken.signature:type_name -> neo.fs.v2.refs.Signature - 15, // 6: neo.fs.v2.session.RequestMetaHeader.version:type_name -> neo.fs.v2.refs.Version - 5, // 7: neo.fs.v2.session.RequestMetaHeader.x_headers:type_name -> neo.fs.v2.session.XHeader - 4, // 8: neo.fs.v2.session.RequestMetaHeader.session_token:type_name -> neo.fs.v2.session.SessionToken - 16, // 9: neo.fs.v2.session.RequestMetaHeader.bearer_token:type_name -> neo.fs.v2.acl.BearerToken - 6, // 10: neo.fs.v2.session.RequestMetaHeader.origin:type_name -> neo.fs.v2.session.RequestMetaHeader - 15, // 11: neo.fs.v2.session.ResponseMetaHeader.version:type_name -> neo.fs.v2.refs.Version - 5, // 12: neo.fs.v2.session.ResponseMetaHeader.x_headers:type_name -> neo.fs.v2.session.XHeader - 7, // 13: neo.fs.v2.session.ResponseMetaHeader.origin:type_name -> neo.fs.v2.session.ResponseMetaHeader - 17, // 14: neo.fs.v2.session.ResponseMetaHeader.status:type_name -> neo.fs.v2.status.Status - 14, // 15: neo.fs.v2.session.RequestVerificationHeader.body_signature:type_name -> neo.fs.v2.refs.Signature - 14, // 16: neo.fs.v2.session.RequestVerificationHeader.meta_signature:type_name -> neo.fs.v2.refs.Signature - 14, // 17: neo.fs.v2.session.RequestVerificationHeader.origin_signature:type_name -> neo.fs.v2.refs.Signature - 8, // 18: neo.fs.v2.session.RequestVerificationHeader.origin:type_name -> neo.fs.v2.session.RequestVerificationHeader - 14, // 19: neo.fs.v2.session.ResponseVerificationHeader.body_signature:type_name -> neo.fs.v2.refs.Signature - 14, // 20: neo.fs.v2.session.ResponseVerificationHeader.meta_signature:type_name -> neo.fs.v2.refs.Signature - 14, // 21: neo.fs.v2.session.ResponseVerificationHeader.origin_signature:type_name -> neo.fs.v2.refs.Signature - 9, // 22: neo.fs.v2.session.ResponseVerificationHeader.origin:type_name -> neo.fs.v2.session.ResponseVerificationHeader - 13, // 23: neo.fs.v2.session.ObjectSessionContext.Target.container:type_name -> neo.fs.v2.refs.ContainerID - 18, // 24: neo.fs.v2.session.ObjectSessionContext.Target.objects:type_name -> neo.fs.v2.refs.ObjectID - 19, // 25: neo.fs.v2.session.SessionToken.Body.owner_id:type_name -> neo.fs.v2.refs.OwnerID - 12, // 26: neo.fs.v2.session.SessionToken.Body.lifetime:type_name -> neo.fs.v2.session.SessionToken.Body.TokenLifetime - 2, // 27: neo.fs.v2.session.SessionToken.Body.object:type_name -> neo.fs.v2.session.ObjectSessionContext - 3, // 28: neo.fs.v2.session.SessionToken.Body.container:type_name -> neo.fs.v2.session.ContainerSessionContext - 29, // [29:29] is the sub-list for method output_type - 29, // [29:29] is the sub-list for method input_type - 29, // [29:29] is the sub-list for extension type_name - 29, // [29:29] is the sub-list for extension extendee - 0, // [0:29] is the sub-list for field type_name -} - -func init() { file_session_grpc_types_proto_init() } -func file_session_grpc_types_proto_init() { - if File_session_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_session_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectSessionContext); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerSessionContext); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionToken); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*XHeader); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestMetaHeader); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponseMetaHeader); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestVerificationHeader); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponseVerificationHeader); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObjectSessionContext_Target); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_types_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionToken_Body); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_session_grpc_types_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionToken_Body_TokenLifetime); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_session_grpc_types_proto_msgTypes[9].OneofWrappers = []interface{}{ - (*SessionToken_Body_Object)(nil), - (*SessionToken_Body_Container)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_session_grpc_types_proto_rawDesc, - NumEnums: 2, - NumMessages: 11, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_session_grpc_types_proto_goTypes, - DependencyIndexes: file_session_grpc_types_proto_depIdxs, - EnumInfos: file_session_grpc_types_proto_enumTypes, - MessageInfos: file_session_grpc_types_proto_msgTypes, - }.Build() - File_session_grpc_types_proto = out.File - file_session_grpc_types_proto_rawDesc = nil - file_session_grpc_types_proto_goTypes = nil - file_session_grpc_types_proto_depIdxs = nil -} diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..6a0d75c --- /dev/null +++ b/session/grpc/types_frostfs.pb.go @@ -0,0 +1,2730 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package session + +import ( + json "encoding/json" + fmt "fmt" + grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + grpc2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type ObjectSessionContext_Verb int32 + +const ( + ObjectSessionContext_VERB_UNSPECIFIED ObjectSessionContext_Verb = 0 + ObjectSessionContext_PUT ObjectSessionContext_Verb = 1 + ObjectSessionContext_GET ObjectSessionContext_Verb = 2 + ObjectSessionContext_HEAD ObjectSessionContext_Verb = 3 + ObjectSessionContext_SEARCH ObjectSessionContext_Verb = 4 + ObjectSessionContext_DELETE ObjectSessionContext_Verb = 5 + ObjectSessionContext_RANGE ObjectSessionContext_Verb = 6 + ObjectSessionContext_RANGEHASH ObjectSessionContext_Verb = 7 + ObjectSessionContext_PATCH ObjectSessionContext_Verb = 8 +) + +var ( + ObjectSessionContext_Verb_name = map[int32]string{ + 0: "VERB_UNSPECIFIED", + 1: "PUT", + 2: "GET", + 3: "HEAD", + 4: "SEARCH", + 5: "DELETE", + 6: "RANGE", + 7: "RANGEHASH", + 8: "PATCH", + } + ObjectSessionContext_Verb_value = map[string]int32{ + "VERB_UNSPECIFIED": 0, + "PUT": 1, + "GET": 2, + "HEAD": 3, + "SEARCH": 4, + "DELETE": 5, + "RANGE": 6, + "RANGEHASH": 7, + "PATCH": 8, + } +) + +func (x ObjectSessionContext_Verb) String() string { + if v, ok := ObjectSessionContext_Verb_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *ObjectSessionContext_Verb) FromString(s string) bool { + if v, ok := ObjectSessionContext_Verb_value[s]; ok { + *x = ObjectSessionContext_Verb(v) + return true + } + return false +} + +type ObjectSessionContext_Target struct { + Container *grpc.ContainerID `json:"container"` + Objects []*grpc.ObjectID `json:"objects"` +} + +var ( + _ encoding.ProtoMarshaler = (*ObjectSessionContext_Target)(nil) + _ encoding.ProtoUnmarshaler = (*ObjectSessionContext_Target)(nil) + _ json.Marshaler = (*ObjectSessionContext_Target)(nil) + _ json.Unmarshaler = (*ObjectSessionContext_Target)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ObjectSessionContext_Target) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Container) + for i := range x.Objects { + size += proto.NestedStructureSize(2, x.Objects[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ObjectSessionContext_Target) 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 *ObjectSessionContext_Target) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Container != nil && x.Container.StableSize() != 0 { + x.Container.EmitProtobuf(mm.AppendMessage(1)) + } + for i := range x.Objects { + if x.Objects[i] != nil && x.Objects[i].StableSize() != 0 { + x.Objects[i].EmitProtobuf(mm.AppendMessage(2)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ObjectSessionContext_Target) 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", "ObjectSessionContext_Target") + } + switch fc.FieldNum { + case 1: // Container + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Container") + } + x.Container = new(grpc.ContainerID) + if err := x.Container.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Objects + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Objects") + } + x.Objects = append(x.Objects, new(grpc.ObjectID)) + ff := x.Objects[len(x.Objects)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *ObjectSessionContext_Target) GetContainer() *grpc.ContainerID { + if x != nil { + return x.Container + } + return nil +} +func (x *ObjectSessionContext_Target) SetContainer(v *grpc.ContainerID) { + x.Container = v +} +func (x *ObjectSessionContext_Target) GetObjects() []*grpc.ObjectID { + if x != nil { + return x.Objects + } + return nil +} +func (x *ObjectSessionContext_Target) SetObjects(v []*grpc.ObjectID) { + x.Objects = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ObjectSessionContext_Target) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ObjectSessionContext_Target) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"container\":" + out.RawString(prefix[1:]) + x.Container.MarshalEasyJSON(out) + } + { + const prefix string = ",\"objects\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Objects { + if i != 0 { + out.RawByte(',') + } + x.Objects[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ObjectSessionContext_Target) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ObjectSessionContext_Target) 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 "container": + { + var f *grpc.ContainerID + f = new(grpc.ContainerID) + f.UnmarshalEasyJSON(in) + x.Container = f + } + case "objects": + { + var f *grpc.ObjectID + var list []*grpc.ObjectID + in.Delim('[') + for !in.IsDelim(']') { + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Objects = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ObjectSessionContext struct { + Verb ObjectSessionContext_Verb `json:"verb"` + Target *ObjectSessionContext_Target `json:"target"` +} + +var ( + _ encoding.ProtoMarshaler = (*ObjectSessionContext)(nil) + _ encoding.ProtoUnmarshaler = (*ObjectSessionContext)(nil) + _ json.Marshaler = (*ObjectSessionContext)(nil) + _ json.Unmarshaler = (*ObjectSessionContext)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ObjectSessionContext) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.Verb)) + size += proto.NestedStructureSize(2, x.Target) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ObjectSessionContext) 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 *ObjectSessionContext) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.Verb) != 0 { + mm.AppendInt32(1, int32(x.Verb)) + } + if x.Target != nil && x.Target.StableSize() != 0 { + x.Target.EmitProtobuf(mm.AppendMessage(2)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ObjectSessionContext) 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", "ObjectSessionContext") + } + switch fc.FieldNum { + case 1: // Verb + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Verb") + } + x.Verb = ObjectSessionContext_Verb(data) + case 2: // Target + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Target") + } + x.Target = new(ObjectSessionContext_Target) + if err := x.Target.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *ObjectSessionContext) GetVerb() ObjectSessionContext_Verb { + if x != nil { + return x.Verb + } + return 0 +} +func (x *ObjectSessionContext) SetVerb(v ObjectSessionContext_Verb) { + x.Verb = v +} +func (x *ObjectSessionContext) GetTarget() *ObjectSessionContext_Target { + if x != nil { + return x.Target + } + return nil +} +func (x *ObjectSessionContext) SetTarget(v *ObjectSessionContext_Target) { + x.Target = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ObjectSessionContext) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ObjectSessionContext) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"verb\":" + out.RawString(prefix[1:]) + out.Int32(int32(x.Verb)) + } + { + const prefix string = ",\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ObjectSessionContext) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ObjectSessionContext) 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 "verb": + { + var f ObjectSessionContext_Verb + var parsedValue ObjectSessionContext_Verb + switch v := in.Interface().(type) { + case string: + if vv, ok := ObjectSessionContext_Verb_value[v]; ok { + parsedValue = ObjectSessionContext_Verb(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = ObjectSessionContext_Verb(vv) + case float64: + parsedValue = ObjectSessionContext_Verb(v) + } + f = parsedValue + x.Verb = f + } + case "target": + { + var f *ObjectSessionContext_Target + f = new(ObjectSessionContext_Target) + f.UnmarshalEasyJSON(in) + x.Target = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ContainerSessionContext_Verb int32 + +const ( + ContainerSessionContext_VERB_UNSPECIFIED ContainerSessionContext_Verb = 0 + ContainerSessionContext_PUT ContainerSessionContext_Verb = 1 + ContainerSessionContext_DELETE ContainerSessionContext_Verb = 2 + ContainerSessionContext_SETEACL ContainerSessionContext_Verb = 3 +) + +var ( + ContainerSessionContext_Verb_name = map[int32]string{ + 0: "VERB_UNSPECIFIED", + 1: "PUT", + 2: "DELETE", + 3: "SETEACL", + } + ContainerSessionContext_Verb_value = map[string]int32{ + "VERB_UNSPECIFIED": 0, + "PUT": 1, + "DELETE": 2, + "SETEACL": 3, + } +) + +func (x ContainerSessionContext_Verb) String() string { + if v, ok := ContainerSessionContext_Verb_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *ContainerSessionContext_Verb) FromString(s string) bool { + if v, ok := ContainerSessionContext_Verb_value[s]; ok { + *x = ContainerSessionContext_Verb(v) + return true + } + return false +} + +type ContainerSessionContext struct { + Verb ContainerSessionContext_Verb `json:"verb"` + Wildcard bool `json:"wildcard"` + ContainerId *grpc.ContainerID `json:"containerID"` +} + +var ( + _ encoding.ProtoMarshaler = (*ContainerSessionContext)(nil) + _ encoding.ProtoUnmarshaler = (*ContainerSessionContext)(nil) + _ json.Marshaler = (*ContainerSessionContext)(nil) + _ json.Unmarshaler = (*ContainerSessionContext)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ContainerSessionContext) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.EnumSize(1, int32(x.Verb)) + size += proto.BoolSize(2, x.Wildcard) + size += proto.NestedStructureSize(3, x.ContainerId) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ContainerSessionContext) 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 *ContainerSessionContext) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if int32(x.Verb) != 0 { + mm.AppendInt32(1, int32(x.Verb)) + } + if x.Wildcard { + mm.AppendBool(2, x.Wildcard) + } + if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + x.ContainerId.EmitProtobuf(mm.AppendMessage(3)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ContainerSessionContext) 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", "ContainerSessionContext") + } + switch fc.FieldNum { + case 1: // Verb + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Verb") + } + x.Verb = ContainerSessionContext_Verb(data) + case 2: // Wildcard + data, ok := fc.Bool() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Wildcard") + } + x.Wildcard = data + case 3: // ContainerId + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ContainerId") + } + x.ContainerId = new(grpc.ContainerID) + if err := x.ContainerId.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *ContainerSessionContext) GetVerb() ContainerSessionContext_Verb { + if x != nil { + return x.Verb + } + return 0 +} +func (x *ContainerSessionContext) SetVerb(v ContainerSessionContext_Verb) { + x.Verb = v +} +func (x *ContainerSessionContext) GetWildcard() bool { + if x != nil { + return x.Wildcard + } + return false +} +func (x *ContainerSessionContext) SetWildcard(v bool) { + x.Wildcard = v +} +func (x *ContainerSessionContext) GetContainerId() *grpc.ContainerID { + if x != nil { + return x.ContainerId + } + return nil +} +func (x *ContainerSessionContext) SetContainerId(v *grpc.ContainerID) { + x.ContainerId = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ContainerSessionContext) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ContainerSessionContext) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"verb\":" + out.RawString(prefix[1:]) + out.Int32(int32(x.Verb)) + } + { + const prefix string = ",\"wildcard\":" + out.RawString(prefix) + out.Bool(x.Wildcard) + } + { + const prefix string = ",\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ContainerSessionContext) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ContainerSessionContext) 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 "verb": + { + var f ContainerSessionContext_Verb + var parsedValue ContainerSessionContext_Verb + switch v := in.Interface().(type) { + case string: + if vv, ok := ContainerSessionContext_Verb_value[v]; ok { + parsedValue = ContainerSessionContext_Verb(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = ContainerSessionContext_Verb(vv) + case float64: + parsedValue = ContainerSessionContext_Verb(v) + } + f = parsedValue + x.Verb = f + } + case "wildcard": + { + var f bool + f = in.Bool() + x.Wildcard = f + } + case "containerID": + { + var f *grpc.ContainerID + f = new(grpc.ContainerID) + f.UnmarshalEasyJSON(in) + x.ContainerId = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type SessionToken_Body_TokenLifetime struct { + Exp uint64 `json:"exp"` + Nbf uint64 `json:"nbf"` + Iat uint64 `json:"iat"` +} + +var ( + _ encoding.ProtoMarshaler = (*SessionToken_Body_TokenLifetime)(nil) + _ encoding.ProtoUnmarshaler = (*SessionToken_Body_TokenLifetime)(nil) + _ json.Marshaler = (*SessionToken_Body_TokenLifetime)(nil) + _ json.Unmarshaler = (*SessionToken_Body_TokenLifetime)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *SessionToken_Body_TokenLifetime) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt64Size(1, x.Exp) + size += proto.UInt64Size(2, x.Nbf) + size += proto.UInt64Size(3, x.Iat) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *SessionToken_Body_TokenLifetime) 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 *SessionToken_Body_TokenLifetime) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Exp != 0 { + mm.AppendUint64(1, x.Exp) + } + if x.Nbf != 0 { + mm.AppendUint64(2, x.Nbf) + } + if x.Iat != 0 { + mm.AppendUint64(3, x.Iat) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *SessionToken_Body_TokenLifetime) 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", "SessionToken_Body_TokenLifetime") + } + switch fc.FieldNum { + case 1: // Exp + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Exp") + } + x.Exp = data + case 2: // Nbf + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Nbf") + } + x.Nbf = data + case 3: // Iat + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Iat") + } + x.Iat = data + } + } + return nil +} +func (x *SessionToken_Body_TokenLifetime) GetExp() uint64 { + if x != nil { + return x.Exp + } + return 0 +} +func (x *SessionToken_Body_TokenLifetime) SetExp(v uint64) { + x.Exp = v +} +func (x *SessionToken_Body_TokenLifetime) GetNbf() uint64 { + if x != nil { + return x.Nbf + } + return 0 +} +func (x *SessionToken_Body_TokenLifetime) SetNbf(v uint64) { + x.Nbf = v +} +func (x *SessionToken_Body_TokenLifetime) GetIat() uint64 { + if x != nil { + return x.Iat + } + return 0 +} +func (x *SessionToken_Body_TokenLifetime) SetIat(v uint64) { + x.Iat = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *SessionToken_Body_TokenLifetime) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"exp\":" + out.RawString(prefix[1:]) + out.Uint64(x.Exp) + } + { + const prefix string = ",\"nbf\":" + out.RawString(prefix) + out.Uint64(x.Nbf) + } + { + const prefix string = ",\"iat\":" + out.RawString(prefix) + out.Uint64(x.Iat) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *SessionToken_Body_TokenLifetime) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *SessionToken_Body_TokenLifetime) 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 "exp": + { + var f uint64 + f = in.Uint64() + x.Exp = f + } + case "nbf": + { + var f uint64 + f = in.Uint64() + x.Nbf = f + } + case "iat": + { + var f uint64 + f = in.Uint64() + x.Iat = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type SessionToken_Body struct { + Id []byte `json:"id"` + OwnerId *grpc.OwnerID `json:"ownerID"` + Lifetime *SessionToken_Body_TokenLifetime `json:"lifetime"` + SessionKey []byte `json:"sessionKey"` + Context isSessionToken_Body_Context +} + +var ( + _ encoding.ProtoMarshaler = (*SessionToken_Body)(nil) + _ encoding.ProtoUnmarshaler = (*SessionToken_Body)(nil) + _ json.Marshaler = (*SessionToken_Body)(nil) + _ json.Unmarshaler = (*SessionToken_Body)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *SessionToken_Body) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.Id) + size += proto.NestedStructureSize(2, x.OwnerId) + size += proto.NestedStructureSize(3, x.Lifetime) + size += proto.BytesSize(4, x.SessionKey) + if inner, ok := x.Context.(*SessionToken_Body_Object); ok { + size += proto.NestedStructureSize(5, inner.Object) + } + if inner, ok := x.Context.(*SessionToken_Body_Container); ok { + size += proto.NestedStructureSize(6, inner.Container) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *SessionToken_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 *SessionToken_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.Id) != 0 { + mm.AppendBytes(1, x.Id) + } + if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + x.OwnerId.EmitProtobuf(mm.AppendMessage(2)) + } + if x.Lifetime != nil && x.Lifetime.StableSize() != 0 { + x.Lifetime.EmitProtobuf(mm.AppendMessage(3)) + } + if len(x.SessionKey) != 0 { + mm.AppendBytes(4, x.SessionKey) + } + if inner, ok := x.Context.(*SessionToken_Body_Object); ok { + if inner.Object != nil && inner.Object.StableSize() != 0 { + inner.Object.EmitProtobuf(mm.AppendMessage(5)) + } + } + if inner, ok := x.Context.(*SessionToken_Body_Container); ok { + if inner.Container != nil && inner.Container.StableSize() != 0 { + inner.Container.EmitProtobuf(mm.AppendMessage(6)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *SessionToken_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", "SessionToken_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: // 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: // Lifetime + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Lifetime") + } + x.Lifetime = new(SessionToken_Body_TokenLifetime) + if err := x.Lifetime.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 4: // SessionKey + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SessionKey") + } + x.SessionKey = data + case 5: // Object + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Object") + } + oneofField := &SessionToken_Body_Object{Object: new(ObjectSessionContext)} + if err := oneofField.Object.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.Context = oneofField + case 6: // Container + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Container") + } + oneofField := &SessionToken_Body_Container{Container: new(ContainerSessionContext)} + if err := oneofField.Container.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.Context = oneofField + } + } + return nil +} +func (x *SessionToken_Body) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} +func (x *SessionToken_Body) SetId(v []byte) { + x.Id = v +} +func (x *SessionToken_Body) GetOwnerId() *grpc.OwnerID { + if x != nil { + return x.OwnerId + } + return nil +} +func (x *SessionToken_Body) SetOwnerId(v *grpc.OwnerID) { + x.OwnerId = v +} +func (x *SessionToken_Body) GetLifetime() *SessionToken_Body_TokenLifetime { + if x != nil { + return x.Lifetime + } + return nil +} +func (x *SessionToken_Body) SetLifetime(v *SessionToken_Body_TokenLifetime) { + x.Lifetime = v +} +func (x *SessionToken_Body) GetSessionKey() []byte { + if x != nil { + return x.SessionKey + } + return nil +} +func (x *SessionToken_Body) SetSessionKey(v []byte) { + x.SessionKey = v +} +func (x *SessionToken_Body) GetContext() isSessionToken_Body_Context { + if x != nil { + return x.Context + } + return nil +} +func (x *SessionToken_Body) SetContext(v isSessionToken_Body_Context) { + x.Context = v +} +func (x *SessionToken_Body) GetObject() *ObjectSessionContext { + if xx, ok := x.GetContext().(*SessionToken_Body_Object); ok { + return xx.Object + } + return nil +} +func (x *SessionToken_Body) SetObject(v *ObjectSessionContext) { + x.Context = &SessionToken_Body_Object{Object: v} +} +func (x *SessionToken_Body) GetContainer() *ContainerSessionContext { + if xx, ok := x.GetContext().(*SessionToken_Body_Container); ok { + return xx.Container + } + return nil +} +func (x *SessionToken_Body) SetContainer(v *ContainerSessionContext) { + x.Context = &SessionToken_Body_Container{Container: v} +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *SessionToken_Body) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"id\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.Id) + } + { + const prefix string = ",\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + { + const prefix string = ",\"lifetime\":" + out.RawString(prefix) + x.Lifetime.MarshalEasyJSON(out) + } + { + const prefix string = ",\"sessionKey\":" + out.RawString(prefix) + out.Base64Bytes(x.SessionKey) + } + switch xx := x.Context.(type) { + case *SessionToken_Body_Object: + { + const prefix string = ",\"object\":" + out.RawString(prefix) + xx.Object.MarshalEasyJSON(out) + } + case *SessionToken_Body_Container: + { + const prefix string = ",\"container\":" + out.RawString(prefix) + xx.Container.MarshalEasyJSON(out) + } + default: + out.RawString("null") + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *SessionToken_Body) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *SessionToken_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "id": + { + var f []byte + f = in.Bytes() + x.Id = f + } + case "ownerID": + { + var f *grpc.OwnerID + f = new(grpc.OwnerID) + f.UnmarshalEasyJSON(in) + x.OwnerId = f + } + case "lifetime": + { + var f *SessionToken_Body_TokenLifetime + f = new(SessionToken_Body_TokenLifetime) + f.UnmarshalEasyJSON(in) + x.Lifetime = f + } + case "sessionKey": + { + var f []byte + f = in.Bytes() + x.SessionKey = f + } + case "object": + xx := new(SessionToken_Body_Object) + x.Context = xx + { + var f *ObjectSessionContext + f = new(ObjectSessionContext) + f.UnmarshalEasyJSON(in) + xx.Object = f + } + case "container": + xx := new(SessionToken_Body_Container) + x.Context = xx + { + var f *ContainerSessionContext + f = new(ContainerSessionContext) + f.UnmarshalEasyJSON(in) + xx.Container = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type isSessionToken_Body_Context interface { + isSessionToken_Body_Context() +} + +type SessionToken_Body_Object struct { + Object *ObjectSessionContext +} + +type SessionToken_Body_Container struct { + Container *ContainerSessionContext +} + +func (*SessionToken_Body_Object) isSessionToken_Body_Context() {} + +func (*SessionToken_Body_Container) isSessionToken_Body_Context() {} + +type SessionToken struct { + Body *SessionToken_Body `json:"body"` + Signature *grpc.Signature `json:"signature"` +} + +var ( + _ encoding.ProtoMarshaler = (*SessionToken)(nil) + _ encoding.ProtoUnmarshaler = (*SessionToken)(nil) + _ json.Marshaler = (*SessionToken)(nil) + _ json.Unmarshaler = (*SessionToken)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *SessionToken) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Body) + size += proto.NestedStructureSize(2, x.Signature) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *SessionToken) 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 *SessionToken) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Body != nil && x.Body.StableSize() != 0 { + x.Body.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Signature != nil && x.Signature.StableSize() != 0 { + x.Signature.EmitProtobuf(mm.AppendMessage(2)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *SessionToken) 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", "SessionToken") + } + switch fc.FieldNum { + case 1: // Body + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Body") + } + x.Body = new(SessionToken_Body) + if err := x.Body.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // Signature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Signature") + } + x.Signature = new(grpc.Signature) + if err := x.Signature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *SessionToken) GetBody() *SessionToken_Body { + if x != nil { + return x.Body + } + return nil +} +func (x *SessionToken) SetBody(v *SessionToken_Body) { + x.Body = v +} +func (x *SessionToken) GetSignature() *grpc.Signature { + if x != nil { + return x.Signature + } + return nil +} +func (x *SessionToken) SetSignature(v *grpc.Signature) { + x.Signature = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *SessionToken) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *SessionToken) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"body\":" + out.RawString(prefix[1:]) + x.Body.MarshalEasyJSON(out) + } + { + const prefix string = ",\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *SessionToken) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *SessionToken) 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 *SessionToken_Body + f = new(SessionToken_Body) + f.UnmarshalEasyJSON(in) + x.Body = f + } + case "signature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.Signature = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type XHeader struct { + Key string `json:"key"` + Value string `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*XHeader)(nil) + _ encoding.ProtoUnmarshaler = (*XHeader)(nil) + _ json.Marshaler = (*XHeader)(nil) + _ json.Unmarshaler = (*XHeader)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *XHeader) 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 *XHeader) 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 *XHeader) 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 *XHeader) 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", "XHeader") + } + 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 *XHeader) GetKey() string { + if x != nil { + return x.Key + } + return "" +} +func (x *XHeader) SetKey(v string) { + x.Key = v +} +func (x *XHeader) GetValue() string { + if x != nil { + return x.Value + } + return "" +} +func (x *XHeader) SetValue(v string) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *XHeader) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *XHeader) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"key\":" + out.RawString(prefix[1:]) + out.String(x.Key) + } + { + const prefix string = ",\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *XHeader) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *XHeader) 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 RequestMetaHeader struct { + Version *grpc.Version `json:"version"` + Epoch uint64 `json:"epoch"` + Ttl uint32 `json:"ttl"` + XHeaders []*XHeader `json:"xHeaders"` + SessionToken *SessionToken `json:"sessionToken"` + BearerToken *grpc1.BearerToken `json:"bearerToken"` + Origin *RequestMetaHeader `json:"origin"` + MagicNumber uint64 `json:"magicNumber"` +} + +var ( + _ encoding.ProtoMarshaler = (*RequestMetaHeader)(nil) + _ encoding.ProtoUnmarshaler = (*RequestMetaHeader)(nil) + _ json.Marshaler = (*RequestMetaHeader)(nil) + _ json.Unmarshaler = (*RequestMetaHeader)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RequestMetaHeader) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Version) + size += proto.UInt64Size(2, x.Epoch) + size += proto.UInt32Size(3, x.Ttl) + for i := range x.XHeaders { + size += proto.NestedStructureSize(4, x.XHeaders[i]) + } + size += proto.NestedStructureSize(5, x.SessionToken) + size += proto.NestedStructureSize(6, x.BearerToken) + size += proto.NestedStructureSize(7, x.Origin) + size += proto.UInt64Size(8, x.MagicNumber) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *RequestMetaHeader) 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 *RequestMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Version != nil && x.Version.StableSize() != 0 { + x.Version.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Epoch != 0 { + mm.AppendUint64(2, x.Epoch) + } + if x.Ttl != 0 { + mm.AppendUint32(3, x.Ttl) + } + for i := range x.XHeaders { + if x.XHeaders[i] != nil && x.XHeaders[i].StableSize() != 0 { + x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) + } + } + if x.SessionToken != nil && x.SessionToken.StableSize() != 0 { + x.SessionToken.EmitProtobuf(mm.AppendMessage(5)) + } + if x.BearerToken != nil && x.BearerToken.StableSize() != 0 { + x.BearerToken.EmitProtobuf(mm.AppendMessage(6)) + } + if x.Origin != nil && x.Origin.StableSize() != 0 { + x.Origin.EmitProtobuf(mm.AppendMessage(7)) + } + if x.MagicNumber != 0 { + mm.AppendUint64(8, x.MagicNumber) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *RequestMetaHeader) 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", "RequestMetaHeader") + } + 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: // Epoch + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Epoch") + } + x.Epoch = data + case 3: // Ttl + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Ttl") + } + x.Ttl = data + case 4: // XHeaders + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "XHeaders") + } + x.XHeaders = append(x.XHeaders, new(XHeader)) + ff := x.XHeaders[len(x.XHeaders)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 5: // SessionToken + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SessionToken") + } + x.SessionToken = new(SessionToken) + if err := x.SessionToken.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 6: // BearerToken + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "BearerToken") + } + x.BearerToken = new(grpc1.BearerToken) + if err := x.BearerToken.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 7: // Origin + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Origin") + } + x.Origin = new(RequestMetaHeader) + if err := x.Origin.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 8: // MagicNumber + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MagicNumber") + } + x.MagicNumber = data + } + } + return nil +} +func (x *RequestMetaHeader) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} +func (x *RequestMetaHeader) SetVersion(v *grpc.Version) { + x.Version = v +} +func (x *RequestMetaHeader) GetEpoch() uint64 { + if x != nil { + return x.Epoch + } + return 0 +} +func (x *RequestMetaHeader) SetEpoch(v uint64) { + x.Epoch = v +} +func (x *RequestMetaHeader) GetTtl() uint32 { + if x != nil { + return x.Ttl + } + return 0 +} +func (x *RequestMetaHeader) SetTtl(v uint32) { + x.Ttl = v +} +func (x *RequestMetaHeader) GetXHeaders() []*XHeader { + if x != nil { + return x.XHeaders + } + return nil +} +func (x *RequestMetaHeader) SetXHeaders(v []*XHeader) { + x.XHeaders = v +} +func (x *RequestMetaHeader) GetSessionToken() *SessionToken { + if x != nil { + return x.SessionToken + } + return nil +} +func (x *RequestMetaHeader) SetSessionToken(v *SessionToken) { + x.SessionToken = v +} +func (x *RequestMetaHeader) GetBearerToken() *grpc1.BearerToken { + if x != nil { + return x.BearerToken + } + return nil +} +func (x *RequestMetaHeader) SetBearerToken(v *grpc1.BearerToken) { + x.BearerToken = v +} +func (x *RequestMetaHeader) GetOrigin() *RequestMetaHeader { + if x != nil { + return x.Origin + } + return nil +} +func (x *RequestMetaHeader) SetOrigin(v *RequestMetaHeader) { + x.Origin = v +} +func (x *RequestMetaHeader) GetMagicNumber() uint64 { + if x != nil { + return x.MagicNumber + } + return 0 +} +func (x *RequestMetaHeader) SetMagicNumber(v uint64) { + x.MagicNumber = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *RequestMetaHeader) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"version\":" + out.RawString(prefix[1:]) + x.Version.MarshalEasyJSON(out) + } + { + const prefix string = ",\"epoch\":" + out.RawString(prefix) + out.Uint64(x.Epoch) + } + { + const prefix string = ",\"ttl\":" + out.RawString(prefix) + out.Uint32(x.Ttl) + } + { + const prefix string = ",\"xHeaders\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.XHeaders { + if i != 0 { + out.RawByte(',') + } + x.XHeaders[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) + } + { + const prefix string = ",\"bearerToken\":" + out.RawString(prefix) + x.BearerToken.MarshalEasyJSON(out) + } + { + const prefix string = ",\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) + } + { + const prefix string = ",\"magicNumber\":" + out.RawString(prefix) + out.Uint64(x.MagicNumber) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *RequestMetaHeader) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *RequestMetaHeader) 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 "epoch": + { + var f uint64 + f = in.Uint64() + x.Epoch = f + } + case "ttl": + { + var f uint32 + f = in.Uint32() + x.Ttl = f + } + case "xHeaders": + { + var f *XHeader + var list []*XHeader + in.Delim('[') + for !in.IsDelim(']') { + f = new(XHeader) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.XHeaders = list + in.Delim(']') + } + case "sessionToken": + { + var f *SessionToken + f = new(SessionToken) + f.UnmarshalEasyJSON(in) + x.SessionToken = f + } + case "bearerToken": + { + var f *grpc1.BearerToken + f = new(grpc1.BearerToken) + f.UnmarshalEasyJSON(in) + x.BearerToken = f + } + case "origin": + { + var f *RequestMetaHeader + f = new(RequestMetaHeader) + f.UnmarshalEasyJSON(in) + x.Origin = f + } + case "magicNumber": + { + var f uint64 + f = in.Uint64() + x.MagicNumber = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ResponseMetaHeader struct { + Version *grpc.Version `json:"version"` + Epoch uint64 `json:"epoch"` + Ttl uint32 `json:"ttl"` + XHeaders []*XHeader `json:"xHeaders"` + Origin *ResponseMetaHeader `json:"origin"` + Status *grpc2.Status `json:"status"` +} + +var ( + _ encoding.ProtoMarshaler = (*ResponseMetaHeader)(nil) + _ encoding.ProtoUnmarshaler = (*ResponseMetaHeader)(nil) + _ json.Marshaler = (*ResponseMetaHeader)(nil) + _ json.Unmarshaler = (*ResponseMetaHeader)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ResponseMetaHeader) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.Version) + size += proto.UInt64Size(2, x.Epoch) + size += proto.UInt32Size(3, x.Ttl) + for i := range x.XHeaders { + size += proto.NestedStructureSize(4, x.XHeaders[i]) + } + size += proto.NestedStructureSize(5, x.Origin) + size += proto.NestedStructureSize(6, x.Status) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ResponseMetaHeader) 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 *ResponseMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Version != nil && x.Version.StableSize() != 0 { + x.Version.EmitProtobuf(mm.AppendMessage(1)) + } + if x.Epoch != 0 { + mm.AppendUint64(2, x.Epoch) + } + if x.Ttl != 0 { + mm.AppendUint32(3, x.Ttl) + } + for i := range x.XHeaders { + if x.XHeaders[i] != nil && x.XHeaders[i].StableSize() != 0 { + x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) + } + } + if x.Origin != nil && x.Origin.StableSize() != 0 { + x.Origin.EmitProtobuf(mm.AppendMessage(5)) + } + if x.Status != nil && x.Status.StableSize() != 0 { + x.Status.EmitProtobuf(mm.AppendMessage(6)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ResponseMetaHeader) 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", "ResponseMetaHeader") + } + 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: // Epoch + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Epoch") + } + x.Epoch = data + case 3: // Ttl + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Ttl") + } + x.Ttl = data + case 4: // XHeaders + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "XHeaders") + } + x.XHeaders = append(x.XHeaders, new(XHeader)) + ff := x.XHeaders[len(x.XHeaders)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 5: // Origin + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Origin") + } + x.Origin = new(ResponseMetaHeader) + if err := x.Origin.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 6: // Status + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Status") + } + x.Status = new(grpc2.Status) + if err := x.Status.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *ResponseMetaHeader) GetVersion() *grpc.Version { + if x != nil { + return x.Version + } + return nil +} +func (x *ResponseMetaHeader) SetVersion(v *grpc.Version) { + x.Version = v +} +func (x *ResponseMetaHeader) GetEpoch() uint64 { + if x != nil { + return x.Epoch + } + return 0 +} +func (x *ResponseMetaHeader) SetEpoch(v uint64) { + x.Epoch = v +} +func (x *ResponseMetaHeader) GetTtl() uint32 { + if x != nil { + return x.Ttl + } + return 0 +} +func (x *ResponseMetaHeader) SetTtl(v uint32) { + x.Ttl = v +} +func (x *ResponseMetaHeader) GetXHeaders() []*XHeader { + if x != nil { + return x.XHeaders + } + return nil +} +func (x *ResponseMetaHeader) SetXHeaders(v []*XHeader) { + x.XHeaders = v +} +func (x *ResponseMetaHeader) GetOrigin() *ResponseMetaHeader { + if x != nil { + return x.Origin + } + return nil +} +func (x *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader) { + x.Origin = v +} +func (x *ResponseMetaHeader) GetStatus() *grpc2.Status { + if x != nil { + return x.Status + } + return nil +} +func (x *ResponseMetaHeader) SetStatus(v *grpc2.Status) { + x.Status = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ResponseMetaHeader) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"version\":" + out.RawString(prefix[1:]) + x.Version.MarshalEasyJSON(out) + } + { + const prefix string = ",\"epoch\":" + out.RawString(prefix) + out.Uint64(x.Epoch) + } + { + const prefix string = ",\"ttl\":" + out.RawString(prefix) + out.Uint32(x.Ttl) + } + { + const prefix string = ",\"xHeaders\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.XHeaders { + if i != 0 { + out.RawByte(',') + } + x.XHeaders[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + { + const prefix string = ",\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) + } + { + const prefix string = ",\"status\":" + out.RawString(prefix) + x.Status.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ResponseMetaHeader) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ResponseMetaHeader) 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 "epoch": + { + var f uint64 + f = in.Uint64() + x.Epoch = f + } + case "ttl": + { + var f uint32 + f = in.Uint32() + x.Ttl = f + } + case "xHeaders": + { + var f *XHeader + var list []*XHeader + in.Delim('[') + for !in.IsDelim(']') { + f = new(XHeader) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.XHeaders = list + in.Delim(']') + } + case "origin": + { + var f *ResponseMetaHeader + f = new(ResponseMetaHeader) + f.UnmarshalEasyJSON(in) + x.Origin = f + } + case "status": + { + var f *grpc2.Status + f = new(grpc2.Status) + f.UnmarshalEasyJSON(in) + x.Status = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type RequestVerificationHeader struct { + BodySignature *grpc.Signature `json:"bodySignature"` + MetaSignature *grpc.Signature `json:"metaSignature"` + OriginSignature *grpc.Signature `json:"originSignature"` + Origin *RequestVerificationHeader `json:"origin"` +} + +var ( + _ encoding.ProtoMarshaler = (*RequestVerificationHeader)(nil) + _ encoding.ProtoUnmarshaler = (*RequestVerificationHeader)(nil) + _ json.Marshaler = (*RequestVerificationHeader)(nil) + _ json.Unmarshaler = (*RequestVerificationHeader)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RequestVerificationHeader) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.BodySignature) + size += proto.NestedStructureSize(2, x.MetaSignature) + size += proto.NestedStructureSize(3, x.OriginSignature) + size += proto.NestedStructureSize(4, x.Origin) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *RequestVerificationHeader) 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 *RequestVerificationHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.BodySignature != nil && x.BodySignature.StableSize() != 0 { + x.BodySignature.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaSignature != nil && x.MetaSignature.StableSize() != 0 { + x.MetaSignature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.OriginSignature != nil && x.OriginSignature.StableSize() != 0 { + x.OriginSignature.EmitProtobuf(mm.AppendMessage(3)) + } + if x.Origin != nil && x.Origin.StableSize() != 0 { + x.Origin.EmitProtobuf(mm.AppendMessage(4)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *RequestVerificationHeader) 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", "RequestVerificationHeader") + } + switch fc.FieldNum { + case 1: // BodySignature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "BodySignature") + } + x.BodySignature = new(grpc.Signature) + if err := x.BodySignature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MetaSignature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MetaSignature") + } + x.MetaSignature = new(grpc.Signature) + if err := x.MetaSignature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // OriginSignature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "OriginSignature") + } + x.OriginSignature = new(grpc.Signature) + if err := x.OriginSignature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 4: // Origin + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Origin") + } + x.Origin = new(RequestVerificationHeader) + if err := x.Origin.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *RequestVerificationHeader) GetBodySignature() *grpc.Signature { + if x != nil { + return x.BodySignature + } + return nil +} +func (x *RequestVerificationHeader) SetBodySignature(v *grpc.Signature) { + x.BodySignature = v +} +func (x *RequestVerificationHeader) GetMetaSignature() *grpc.Signature { + if x != nil { + return x.MetaSignature + } + return nil +} +func (x *RequestVerificationHeader) SetMetaSignature(v *grpc.Signature) { + x.MetaSignature = v +} +func (x *RequestVerificationHeader) GetOriginSignature() *grpc.Signature { + if x != nil { + return x.OriginSignature + } + return nil +} +func (x *RequestVerificationHeader) SetOriginSignature(v *grpc.Signature) { + x.OriginSignature = v +} +func (x *RequestVerificationHeader) GetOrigin() *RequestVerificationHeader { + if x != nil { + return x.Origin + } + return nil +} +func (x *RequestVerificationHeader) SetOrigin(v *RequestVerificationHeader) { + x.Origin = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *RequestVerificationHeader) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *RequestVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"bodySignature\":" + out.RawString(prefix[1:]) + x.BodySignature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaSignature\":" + out.RawString(prefix) + x.MetaSignature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"originSignature\":" + out.RawString(prefix) + x.OriginSignature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *RequestVerificationHeader) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *RequestVerificationHeader) 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 "bodySignature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.BodySignature = f + } + case "metaSignature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.MetaSignature = f + } + case "originSignature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.OriginSignature = f + } + case "origin": + { + var f *RequestVerificationHeader + f = new(RequestVerificationHeader) + f.UnmarshalEasyJSON(in) + x.Origin = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type ResponseVerificationHeader struct { + BodySignature *grpc.Signature `json:"bodySignature"` + MetaSignature *grpc.Signature `json:"metaSignature"` + OriginSignature *grpc.Signature `json:"originSignature"` + Origin *ResponseVerificationHeader `json:"origin"` +} + +var ( + _ encoding.ProtoMarshaler = (*ResponseVerificationHeader)(nil) + _ encoding.ProtoUnmarshaler = (*ResponseVerificationHeader)(nil) + _ json.Marshaler = (*ResponseVerificationHeader)(nil) + _ json.Unmarshaler = (*ResponseVerificationHeader)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *ResponseVerificationHeader) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.NestedStructureSize(1, x.BodySignature) + size += proto.NestedStructureSize(2, x.MetaSignature) + size += proto.NestedStructureSize(3, x.OriginSignature) + size += proto.NestedStructureSize(4, x.Origin) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *ResponseVerificationHeader) 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 *ResponseVerificationHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.BodySignature != nil && x.BodySignature.StableSize() != 0 { + x.BodySignature.EmitProtobuf(mm.AppendMessage(1)) + } + if x.MetaSignature != nil && x.MetaSignature.StableSize() != 0 { + x.MetaSignature.EmitProtobuf(mm.AppendMessage(2)) + } + if x.OriginSignature != nil && x.OriginSignature.StableSize() != 0 { + x.OriginSignature.EmitProtobuf(mm.AppendMessage(3)) + } + if x.Origin != nil && x.Origin.StableSize() != 0 { + x.Origin.EmitProtobuf(mm.AppendMessage(4)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *ResponseVerificationHeader) 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", "ResponseVerificationHeader") + } + switch fc.FieldNum { + case 1: // BodySignature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "BodySignature") + } + x.BodySignature = new(grpc.Signature) + if err := x.BodySignature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 2: // MetaSignature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "MetaSignature") + } + x.MetaSignature = new(grpc.Signature) + if err := x.MetaSignature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 3: // OriginSignature + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "OriginSignature") + } + x.OriginSignature = new(grpc.Signature) + if err := x.OriginSignature.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + case 4: // Origin + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Origin") + } + x.Origin = new(ResponseVerificationHeader) + if err := x.Origin.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *ResponseVerificationHeader) GetBodySignature() *grpc.Signature { + if x != nil { + return x.BodySignature + } + return nil +} +func (x *ResponseVerificationHeader) SetBodySignature(v *grpc.Signature) { + x.BodySignature = v +} +func (x *ResponseVerificationHeader) GetMetaSignature() *grpc.Signature { + if x != nil { + return x.MetaSignature + } + return nil +} +func (x *ResponseVerificationHeader) SetMetaSignature(v *grpc.Signature) { + x.MetaSignature = v +} +func (x *ResponseVerificationHeader) GetOriginSignature() *grpc.Signature { + if x != nil { + return x.OriginSignature + } + return nil +} +func (x *ResponseVerificationHeader) SetOriginSignature(v *grpc.Signature) { + x.OriginSignature = v +} +func (x *ResponseVerificationHeader) GetOrigin() *ResponseVerificationHeader { + if x != nil { + return x.Origin + } + return nil +} +func (x *ResponseVerificationHeader) SetOrigin(v *ResponseVerificationHeader) { + x.Origin = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *ResponseVerificationHeader) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *ResponseVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"bodySignature\":" + out.RawString(prefix[1:]) + x.BodySignature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"metaSignature\":" + out.RawString(prefix) + x.MetaSignature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"originSignature\":" + out.RawString(prefix) + x.OriginSignature.MarshalEasyJSON(out) + } + { + const prefix string = ",\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *ResponseVerificationHeader) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *ResponseVerificationHeader) 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 "bodySignature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.BodySignature = f + } + case "metaSignature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.MetaSignature = f + } + case "originSignature": + { + var f *grpc.Signature + f = new(grpc.Signature) + f.UnmarshalEasyJSON(in) + x.OriginSignature = f + } + case "origin": + { + var f *ResponseVerificationHeader + f = new(ResponseVerificationHeader) + f.UnmarshalEasyJSON(in) + x.Origin = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/session/grpc/types_frostfs_fuzz.go b/session/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..fae4a05 --- /dev/null +++ b/session/grpc/types_frostfs_fuzz.go @@ -0,0 +1,159 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package session + +func DoFuzzProtoObjectSessionContext(data []byte) int { + msg := new(ObjectSessionContext) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONObjectSessionContext(data []byte) int { + msg := new(ObjectSessionContext) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoContainerSessionContext(data []byte) int { + msg := new(ContainerSessionContext) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONContainerSessionContext(data []byte) int { + msg := new(ContainerSessionContext) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoSessionToken(data []byte) int { + msg := new(SessionToken) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONSessionToken(data []byte) int { + msg := new(SessionToken) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoXHeader(data []byte) int { + msg := new(XHeader) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONXHeader(data []byte) int { + msg := new(XHeader) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoRequestMetaHeader(data []byte) int { + msg := new(RequestMetaHeader) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONRequestMetaHeader(data []byte) int { + msg := new(RequestMetaHeader) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoResponseMetaHeader(data []byte) int { + msg := new(ResponseMetaHeader) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONResponseMetaHeader(data []byte) int { + msg := new(ResponseMetaHeader) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoRequestVerificationHeader(data []byte) int { + msg := new(RequestVerificationHeader) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONRequestVerificationHeader(data []byte) int { + msg := new(RequestVerificationHeader) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} +func DoFuzzProtoResponseVerificationHeader(data []byte) int { + msg := new(ResponseVerificationHeader) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONResponseVerificationHeader(data []byte) int { + msg := new(ResponseVerificationHeader) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/session/grpc/types_frostfs_test.go b/session/grpc/types_frostfs_test.go new file mode 100644 index 0000000..5c9b6c2 --- /dev/null +++ b/session/grpc/types_frostfs_test.go @@ -0,0 +1,91 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package session + +import ( + testing "testing" +) + +func FuzzProtoObjectSessionContext(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoObjectSessionContext(data) + }) +} +func FuzzJSONObjectSessionContext(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONObjectSessionContext(data) + }) +} +func FuzzProtoContainerSessionContext(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoContainerSessionContext(data) + }) +} +func FuzzJSONContainerSessionContext(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONContainerSessionContext(data) + }) +} +func FuzzProtoSessionToken(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoSessionToken(data) + }) +} +func FuzzJSONSessionToken(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONSessionToken(data) + }) +} +func FuzzProtoXHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoXHeader(data) + }) +} +func FuzzJSONXHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONXHeader(data) + }) +} +func FuzzProtoRequestMetaHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoRequestMetaHeader(data) + }) +} +func FuzzJSONRequestMetaHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONRequestMetaHeader(data) + }) +} +func FuzzProtoResponseMetaHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoResponseMetaHeader(data) + }) +} +func FuzzJSONResponseMetaHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONResponseMetaHeader(data) + }) +} +func FuzzProtoRequestVerificationHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoRequestVerificationHeader(data) + }) +} +func FuzzJSONRequestVerificationHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONRequestVerificationHeader(data) + }) +} +func FuzzProtoResponseVerificationHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoResponseVerificationHeader(data) + }) +} +func FuzzJSONResponseVerificationHeader(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONResponseVerificationHeader(data) + }) +} diff --git a/status/grpc/types.go b/status/grpc/types.go deleted file mode 100644 index 993f632..0000000 --- a/status/grpc/types.go +++ /dev/null @@ -1,26 +0,0 @@ -package status - -// SetId sets identifier of the Status_Detail. -func (x *Status_Detail) SetId(v uint32) { - x.Id = v -} - -// SetValue sets value of the Status_Detail. -func (x *Status_Detail) SetValue(v []byte) { - x.Value = v -} - -// SetCode sets code of the Status. -func (x *Status) SetCode(v uint32) { - x.Code = v -} - -// SetMessage sets message about the Status. -func (x *Status) SetMessage(v string) { - x.Message = v -} - -// SetDetails sets details of the Status. -func (x *Status) SetDetails(v []*Status_Detail) { - x.Details = v -} diff --git a/status/grpc/types.pb.go b/status/grpc/types.pb.go deleted file mode 100644 index b6b081b..0000000 --- a/status/grpc/types.pb.go +++ /dev/null @@ -1,721 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: status/grpc/types.proto - -package status - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Section identifiers. -type Section int32 - -const ( - // Successful return codes. - Section_SECTION_SUCCESS Section = 0 - // Failure codes regardless of the operation. - Section_SECTION_FAILURE_COMMON Section = 1 - // Object service-specific errors. - Section_SECTION_OBJECT Section = 2 - // Container service-specific errors. - Section_SECTION_CONTAINER Section = 3 - // Session service-specific errors. - Section_SECTION_SESSION Section = 4 - // Session service-specific errors. - Section_SECTION_APE_MANAGER Section = 5 -) - -// Enum value maps for Section. -var ( - Section_name = map[int32]string{ - 0: "SECTION_SUCCESS", - 1: "SECTION_FAILURE_COMMON", - 2: "SECTION_OBJECT", - 3: "SECTION_CONTAINER", - 4: "SECTION_SESSION", - 5: "SECTION_APE_MANAGER", - } - Section_value = map[string]int32{ - "SECTION_SUCCESS": 0, - "SECTION_FAILURE_COMMON": 1, - "SECTION_OBJECT": 2, - "SECTION_CONTAINER": 3, - "SECTION_SESSION": 4, - "SECTION_APE_MANAGER": 5, - } -) - -func (x Section) Enum() *Section { - p := new(Section) - *p = x - return p -} - -func (x Section) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Section) Descriptor() protoreflect.EnumDescriptor { - return file_status_grpc_types_proto_enumTypes[0].Descriptor() -} - -func (Section) Type() protoreflect.EnumType { - return &file_status_grpc_types_proto_enumTypes[0] -} - -func (x Section) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Section.Descriptor instead. -func (Section) EnumDescriptor() ([]byte, []int) { - return file_status_grpc_types_proto_rawDescGZIP(), []int{0} -} - -// Section of NeoFS successful return codes. -type Success int32 - -const ( - // [**0**] Default success. Not detailed. - // If the server cannot match successful outcome to the code, it should - // use this code. - Success_OK Success = 0 -) - -// Enum value maps for Success. -var ( - Success_name = map[int32]string{ - 0: "OK", - } - Success_value = map[string]int32{ - "OK": 0, - } -) - -func (x Success) Enum() *Success { - p := new(Success) - *p = x - return p -} - -func (x Success) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Success) Descriptor() protoreflect.EnumDescriptor { - return file_status_grpc_types_proto_enumTypes[1].Descriptor() -} - -func (Success) Type() protoreflect.EnumType { - return &file_status_grpc_types_proto_enumTypes[1] -} - -func (x Success) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Success.Descriptor instead. -func (Success) EnumDescriptor() ([]byte, []int) { - return file_status_grpc_types_proto_rawDescGZIP(), []int{1} -} - -// Section of failed statuses independent of the operation. -type CommonFail int32 - -const ( - // [**1024**] Internal server error, default failure. Not detailed. - // If the server cannot match failed outcome to the code, it should - // use this code. - CommonFail_INTERNAL CommonFail = 0 - // [**1025**] Wrong magic of the NeoFS network. - // Details: - // - [**0**] Magic number of the served NeoFS network (big-endian 64-bit - // unsigned integer). - CommonFail_WRONG_MAGIC_NUMBER CommonFail = 1 - // [**1026**] Signature verification failure. - CommonFail_SIGNATURE_VERIFICATION_FAIL CommonFail = 2 - // [**1027**] Node is under maintenance. - CommonFail_NODE_UNDER_MAINTENANCE CommonFail = 3 - // [**1028**] Invalid argument error. If the server fails on validation of a - // request parameter as the client sent it incorrectly, then this code should - // be used. - CommonFail_INVALID_ARGUMENT CommonFail = 4 -) - -// Enum value maps for CommonFail. -var ( - CommonFail_name = map[int32]string{ - 0: "INTERNAL", - 1: "WRONG_MAGIC_NUMBER", - 2: "SIGNATURE_VERIFICATION_FAIL", - 3: "NODE_UNDER_MAINTENANCE", - 4: "INVALID_ARGUMENT", - } - CommonFail_value = map[string]int32{ - "INTERNAL": 0, - "WRONG_MAGIC_NUMBER": 1, - "SIGNATURE_VERIFICATION_FAIL": 2, - "NODE_UNDER_MAINTENANCE": 3, - "INVALID_ARGUMENT": 4, - } -) - -func (x CommonFail) Enum() *CommonFail { - p := new(CommonFail) - *p = x - return p -} - -func (x CommonFail) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CommonFail) Descriptor() protoreflect.EnumDescriptor { - return file_status_grpc_types_proto_enumTypes[2].Descriptor() -} - -func (CommonFail) Type() protoreflect.EnumType { - return &file_status_grpc_types_proto_enumTypes[2] -} - -func (x CommonFail) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CommonFail.Descriptor instead. -func (CommonFail) EnumDescriptor() ([]byte, []int) { - return file_status_grpc_types_proto_rawDescGZIP(), []int{2} -} - -// Section of statuses for object-related operations. -type Object int32 - -const ( - // [**2048**] Access denied by ACL. - // Details: - // - [**0**] Human-readable description (UTF-8 encoded string). - Object_ACCESS_DENIED Object = 0 - // [**2049**] Object not found. - Object_OBJECT_NOT_FOUND Object = 1 - // [**2050**] Operation rejected by the object lock. - Object_LOCKED Object = 2 - // [**2051**] Locking an object with a non-REGULAR type rejected. - Object_LOCK_NON_REGULAR_OBJECT Object = 3 - // [**2052**] Object has been marked deleted. - Object_OBJECT_ALREADY_REMOVED Object = 4 - // [**2053**] Invalid range has been requested for an object. - Object_OUT_OF_RANGE Object = 5 -) - -// Enum value maps for Object. -var ( - Object_name = map[int32]string{ - 0: "ACCESS_DENIED", - 1: "OBJECT_NOT_FOUND", - 2: "LOCKED", - 3: "LOCK_NON_REGULAR_OBJECT", - 4: "OBJECT_ALREADY_REMOVED", - 5: "OUT_OF_RANGE", - } - Object_value = map[string]int32{ - "ACCESS_DENIED": 0, - "OBJECT_NOT_FOUND": 1, - "LOCKED": 2, - "LOCK_NON_REGULAR_OBJECT": 3, - "OBJECT_ALREADY_REMOVED": 4, - "OUT_OF_RANGE": 5, - } -) - -func (x Object) Enum() *Object { - p := new(Object) - *p = x - return p -} - -func (x Object) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Object) Descriptor() protoreflect.EnumDescriptor { - return file_status_grpc_types_proto_enumTypes[3].Descriptor() -} - -func (Object) Type() protoreflect.EnumType { - return &file_status_grpc_types_proto_enumTypes[3] -} - -func (x Object) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Object.Descriptor instead. -func (Object) EnumDescriptor() ([]byte, []int) { - return file_status_grpc_types_proto_rawDescGZIP(), []int{3} -} - -// Section of statuses for container-related operations. -type Container int32 - -const ( - // [**3072**] Container not found. - Container_CONTAINER_NOT_FOUND Container = 0 - // [**3073**] eACL table not found. - Container_EACL_NOT_FOUND Container = 1 - // [**3074**] Container access denied. - Container_CONTAINER_ACCESS_DENIED Container = 2 -) - -// Enum value maps for Container. -var ( - Container_name = map[int32]string{ - 0: "CONTAINER_NOT_FOUND", - 1: "EACL_NOT_FOUND", - 2: "CONTAINER_ACCESS_DENIED", - } - Container_value = map[string]int32{ - "CONTAINER_NOT_FOUND": 0, - "EACL_NOT_FOUND": 1, - "CONTAINER_ACCESS_DENIED": 2, - } -) - -func (x Container) Enum() *Container { - p := new(Container) - *p = x - return p -} - -func (x Container) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Container) Descriptor() protoreflect.EnumDescriptor { - return file_status_grpc_types_proto_enumTypes[4].Descriptor() -} - -func (Container) Type() protoreflect.EnumType { - return &file_status_grpc_types_proto_enumTypes[4] -} - -func (x Container) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Container.Descriptor instead. -func (Container) EnumDescriptor() ([]byte, []int) { - return file_status_grpc_types_proto_rawDescGZIP(), []int{4} -} - -// Section of statuses for session-related operations. -type Session int32 - -const ( - // [**4096**] Token not found. - Session_TOKEN_NOT_FOUND Session = 0 - // [**4097**] Token has expired. - Session_TOKEN_EXPIRED Session = 1 -) - -// Enum value maps for Session. -var ( - Session_name = map[int32]string{ - 0: "TOKEN_NOT_FOUND", - 1: "TOKEN_EXPIRED", - } - Session_value = map[string]int32{ - "TOKEN_NOT_FOUND": 0, - "TOKEN_EXPIRED": 1, - } -) - -func (x Session) Enum() *Session { - p := new(Session) - *p = x - return p -} - -func (x Session) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Session) Descriptor() protoreflect.EnumDescriptor { - return file_status_grpc_types_proto_enumTypes[5].Descriptor() -} - -func (Session) Type() protoreflect.EnumType { - return &file_status_grpc_types_proto_enumTypes[5] -} - -func (x Session) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Session.Descriptor instead. -func (Session) EnumDescriptor() ([]byte, []int) { - return file_status_grpc_types_proto_rawDescGZIP(), []int{5} -} - -// Section of status for APE manager related operations. -type APEManager int32 - -const ( - // [**5120**] The operation is denied by APE manager. - APEManager_APE_MANAGER_ACCESS_DENIED APEManager = 0 -) - -// Enum value maps for APEManager. -var ( - APEManager_name = map[int32]string{ - 0: "APE_MANAGER_ACCESS_DENIED", - } - APEManager_value = map[string]int32{ - "APE_MANAGER_ACCESS_DENIED": 0, - } -) - -func (x APEManager) Enum() *APEManager { - p := new(APEManager) - *p = x - return p -} - -func (x APEManager) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (APEManager) Descriptor() protoreflect.EnumDescriptor { - return file_status_grpc_types_proto_enumTypes[6].Descriptor() -} - -func (APEManager) Type() protoreflect.EnumType { - return &file_status_grpc_types_proto_enumTypes[6] -} - -func (x APEManager) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use APEManager.Descriptor instead. -func (APEManager) EnumDescriptor() ([]byte, []int) { - return file_status_grpc_types_proto_rawDescGZIP(), []int{6} -} - -// Declares the general format of the status returns of the NeoFS RPC protocol. -// Status is present in all response messages. Each RPC of NeoFS protocol -// describes the possible outcomes and details of the operation. -// -// Each status is assigned a one-to-one numeric code. Any unique result of an -// operation in NeoFS is unambiguously associated with the code value. -// -// Numerical set of codes is split into 1024-element sections. An enumeration -// is defined for each section. Values can be referred to in the following ways: -// -// * numerical value ranging from 0 to 4,294,967,295 (global code); -// -// - values from enumeration (local code). The formula for the ratio of the -// local code (`L`) of a defined section (`S`) to the global one (`G`): -// `G = 1024 * S + L`. -// -// All outcomes are divided into successful and failed, which corresponds -// to the success or failure of the operation. The definition of success -// follows the semantics of RPC and the description of its purpose. -// The server must not attach code that is the opposite of the outcome type. -// -// See the set of return codes in the description for calls. -// -// Each status can carry a developer-facing error message. It should be a human -// readable text in English. The server should not transmit (and the client -// should not expect) useful information in the message. Field `details` -// should make the return more detailed. -type Status struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The status code - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - // Developer-facing error message - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - // Data detailing the outcome of the operation. Must be unique by ID. - Details []*Status_Detail `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` -} - -func (x *Status) Reset() { - *x = Status{} - if protoimpl.UnsafeEnabled { - mi := &file_status_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Status) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Status) ProtoMessage() {} - -func (x *Status) ProtoReflect() protoreflect.Message { - mi := &file_status_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Status.ProtoReflect.Descriptor instead. -func (*Status) Descriptor() ([]byte, []int) { - return file_status_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *Status) GetCode() uint32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *Status) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *Status) GetDetails() []*Status_Detail { - if x != nil { - return x.Details - } - return nil -} - -// Return detail. It contains additional information that can be used to -// analyze the response. Each code defines a set of details that can be -// attached to a status. Client should not handle details that are not -// covered by the code. -type Status_Detail struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Detail ID. The identifier is required to determine the binary format - // of the detail and how to decode it. - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // Binary status detail. Must follow the format associated with ID. - // The possibility of missing a value must be explicitly allowed. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Status_Detail) Reset() { - *x = Status_Detail{} - if protoimpl.UnsafeEnabled { - mi := &file_status_grpc_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Status_Detail) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Status_Detail) ProtoMessage() {} - -func (x *Status_Detail) ProtoReflect() protoreflect.Message { - mi := &file_status_grpc_types_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Status_Detail.ProtoReflect.Descriptor instead. -func (*Status_Detail) Descriptor() ([]byte, []int) { - return file_status_grpc_types_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *Status_Detail) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Status_Detail) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -var File_status_grpc_types_proto protoreflect.FileDescriptor - -var file_status_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6e, 0x65, 0x6f, 0x2e, 0x66, - 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x06, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, - 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, - 0x2e, 0x0a, 0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, - 0x93, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x53, - 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, - 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, - 0x55, 0x52, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, - 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, - 0x12, 0x15, 0x0a, 0x11, 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, 0x54, - 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x43, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x17, 0x0a, 0x13, - 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, - 0x47, 0x45, 0x52, 0x10, 0x05, 0x2a, 0x11, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x2a, 0x85, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, - 0x4e, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x57, 0x52, 0x4f, 0x4e, 0x47, 0x5f, 0x4d, - 0x41, 0x47, 0x49, 0x43, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1f, 0x0a, - 0x1b, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, - 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x02, 0x12, 0x1a, - 0x0a, 0x16, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x4d, 0x41, 0x49, - 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4e, - 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x04, - 0x2a, 0x88, 0x01, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x41, - 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, - 0x0a, 0x10, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, - 0x4e, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, - 0x12, 0x1b, 0x0a, 0x17, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4e, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x47, - 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x1a, 0x0a, - 0x16, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, - 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, 0x54, - 0x5f, 0x4f, 0x46, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x05, 0x2a, 0x55, 0x0a, 0x09, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x54, - 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, - 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x41, 0x43, 0x4c, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, - 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, - 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, - 0x10, 0x02, 0x2a, 0x31, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, - 0x0f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, - 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x45, 0x58, 0x50, 0x49, - 0x52, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x2b, 0x0a, 0x0a, 0x41, 0x50, 0x45, 0x4d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, - 0x45, 0x52, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x42, 0x61, 0x5a, 0x42, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, - 0x73, 0x2e, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x4c, 0x61, 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, - 0x67, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xaa, 0x02, 0x1a, 0x4e, 0x65, 0x6f, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x50, 0x49, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_status_grpc_types_proto_rawDescOnce sync.Once - file_status_grpc_types_proto_rawDescData = file_status_grpc_types_proto_rawDesc -) - -func file_status_grpc_types_proto_rawDescGZIP() []byte { - file_status_grpc_types_proto_rawDescOnce.Do(func() { - file_status_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_status_grpc_types_proto_rawDescData) - }) - return file_status_grpc_types_proto_rawDescData -} - -var file_status_grpc_types_proto_enumTypes = make([]protoimpl.EnumInfo, 7) -var file_status_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_status_grpc_types_proto_goTypes = []interface{}{ - (Section)(0), // 0: neo.fs.v2.status.Section - (Success)(0), // 1: neo.fs.v2.status.Success - (CommonFail)(0), // 2: neo.fs.v2.status.CommonFail - (Object)(0), // 3: neo.fs.v2.status.Object - (Container)(0), // 4: neo.fs.v2.status.Container - (Session)(0), // 5: neo.fs.v2.status.Session - (APEManager)(0), // 6: neo.fs.v2.status.APEManager - (*Status)(nil), // 7: neo.fs.v2.status.Status - (*Status_Detail)(nil), // 8: neo.fs.v2.status.Status.Detail -} -var file_status_grpc_types_proto_depIdxs = []int32{ - 8, // 0: neo.fs.v2.status.Status.details:type_name -> neo.fs.v2.status.Status.Detail - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_status_grpc_types_proto_init() } -func file_status_grpc_types_proto_init() { - if File_status_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_status_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Status); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_status_grpc_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Status_Detail); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_status_grpc_types_proto_rawDesc, - NumEnums: 7, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_status_grpc_types_proto_goTypes, - DependencyIndexes: file_status_grpc_types_proto_depIdxs, - EnumInfos: file_status_grpc_types_proto_enumTypes, - MessageInfos: file_status_grpc_types_proto_msgTypes, - }.Build() - File_status_grpc_types_proto = out.File - file_status_grpc_types_proto_rawDesc = nil - file_status_grpc_types_proto_goTypes = nil - file_status_grpc_types_proto_depIdxs = nil -} diff --git a/status/grpc/types_frostfs.pb.go b/status/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..a12ab55 --- /dev/null +++ b/status/grpc/types_frostfs.pb.go @@ -0,0 +1,643 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package status + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" +) + +type Section int32 + +const ( + Section_SECTION_SUCCESS Section = 0 + Section_SECTION_FAILURE_COMMON Section = 1 + Section_SECTION_OBJECT Section = 2 + Section_SECTION_CONTAINER Section = 3 + Section_SECTION_SESSION Section = 4 + Section_SECTION_APE_MANAGER Section = 5 +) + +var ( + Section_name = map[int32]string{ + 0: "SECTION_SUCCESS", + 1: "SECTION_FAILURE_COMMON", + 2: "SECTION_OBJECT", + 3: "SECTION_CONTAINER", + 4: "SECTION_SESSION", + 5: "SECTION_APE_MANAGER", + } + Section_value = map[string]int32{ + "SECTION_SUCCESS": 0, + "SECTION_FAILURE_COMMON": 1, + "SECTION_OBJECT": 2, + "SECTION_CONTAINER": 3, + "SECTION_SESSION": 4, + "SECTION_APE_MANAGER": 5, + } +) + +func (x Section) String() string { + if v, ok := Section_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Section) FromString(s string) bool { + if v, ok := Section_value[s]; ok { + *x = Section(v) + return true + } + return false +} + +type Success int32 + +const ( + Success_OK Success = 0 +) + +var ( + Success_name = map[int32]string{ + 0: "OK", + } + Success_value = map[string]int32{ + "OK": 0, + } +) + +func (x Success) String() string { + if v, ok := Success_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Success) FromString(s string) bool { + if v, ok := Success_value[s]; ok { + *x = Success(v) + return true + } + return false +} + +type CommonFail int32 + +const ( + CommonFail_INTERNAL CommonFail = 0 + CommonFail_WRONG_MAGIC_NUMBER CommonFail = 1 + CommonFail_SIGNATURE_VERIFICATION_FAIL CommonFail = 2 + CommonFail_NODE_UNDER_MAINTENANCE CommonFail = 3 + CommonFail_INVALID_ARGUMENT CommonFail = 4 +) + +var ( + CommonFail_name = map[int32]string{ + 0: "INTERNAL", + 1: "WRONG_MAGIC_NUMBER", + 2: "SIGNATURE_VERIFICATION_FAIL", + 3: "NODE_UNDER_MAINTENANCE", + 4: "INVALID_ARGUMENT", + } + CommonFail_value = map[string]int32{ + "INTERNAL": 0, + "WRONG_MAGIC_NUMBER": 1, + "SIGNATURE_VERIFICATION_FAIL": 2, + "NODE_UNDER_MAINTENANCE": 3, + "INVALID_ARGUMENT": 4, + } +) + +func (x CommonFail) String() string { + if v, ok := CommonFail_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *CommonFail) FromString(s string) bool { + if v, ok := CommonFail_value[s]; ok { + *x = CommonFail(v) + return true + } + return false +} + +type Object int32 + +const ( + Object_ACCESS_DENIED Object = 0 + Object_OBJECT_NOT_FOUND Object = 1 + Object_LOCKED Object = 2 + Object_LOCK_NON_REGULAR_OBJECT Object = 3 + Object_OBJECT_ALREADY_REMOVED Object = 4 + Object_OUT_OF_RANGE Object = 5 +) + +var ( + Object_name = map[int32]string{ + 0: "ACCESS_DENIED", + 1: "OBJECT_NOT_FOUND", + 2: "LOCKED", + 3: "LOCK_NON_REGULAR_OBJECT", + 4: "OBJECT_ALREADY_REMOVED", + 5: "OUT_OF_RANGE", + } + Object_value = map[string]int32{ + "ACCESS_DENIED": 0, + "OBJECT_NOT_FOUND": 1, + "LOCKED": 2, + "LOCK_NON_REGULAR_OBJECT": 3, + "OBJECT_ALREADY_REMOVED": 4, + "OUT_OF_RANGE": 5, + } +) + +func (x Object) String() string { + if v, ok := Object_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Object) FromString(s string) bool { + if v, ok := Object_value[s]; ok { + *x = Object(v) + return true + } + return false +} + +type Container int32 + +const ( + Container_CONTAINER_NOT_FOUND Container = 0 + Container_EACL_NOT_FOUND Container = 1 + Container_CONTAINER_ACCESS_DENIED Container = 2 +) + +var ( + Container_name = map[int32]string{ + 0: "CONTAINER_NOT_FOUND", + 1: "EACL_NOT_FOUND", + 2: "CONTAINER_ACCESS_DENIED", + } + Container_value = map[string]int32{ + "CONTAINER_NOT_FOUND": 0, + "EACL_NOT_FOUND": 1, + "CONTAINER_ACCESS_DENIED": 2, + } +) + +func (x Container) String() string { + if v, ok := Container_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Container) FromString(s string) bool { + if v, ok := Container_value[s]; ok { + *x = Container(v) + return true + } + return false +} + +type Session int32 + +const ( + Session_TOKEN_NOT_FOUND Session = 0 + Session_TOKEN_EXPIRED Session = 1 +) + +var ( + Session_name = map[int32]string{ + 0: "TOKEN_NOT_FOUND", + 1: "TOKEN_EXPIRED", + } + Session_value = map[string]int32{ + "TOKEN_NOT_FOUND": 0, + "TOKEN_EXPIRED": 1, + } +) + +func (x Session) String() string { + if v, ok := Session_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Session) FromString(s string) bool { + if v, ok := Session_value[s]; ok { + *x = Session(v) + return true + } + return false +} + +type APEManager int32 + +const ( + APEManager_APE_MANAGER_ACCESS_DENIED APEManager = 0 +) + +var ( + APEManager_name = map[int32]string{ + 0: "APE_MANAGER_ACCESS_DENIED", + } + APEManager_value = map[string]int32{ + "APE_MANAGER_ACCESS_DENIED": 0, + } +) + +func (x APEManager) String() string { + if v, ok := APEManager_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *APEManager) FromString(s string) bool { + if v, ok := APEManager_value[s]; ok { + *x = APEManager(v) + return true + } + return false +} + +type Status_Detail struct { + Id uint32 `json:"id"` + Value []byte `json:"value"` +} + +var ( + _ encoding.ProtoMarshaler = (*Status_Detail)(nil) + _ encoding.ProtoUnmarshaler = (*Status_Detail)(nil) + _ json.Marshaler = (*Status_Detail)(nil) + _ json.Unmarshaler = (*Status_Detail)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Status_Detail) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt32Size(1, x.Id) + size += proto.BytesSize(2, x.Value) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Status_Detail) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Status_Detail) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Id != 0 { + mm.AppendUint32(1, x.Id) + } + if len(x.Value) != 0 { + mm.AppendBytes(2, x.Value) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Status_Detail) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Status_Detail") + } + switch fc.FieldNum { + case 1: // Id + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Id") + } + x.Id = data + case 2: // Value + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Value") + } + x.Value = data + } + } + return nil +} +func (x *Status_Detail) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} +func (x *Status_Detail) SetId(v uint32) { + x.Id = v +} +func (x *Status_Detail) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} +func (x *Status_Detail) SetValue(v []byte) { + x.Value = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Status_Detail) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Status_Detail) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"id\":" + out.RawString(prefix[1:]) + out.Uint32(x.Id) + } + { + const prefix string = ",\"value\":" + out.RawString(prefix) + out.Base64Bytes(x.Value) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Status_Detail) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Status_Detail) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "id": + { + var f uint32 + f = in.Uint32() + x.Id = f + } + case "value": + { + var f []byte + f = in.Bytes() + x.Value = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type Status struct { + Code uint32 `json:"code"` + Message string `json:"message"` + Details []*Status_Detail `json:"details"` +} + +var ( + _ encoding.ProtoMarshaler = (*Status)(nil) + _ encoding.ProtoUnmarshaler = (*Status)(nil) + _ json.Marshaler = (*Status)(nil) + _ json.Unmarshaler = (*Status)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Status) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt32Size(1, x.Code) + size += proto.StringSize(2, x.Message) + for i := range x.Details { + size += proto.NestedStructureSize(3, x.Details[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Status) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Status) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.Code != 0 { + mm.AppendUint32(1, x.Code) + } + if len(x.Message) != 0 { + mm.AppendString(2, x.Message) + } + for i := range x.Details { + if x.Details[i] != nil && x.Details[i].StableSize() != 0 { + x.Details[i].EmitProtobuf(mm.AppendMessage(3)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Status) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Status") + } + switch fc.FieldNum { + case 1: // Code + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Code") + } + x.Code = data + case 2: // Message + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Message") + } + x.Message = data + case 3: // Details + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Details") + } + x.Details = append(x.Details, new(Status_Detail)) + ff := x.Details[len(x.Details)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Status) GetCode() uint32 { + if x != nil { + return x.Code + } + return 0 +} +func (x *Status) SetCode(v uint32) { + x.Code = v +} +func (x *Status) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} +func (x *Status) SetMessage(v string) { + x.Message = v +} +func (x *Status) GetDetails() []*Status_Detail { + if x != nil { + return x.Details + } + return nil +} +func (x *Status) SetDetails(v []*Status_Detail) { + x.Details = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Status) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Status) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"code\":" + out.RawString(prefix[1:]) + out.Uint32(x.Code) + } + { + const prefix string = ",\"message\":" + out.RawString(prefix) + out.String(x.Message) + } + { + const prefix string = ",\"details\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Details { + if i != 0 { + out.RawByte(',') + } + x.Details[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Status) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Status) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "code": + { + var f uint32 + f = in.Uint32() + x.Code = f + } + case "message": + { + var f string + f = in.String() + x.Message = f + } + case "details": + { + var f *Status_Detail + var list []*Status_Detail + in.Delim('[') + for !in.IsDelim(']') { + f = new(Status_Detail) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Details = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/status/grpc/types_frostfs_fuzz.go b/status/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..ce9d84e --- /dev/null +++ b/status/grpc/types_frostfs_fuzz.go @@ -0,0 +1,26 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package status + +func DoFuzzProtoStatus(data []byte) int { + msg := new(Status) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONStatus(data []byte) int { + msg := new(Status) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/status/grpc/types_frostfs_test.go b/status/grpc/types_frostfs_test.go new file mode 100644 index 0000000..dfc5631 --- /dev/null +++ b/status/grpc/types_frostfs_test.go @@ -0,0 +1,21 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package status + +import ( + testing "testing" +) + +func FuzzProtoStatus(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoStatus(data) + }) +} +func FuzzJSONStatus(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONStatus(data) + }) +} diff --git a/tombstone/grpc/types.go b/tombstone/grpc/types.go deleted file mode 100644 index 9b4b744..0000000 --- a/tombstone/grpc/types.go +++ /dev/null @@ -1,20 +0,0 @@ -package tombstone - -import ( - refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" -) - -// SetExpirationEpoch sets number of tombstone expiration epoch. -func (x *Tombstone) SetExpirationEpoch(v uint64) { - x.ExpirationEpoch = v -} - -// SetSplitId sets identifier of split object hierarchy. -func (x *Tombstone) SetSplitId(v []byte) { - x.SplitId = v -} - -// SetMembers sets list of objects to be deleted. -func (x *Tombstone) SetMembers(v []*refs.ObjectID) { - x.Members = v -} diff --git a/tombstone/grpc/types.pb.go b/tombstone/grpc/types.pb.go deleted file mode 100644 index 7d416fe..0000000 --- a/tombstone/grpc/types.pb.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v5.27.2 -// source: tombstone/grpc/types.proto - -package tombstone - -import ( - grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Tombstone keeps record of deleted objects for a few epochs until they are -// purged from the NeoFS network. -type Tombstone struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Last NeoFS epoch number of the tombstone lifetime. It's set by the - // tombstone creator depending on the current NeoFS network settings. A - // tombstone object must have the same expiration epoch value in - // `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) - // attribute. Otherwise, the tombstone will be rejected by a storage node. - ExpirationEpoch uint64 `protobuf:"varint,1,opt,name=expiration_epoch,json=expirationEpoch,proto3" json:"expiration_epoch,omitempty"` - // 16 byte UUID used to identify the split object hierarchy parts. Must be - // unique inside a container. All objects participating in the split must - // have the same `split_id` value. - SplitId []byte `protobuf:"bytes,2,opt,name=split_id,json=splitID,proto3" json:"split_id,omitempty"` - // List of objects to be deleted. - Members []*grpc.ObjectID `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"` -} - -func (x *Tombstone) Reset() { - *x = Tombstone{} - if protoimpl.UnsafeEnabled { - mi := &file_tombstone_grpc_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Tombstone) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Tombstone) ProtoMessage() {} - -func (x *Tombstone) ProtoReflect() protoreflect.Message { - mi := &file_tombstone_grpc_types_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Tombstone.ProtoReflect.Descriptor instead. -func (*Tombstone) Descriptor() ([]byte, []int) { - return file_tombstone_grpc_types_proto_rawDescGZIP(), []int{0} -} - -func (x *Tombstone) GetExpirationEpoch() uint64 { - if x != nil { - return x.ExpirationEpoch - } - return 0 -} - -func (x *Tombstone) GetSplitId() []byte { - if x != nil { - return x.SplitId - } - return nil -} - -func (x *Tombstone) GetMembers() []*grpc.ObjectID { - if x != nil { - return x.Members - } - return nil -} - -var File_tombstone_grpc_types_proto protoreflect.FileDescriptor - -var file_tombstone_grpc_types_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x6e, 0x65, - 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, - 0x65, 0x1a, 0x15, 0x72, 0x65, 0x66, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x01, 0x0a, 0x09, 0x54, 0x6f, 0x6d, - 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x49, 0x44, 0x12, 0x32, 0x0a, 0x07, - 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x6e, 0x65, 0x6f, 0x2e, 0x66, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x72, 0x65, 0x66, 0x73, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x44, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x42, 0x6a, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x2e, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2e, - 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x54, 0x72, 0x75, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x4c, 0x61, - 0x62, 0x2f, 0x66, 0x72, 0x6f, 0x73, 0x74, 0x66, 0x73, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x67, 0x6f, - 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x3b, 0x74, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0xaa, 0x02, 0x1d, 0x4e, - 0x65, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x41, - 0x50, 0x49, 0x2e, 0x54, 0x6f, 0x6d, 0x62, 0x73, 0x74, 0x6f, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_tombstone_grpc_types_proto_rawDescOnce sync.Once - file_tombstone_grpc_types_proto_rawDescData = file_tombstone_grpc_types_proto_rawDesc -) - -func file_tombstone_grpc_types_proto_rawDescGZIP() []byte { - file_tombstone_grpc_types_proto_rawDescOnce.Do(func() { - file_tombstone_grpc_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_tombstone_grpc_types_proto_rawDescData) - }) - return file_tombstone_grpc_types_proto_rawDescData -} - -var file_tombstone_grpc_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_tombstone_grpc_types_proto_goTypes = []interface{}{ - (*Tombstone)(nil), // 0: neo.fs.v2.tombstone.Tombstone - (*grpc.ObjectID)(nil), // 1: neo.fs.v2.refs.ObjectID -} -var file_tombstone_grpc_types_proto_depIdxs = []int32{ - 1, // 0: neo.fs.v2.tombstone.Tombstone.members:type_name -> neo.fs.v2.refs.ObjectID - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_tombstone_grpc_types_proto_init() } -func file_tombstone_grpc_types_proto_init() { - if File_tombstone_grpc_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_tombstone_grpc_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Tombstone); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_tombstone_grpc_types_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_tombstone_grpc_types_proto_goTypes, - DependencyIndexes: file_tombstone_grpc_types_proto_depIdxs, - MessageInfos: file_tombstone_grpc_types_proto_msgTypes, - }.Build() - File_tombstone_grpc_types_proto = out.File - file_tombstone_grpc_types_proto_rawDesc = nil - file_tombstone_grpc_types_proto_goTypes = nil - file_tombstone_grpc_types_proto_depIdxs = nil -} diff --git a/tombstone/grpc/types_frostfs.pb.go b/tombstone/grpc/types_frostfs.pb.go new file mode 100644 index 0000000..b0924c0 --- /dev/null +++ b/tombstone/grpc/types_frostfs.pb.go @@ -0,0 +1,229 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package tombstone + +import ( + json "encoding/json" + fmt "fmt" + grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" +) + +type Tombstone struct { + ExpirationEpoch uint64 `json:"expirationEpoch"` + SplitId []byte `json:"splitID"` + Members []*grpc.ObjectID `json:"members"` +} + +var ( + _ encoding.ProtoMarshaler = (*Tombstone)(nil) + _ encoding.ProtoUnmarshaler = (*Tombstone)(nil) + _ json.Marshaler = (*Tombstone)(nil) + _ json.Unmarshaler = (*Tombstone)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Tombstone) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt64Size(1, x.ExpirationEpoch) + size += proto.BytesSize(2, x.SplitId) + for i := range x.Members { + size += proto.NestedStructureSize(3, x.Members[i]) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Tombstone) MarshalProtobuf(dst []byte) []byte { + m := pool.MarshalerPool.Get() + defer pool.MarshalerPool.Put(m) + x.EmitProtobuf(m.MessageMarshaler()) + dst = m.Marshal(dst) + return dst +} + +func (x *Tombstone) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.ExpirationEpoch != 0 { + mm.AppendUint64(1, x.ExpirationEpoch) + } + if len(x.SplitId) != 0 { + mm.AppendBytes(2, x.SplitId) + } + for i := range x.Members { + if x.Members[i] != nil && x.Members[i].StableSize() != 0 { + x.Members[i].EmitProtobuf(mm.AppendMessage(3)) + } + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Tombstone) UnmarshalProtobuf(src []byte) (err error) { + var fc easyproto.FieldContext + for len(src) > 0 { + src, err = fc.NextField(src) + if err != nil { + return fmt.Errorf("cannot read next field in %s", "Tombstone") + } + switch fc.FieldNum { + case 1: // ExpirationEpoch + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "ExpirationEpoch") + } + x.ExpirationEpoch = data + case 2: // SplitId + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "SplitId") + } + x.SplitId = data + case 3: // Members + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "Members") + } + x.Members = append(x.Members, new(grpc.ObjectID)) + ff := x.Members[len(x.Members)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + } + } + return nil +} +func (x *Tombstone) GetExpirationEpoch() uint64 { + if x != nil { + return x.ExpirationEpoch + } + return 0 +} +func (x *Tombstone) SetExpirationEpoch(v uint64) { + x.ExpirationEpoch = v +} +func (x *Tombstone) GetSplitId() []byte { + if x != nil { + return x.SplitId + } + return nil +} +func (x *Tombstone) SetSplitId(v []byte) { + x.SplitId = v +} +func (x *Tombstone) GetMembers() []*grpc.ObjectID { + if x != nil { + return x.Members + } + return nil +} +func (x *Tombstone) SetMembers(v []*grpc.ObjectID) { + x.Members = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Tombstone) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"expirationEpoch\":" + out.RawString(prefix[1:]) + out.Uint64(x.ExpirationEpoch) + } + { + const prefix string = ",\"splitID\":" + out.RawString(prefix) + out.Base64Bytes(x.SplitId) + } + { + const prefix string = ",\"members\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Members { + if i != 0 { + out.RawByte(',') + } + x.Members[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Tombstone) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Tombstone) UnmarshalEasyJSON(in *jlexer.Lexer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "expirationEpoch": + { + var f uint64 + f = in.Uint64() + x.ExpirationEpoch = f + } + case "splitID": + { + var f []byte + f = in.Bytes() + x.SplitId = f + } + case "members": + { + var f *grpc.ObjectID + var list []*grpc.ObjectID + in.Delim('[') + for !in.IsDelim(']') { + f = new(grpc.ObjectID) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.Members = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/tombstone/grpc/types_frostfs_fuzz.go b/tombstone/grpc/types_frostfs_fuzz.go new file mode 100644 index 0000000..57cfb58 --- /dev/null +++ b/tombstone/grpc/types_frostfs_fuzz.go @@ -0,0 +1,26 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package tombstone + +func DoFuzzProtoTombstone(data []byte) int { + msg := new(Tombstone) + if err := msg.UnmarshalProtobuf(data); err != nil { + return 0 + } + _ = msg.MarshalProtobuf(nil) + return 1 +} +func DoFuzzJSONTombstone(data []byte) int { + msg := new(Tombstone) + if err := msg.UnmarshalJSON(data); err != nil { + return 0 + } + _, err := msg.MarshalJSON() + if err != nil { + panic(err) + } + return 1 +} diff --git a/tombstone/grpc/types_frostfs_test.go b/tombstone/grpc/types_frostfs_test.go new file mode 100644 index 0000000..8264824 --- /dev/null +++ b/tombstone/grpc/types_frostfs_test.go @@ -0,0 +1,21 @@ +//go:build gofuzz +// +build gofuzz + +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package tombstone + +import ( + testing "testing" +) + +func FuzzProtoTombstone(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzProtoTombstone(data) + }) +} +func FuzzJSONTombstone(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + DoFuzzJSONTombstone(data) + }) +} diff --git a/util/pool/marshal.go b/util/pool/marshal.go new file mode 100644 index 0000000..107df28 --- /dev/null +++ b/util/pool/marshal.go @@ -0,0 +1,7 @@ +package pool + +import ( + "github.com/VictoriaMetrics/easyproto" +) + +var MarshalerPool easyproto.MarshalerPool diff --git a/util/proto/encoding/compat.go b/util/proto/encoding/compat.go new file mode 100644 index 0000000..09d45e6 --- /dev/null +++ b/util/proto/encoding/compat.go @@ -0,0 +1,22 @@ +package encoding + +import ( + _ "google.golang.org/grpc/encoding/proto" // Ensure default codec is registered before our one. + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/protoadapt" +) + +// messageV2Of converts v to a proto.Message. +// This is needed for this library to continue working in presence of external gRPC packages, +// such as opentelemetry gRPC exporter. +// Copied from https://github.com/grpc/grpc-go/blob/e524655becd8d4c7ba9e8687faef456e495e341e/encoding/proto/proto.go#L59. +func messageV2Of(v any) proto.Message { + switch v := v.(type) { + case protoadapt.MessageV1: + return protoadapt.MessageV2Of(v) + case protoadapt.MessageV2: + return v + } + + return nil +} diff --git a/util/proto/encoding/json.go b/util/proto/encoding/json.go new file mode 100644 index 0000000..3456a40 --- /dev/null +++ b/util/proto/encoding/json.go @@ -0,0 +1,48 @@ +package encoding + +import ( + "encoding/json" + "fmt" + + "google.golang.org/grpc/encoding" + "google.golang.org/protobuf/encoding/protojson" +) + +// JSONCodec is easyjson codec used for code generated by protogen. +// It is binary-level compatible with the standard protojson format, thus uses the same name. +type JSONCodec struct{} + +var _ encoding.Codec = JSONCodec{} + +func init() { + encoding.RegisterCodec(JSONCodec{}) +} + +// Name implements the encoding.Codec interface. +func (JSONCodec) Name() string { return "json" } + +// Marshal implements the encoding.Codec interface. +func (JSONCodec) Marshal(v any) ([]byte, error) { + switch v := v.(type) { + case json.Marshaler: + return json.Marshal(v) + default: + if v := messageV2Of(v); v != nil { + return protojson.Marshal(v) + } + return nil, fmt.Errorf("failed to marshal, message is %T, want proto.Message", v) + } +} + +// Unmarshal implements the encoding.Codec interface. +func (JSONCodec) Unmarshal(data []byte, v any) error { + switch v := v.(type) { + case json.Unmarshaler: + return json.Unmarshal(data, v) + default: + if v := messageV2Of(v); v != nil { + return protojson.Unmarshal(data, v) + } + return fmt.Errorf("failed to unmarshal, message is %T, want proto.Message", v) + } +} diff --git a/util/proto/encoding/proto.go b/util/proto/encoding/proto.go new file mode 100644 index 0000000..5f3c556 --- /dev/null +++ b/util/proto/encoding/proto.go @@ -0,0 +1,57 @@ +package encoding + +import ( + "fmt" + + "google.golang.org/grpc/encoding" + "google.golang.org/protobuf/proto" +) + +// ProtoCodec is easyproto codec used for code generated by protogen. +// It is binary-level compatible with the standard proto codec, thus uses the same name. +type ProtoCodec struct{} + +// ProtoMarshaler is an interface accepted by ProtoCodec.Marshal. +type ProtoMarshaler interface { + MarshalProtobuf([]byte) []byte +} + +// ProtoUnmarshaler is an interface accepted by ProtoCodec.Unmarshal. +type ProtoUnmarshaler interface { + UnmarshalProtobuf([]byte) error +} + +var _ encoding.Codec = ProtoCodec{} + +func init() { + encoding.RegisterCodec(ProtoCodec{}) +} + +// Name implements the encoding.Codec interface. +func (ProtoCodec) Name() string { return "proto" } + +// Marshal implements the encoding.Codec interface. +func (ProtoCodec) Marshal(v any) ([]byte, error) { + switch v := v.(type) { + case ProtoMarshaler: + return v.MarshalProtobuf(nil), nil + default: + if v := messageV2Of(v); v != nil { + return proto.Marshal(v) + } + return nil, fmt.Errorf("failed to marshal, message is %T, want proto.Message", v) + } +} + +// Unmarshal implements the encoding.Codec interface. +func (ProtoCodec) Unmarshal(data []byte, v any) error { + switch v := v.(type) { + case ProtoUnmarshaler: + return v.UnmarshalProtobuf(data) + default: + if v := messageV2Of(v); v != nil { + return proto.Unmarshal(data, v) + } + return fmt.Errorf("failed to unmarshal, message is %T, want proto.Message", v) + } +} diff --git a/util/proto/marshal.go b/util/proto/marshal.go index 42c6a91..5016255 100644 --- a/util/proto/marshal.go +++ b/util/proto/marshal.go @@ -17,6 +17,10 @@ import ( type ( stableMarshaler interface { StableMarshal([]byte) []byte + stableSizer + } + + stableSizer interface { StableSize() int } @@ -277,6 +281,11 @@ type ptrStableMarshaler[T any] interface { ~*T } +type ptrStableSizer[T any] interface { + stableSizer + ~*T +} + func NestedStructureMarshal[T any, M ptrStableMarshaler[T]](field int64, buf []byte, v M) int { if v == nil { return 0 @@ -320,7 +329,7 @@ func NestedStructureSetMarshalData[T any, M setMarshalData[T]](field int64, pare return offset + n } -func NestedStructureSize[T any, M ptrStableMarshaler[T]](field int64, v M) (size int) { +func NestedStructureSize[T any, M ptrStableSizer[T]](field int64, v M) (size int) { if v == nil { return 0 } @@ -328,7 +337,7 @@ func NestedStructureSize[T any, M ptrStableMarshaler[T]](field int64, v M) (size return NestedStructureSizeUnchecked(field, v) } -func NestedStructureSizeUnchecked[T stableMarshaler](field int64, v T) int { +func NestedStructureSizeUnchecked[T stableSizer](field int64, v T) int { n := v.StableSize() return protowire.SizeGroup(protowire.Number(field), protowire.SizeBytes(n)) } diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index 56d9594..e565b7c 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -6,6 +6,7 @@ import ( "testing" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test" + generated "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test/custom" "github.com/stretchr/testify/require" goproto "google.golang.org/protobuf/proto" ) @@ -24,39 +25,43 @@ func nonZero[T protoInt]() T { func TestStableMarshalSingle(t *testing.T) { t.Run("empty", func(t *testing.T) { - input := &test.Primitives{} + input := &generated.Primitives{} require.Zero(t, input.StableSize()) - r := input.StableMarshal(nil) + r := input.MarshalProtobuf(nil) require.Empty(t, r) }) marshalCases := []struct { name string - input *test.Primitives + input *generated.Primitives }{ - {name: "bytes", input: &test.Primitives{FieldA: []byte{1, 2, 3}}}, - {name: "string", input: &test.Primitives{FieldB: "123"}}, - {name: "bool", input: &test.Primitives{FieldC: true}}, - {name: "int32", input: &test.Primitives{FieldD: nonZero[int32]()}}, - {name: "uint32", input: &test.Primitives{FieldE: nonZero[uint32]()}}, - {name: "int64", input: &test.Primitives{FieldF: nonZero[int64]()}}, - {name: "uint64", input: &test.Primitives{FieldG: nonZero[uint64]()}}, - {name: "uint64", input: &test.Primitives{FieldI: nonZero[uint64]()}}, - {name: "float64", input: &test.Primitives{FieldJ: math.Float64frombits(12345677890)}}, - {name: "fixed32", input: &test.Primitives{FieldK: nonZero[uint32]()}}, - {name: "enum, positive", input: &test.Primitives{FieldH: test.Primitives_POSITIVE}}, - {name: "enum, negative", input: &test.Primitives{FieldH: test.Primitives_NEGATIVE}}, + {name: "bytes", input: &generated.Primitives{FieldA: []byte{1, 2, 3}}}, + {name: "string", input: &generated.Primitives{FieldB: "123"}}, + {name: "bool", input: &generated.Primitives{FieldC: true}}, + {name: "int32", input: &generated.Primitives{FieldD: -10}}, + {name: "uint32", input: &generated.Primitives{FieldE: nonZero[uint32]()}}, + {name: "int64", input: &generated.Primitives{FieldF: nonZero[int64]()}}, + {name: "uint64", input: &generated.Primitives{FieldG: nonZero[uint64]()}}, + {name: "uint64", input: &generated.Primitives{FieldI: nonZero[uint64]()}}, + {name: "float64", input: &generated.Primitives{FieldJ: math.Float64frombits(12345677890)}}, + {name: "fixed32", input: &generated.Primitives{FieldK: nonZero[uint32]()}}, + {name: "enum, positive", input: &generated.Primitives{FieldH: generated.Primitives_POSITIVE}}, + {name: "enum, negative", input: &generated.Primitives{FieldH: generated.Primitives_NEGATIVE}}, } for _, tc := range marshalCases { t.Run(tc.name, func(t *testing.T) { - r := tc.input.StableMarshal(nil) + r := tc.input.MarshalProtobuf(nil) require.Equal(t, len(r), tc.input.StableSize()) require.NotEmpty(t, r) var actual test.Primitives require.NoError(t, goproto.Unmarshal(r, &actual)) + var actualFrostfs generated.Primitives + require.NoError(t, actualFrostfs.UnmarshalProtobuf(r)) + require.Equal(t, tc.input, &actualFrostfs) + // Compare each field directly, because proto-generated code has private fields. require.Equal(t, tc.input.FieldA, actual.FieldA) require.Equal(t, tc.input.FieldB, actual.FieldB) @@ -68,7 +73,7 @@ func TestStableMarshalSingle(t *testing.T) { require.Equal(t, tc.input.FieldI, actual.FieldI) require.Equal(t, tc.input.FieldJ, actual.FieldJ) require.Equal(t, tc.input.FieldK, actual.FieldK) - require.Equal(t, tc.input.FieldH, actual.FieldH) + require.EqualValues(t, tc.input.FieldH, actual.FieldH) }) } } @@ -91,51 +96,53 @@ func TestStableMarshalRep(t *testing.T) { t.Run("empty", func(t *testing.T) { marshalCases := []struct { name string - input *test.RepPrimitives + input *generated.RepPrimitives }{ - {name: "default", input: &test.RepPrimitives{}}, - {name: "bytes", input: &test.RepPrimitives{FieldA: [][]byte{}}}, - {name: "string", input: &test.RepPrimitives{FieldB: []string{}}}, - {name: "int32", input: &test.RepPrimitives{FieldC: []int32{}}}, - {name: "uint32", input: &test.RepPrimitives{FieldD: []uint32{}}}, - {name: "int64", input: &test.RepPrimitives{FieldE: []int64{}}}, - {name: "uint64", input: &test.RepPrimitives{FieldF: []uint64{}}}, - {name: "uint64", input: &test.RepPrimitives{FieldFu: []uint64{}}}, + {name: "default", input: &generated.RepPrimitives{}}, + {name: "bytes", input: &generated.RepPrimitives{FieldA: [][]byte{}}}, + {name: "string", input: &generated.RepPrimitives{FieldB: []string{}}}, + {name: "int32", input: &generated.RepPrimitives{FieldC: []int32{}}}, + {name: "uint32", input: &generated.RepPrimitives{FieldD: []uint32{}}}, + {name: "int64", input: &generated.RepPrimitives{FieldE: []int64{}}}, + {name: "uint64", input: &generated.RepPrimitives{FieldF: []uint64{}}}, + {name: "uint64", input: &generated.RepPrimitives{FieldFu: []uint64{}}}, } for _, tc := range marshalCases { - require.Zero(t, tc.input.StableSize()) + t.Run(tc.name, func(t *testing.T) { + require.Zero(t, tc.input.StableSize()) - r := tc.input.StableMarshal(nil) - require.Empty(t, r) + r := tc.input.MarshalProtobuf(nil) + require.Empty(t, r) + }) } }) marshalCases := []struct { name string - input *test.RepPrimitives + input *generated.RepPrimitives }{ - {name: "bytes", input: &test.RepPrimitives{FieldA: [][]byte{{1, 2, 3}}}}, - {name: "string", input: &test.RepPrimitives{FieldB: []string{"123"}}}, - {name: "int32", input: &test.RepPrimitives{FieldC: randIntSlice[int32](1, true)}}, - {name: "int32", input: &test.RepPrimitives{FieldC: randIntSlice[int32](2, true)}}, - {name: "int32", input: &test.RepPrimitives{FieldC: randIntSlice[int32](2, false)}}, - {name: "uint32", input: &test.RepPrimitives{FieldD: randIntSlice[uint32](1, true)}}, - {name: "uint32", input: &test.RepPrimitives{FieldD: randIntSlice[uint32](2, true)}}, - {name: "uint32", input: &test.RepPrimitives{FieldD: randIntSlice[uint32](2, false)}}, - {name: "int64", input: &test.RepPrimitives{FieldE: randIntSlice[int64](1, true)}}, - {name: "int64", input: &test.RepPrimitives{FieldE: randIntSlice[int64](2, true)}}, - {name: "int64", input: &test.RepPrimitives{FieldE: randIntSlice[int64](2, false)}}, - {name: "uint64", input: &test.RepPrimitives{FieldF: randIntSlice[uint64](1, true)}}, - {name: "uint64", input: &test.RepPrimitives{FieldF: randIntSlice[uint64](2, true)}}, - {name: "uint64", input: &test.RepPrimitives{FieldF: randIntSlice[uint64](2, false)}}, - {name: "uint64", input: &test.RepPrimitives{FieldFu: randIntSlice[uint64](1, true)}}, - {name: "uint64", input: &test.RepPrimitives{FieldFu: randIntSlice[uint64](2, true)}}, - {name: "uint64", input: &test.RepPrimitives{FieldFu: randIntSlice[uint64](2, false)}}, + {name: "bytes", input: &generated.RepPrimitives{FieldA: [][]byte{{1, 2, 3}}}}, + {name: "string", input: &generated.RepPrimitives{FieldB: []string{"123"}}}, + {name: "int32", input: &generated.RepPrimitives{FieldC: randIntSlice[int32](1, true)}}, + {name: "int32", input: &generated.RepPrimitives{FieldC: randIntSlice[int32](2, true)}}, + {name: "int32", input: &generated.RepPrimitives{FieldC: randIntSlice[int32](2, false)}}, + {name: "uint32", input: &generated.RepPrimitives{FieldD: randIntSlice[uint32](1, true)}}, + {name: "uint32", input: &generated.RepPrimitives{FieldD: randIntSlice[uint32](2, true)}}, + {name: "uint32", input: &generated.RepPrimitives{FieldD: randIntSlice[uint32](2, false)}}, + {name: "int64", input: &generated.RepPrimitives{FieldE: randIntSlice[int64](1, true)}}, + {name: "int64", input: &generated.RepPrimitives{FieldE: randIntSlice[int64](2, true)}}, + {name: "int64", input: &generated.RepPrimitives{FieldE: randIntSlice[int64](2, false)}}, + {name: "uint64", input: &generated.RepPrimitives{FieldF: randIntSlice[uint64](1, true)}}, + {name: "uint64", input: &generated.RepPrimitives{FieldF: randIntSlice[uint64](2, true)}}, + {name: "uint64", input: &generated.RepPrimitives{FieldF: randIntSlice[uint64](2, false)}}, + {name: "uint64", input: &generated.RepPrimitives{FieldFu: randIntSlice[uint64](1, true)}}, + {name: "uint64", input: &generated.RepPrimitives{FieldFu: randIntSlice[uint64](2, true)}}, + {name: "uint64", input: &generated.RepPrimitives{FieldFu: randIntSlice[uint64](2, false)}}, } for _, tc := range marshalCases { t.Run(tc.name, func(t *testing.T) { - r := tc.input.StableMarshal(nil) + r := tc.input.MarshalProtobuf(nil) require.Equal(t, len(r), tc.input.StableSize()) require.NotEmpty(t, r) diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go new file mode 100644 index 0000000..28a3044 --- /dev/null +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -0,0 +1,926 @@ +// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. + +package test + +import ( + json "encoding/json" + fmt "fmt" + pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" + proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" + encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" + easyproto "github.com/VictoriaMetrics/easyproto" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + protowire "google.golang.org/protobuf/encoding/protowire" + strconv "strconv" +) + +type Primitives_SomeEnum int32 + +const ( + Primitives_UNKNOWN = 0 + Primitives_POSITIVE = 1 + Primitives_NEGATIVE = -1 +) + +var ( + Primitives_SomeEnum_name = map[int32]string{ + 0: "UNKNOWN", + 1: "POSITIVE", + -1: "NEGATIVE", + } + Primitives_SomeEnum_value = map[string]int32{ + "UNKNOWN": 0, + "POSITIVE": 1, + "NEGATIVE": -1, + } +) + +func (x Primitives_SomeEnum) String() string { + if v, ok := Primitives_SomeEnum_name[int32(x)]; ok { + return v + } + return strconv.FormatInt(int64(x), 10) +} +func (x *Primitives_SomeEnum) FromString(s string) bool { + if v, ok := Primitives_SomeEnum_value[s]; ok { + *x = Primitives_SomeEnum(v) + return true + } + return false +} + +type Primitives struct { + FieldA []byte `json:"fieldA"` + FieldB string `json:"fieldB"` + FieldC bool `json:"fieldC"` + FieldD int32 `json:"fieldD"` + FieldE uint32 `json:"fieldE"` + FieldF int64 `json:"fieldF"` + FieldG uint64 `json:"fieldG"` + FieldI uint64 `json:"fieldI"` + FieldJ float64 `json:"fieldJ"` + FieldK uint32 `json:"fieldK"` + FieldH Primitives_SomeEnum `json:"fieldH"` +} + +var ( + _ encoding.ProtoMarshaler = (*Primitives)(nil) + _ encoding.ProtoUnmarshaler = (*Primitives)(nil) + _ json.Marshaler = (*Primitives)(nil) + _ json.Unmarshaler = (*Primitives)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Primitives) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.BytesSize(1, x.FieldA) + size += proto.StringSize(2, x.FieldB) + size += proto.BoolSize(200, x.FieldC) + size += proto.Int32Size(201, x.FieldD) + size += proto.UInt32Size(202, x.FieldE) + size += proto.Int64Size(203, x.FieldF) + size += proto.UInt64Size(204, x.FieldG) + size += proto.Fixed64Size(205, x.FieldI) + size += proto.Float64Size(206, x.FieldJ) + size += proto.Fixed32Size(207, x.FieldK) + size += proto.EnumSize(300, int32(x.FieldH)) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Primitives) 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 *Primitives) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if len(x.FieldA) != 0 { + mm.AppendBytes(1, x.FieldA) + } + if len(x.FieldB) != 0 { + mm.AppendString(2, x.FieldB) + } + if x.FieldC { + mm.AppendBool(200, x.FieldC) + } + if x.FieldD != 0 { + mm.AppendInt32(201, x.FieldD) + } + if x.FieldE != 0 { + mm.AppendUint32(202, x.FieldE) + } + if x.FieldF != 0 { + mm.AppendInt64(203, x.FieldF) + } + if x.FieldG != 0 { + mm.AppendUint64(204, x.FieldG) + } + if x.FieldI != 0 { + mm.AppendFixed64(205, x.FieldI) + } + if x.FieldJ != 0 { + mm.AppendDouble(206, x.FieldJ) + } + if x.FieldK != 0 { + mm.AppendFixed32(207, x.FieldK) + } + if int32(x.FieldH) != 0 { + mm.AppendInt32(300, int32(x.FieldH)) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Primitives) 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", "Primitives") + } + switch fc.FieldNum { + case 1: // FieldA + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldA") + } + x.FieldA = data + case 2: // FieldB + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldB") + } + x.FieldB = data + case 200: // FieldC + data, ok := fc.Bool() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldC") + } + x.FieldC = data + case 201: // FieldD + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldD") + } + x.FieldD = data + case 202: // FieldE + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldE") + } + x.FieldE = data + case 203: // FieldF + data, ok := fc.Int64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldF") + } + x.FieldF = data + case 204: // FieldG + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldG") + } + x.FieldG = data + case 205: // FieldI + data, ok := fc.Fixed64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldI") + } + x.FieldI = data + case 206: // FieldJ + data, ok := fc.Double() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldJ") + } + x.FieldJ = data + case 207: // FieldK + data, ok := fc.Fixed32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldK") + } + x.FieldK = data + case 300: // FieldH + data, ok := fc.Int32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldH") + } + x.FieldH = Primitives_SomeEnum(data) + } + } + return nil +} +func (x *Primitives) GetFieldA() []byte { + if x != nil { + return x.FieldA + } + return nil +} +func (x *Primitives) SetFieldA(v []byte) { + x.FieldA = v +} +func (x *Primitives) GetFieldB() string { + if x != nil { + return x.FieldB + } + return "" +} +func (x *Primitives) SetFieldB(v string) { + x.FieldB = v +} +func (x *Primitives) GetFieldC() bool { + if x != nil { + return x.FieldC + } + return false +} +func (x *Primitives) SetFieldC(v bool) { + x.FieldC = v +} +func (x *Primitives) GetFieldD() int32 { + if x != nil { + return x.FieldD + } + return 0 +} +func (x *Primitives) SetFieldD(v int32) { + x.FieldD = v +} +func (x *Primitives) GetFieldE() uint32 { + if x != nil { + return x.FieldE + } + return 0 +} +func (x *Primitives) SetFieldE(v uint32) { + x.FieldE = v +} +func (x *Primitives) GetFieldF() int64 { + if x != nil { + return x.FieldF + } + return 0 +} +func (x *Primitives) SetFieldF(v int64) { + x.FieldF = v +} +func (x *Primitives) GetFieldG() uint64 { + if x != nil { + return x.FieldG + } + return 0 +} +func (x *Primitives) SetFieldG(v uint64) { + x.FieldG = v +} +func (x *Primitives) GetFieldI() uint64 { + if x != nil { + return x.FieldI + } + return 0 +} +func (x *Primitives) SetFieldI(v uint64) { + x.FieldI = v +} +func (x *Primitives) GetFieldJ() float64 { + if x != nil { + return x.FieldJ + } + return 0 +} +func (x *Primitives) SetFieldJ(v float64) { + x.FieldJ = v +} +func (x *Primitives) GetFieldK() uint32 { + if x != nil { + return x.FieldK + } + return 0 +} +func (x *Primitives) SetFieldK(v uint32) { + x.FieldK = v +} +func (x *Primitives) GetFieldH() Primitives_SomeEnum { + if x != nil { + return x.FieldH + } + return 0 +} +func (x *Primitives) SetFieldH(v Primitives_SomeEnum) { + x.FieldH = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Primitives) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"fieldA\":" + out.RawString(prefix[1:]) + out.Base64Bytes(x.FieldA) + } + { + const prefix string = ",\"fieldB\":" + out.RawString(prefix) + out.String(x.FieldB) + } + { + const prefix string = ",\"fieldC\":" + out.RawString(prefix) + out.Bool(x.FieldC) + } + { + const prefix string = ",\"fieldD\":" + out.RawString(prefix) + out.Int32(x.FieldD) + } + { + const prefix string = ",\"fieldE\":" + out.RawString(prefix) + out.Uint32(x.FieldE) + } + { + const prefix string = ",\"fieldF\":" + out.RawString(prefix) + out.Int64(x.FieldF) + } + { + const prefix string = ",\"fieldG\":" + out.RawString(prefix) + out.Uint64(x.FieldG) + } + { + const prefix string = ",\"fieldI\":" + out.RawString(prefix) + out.Uint64(x.FieldI) + } + { + const prefix string = ",\"fieldJ\":" + out.RawString(prefix) + out.Float64(x.FieldJ) + } + { + const prefix string = ",\"fieldK\":" + out.RawString(prefix) + out.Uint32(x.FieldK) + } + { + const prefix string = ",\"fieldH\":" + out.RawString(prefix) + out.Int32(int32(x.FieldH)) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Primitives) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Primitives) 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 "fieldA": + { + var f []byte + f = in.Bytes() + x.FieldA = f + } + case "fieldB": + { + var f string + f = in.String() + x.FieldB = f + } + case "fieldC": + { + var f bool + f = in.Bool() + x.FieldC = f + } + case "fieldD": + { + var f int32 + f = in.Int32() + x.FieldD = f + } + case "fieldE": + { + var f uint32 + f = in.Uint32() + x.FieldE = f + } + case "fieldF": + { + var f int64 + f = in.Int64() + x.FieldF = f + } + case "fieldG": + { + var f uint64 + f = in.Uint64() + x.FieldG = f + } + case "fieldI": + { + var f uint64 + f = in.Uint64() + x.FieldI = f + } + case "fieldJ": + { + var f float64 + f = in.Float64() + x.FieldJ = f + } + case "fieldK": + { + var f uint32 + f = in.Uint32() + x.FieldK = f + } + case "fieldH": + { + var f Primitives_SomeEnum + var parsedValue Primitives_SomeEnum + switch v := in.Interface().(type) { + case string: + if vv, ok := Primitives_SomeEnum_value[v]; ok { + parsedValue = Primitives_SomeEnum(vv) + break + } + vv, err := strconv.ParseInt(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = Primitives_SomeEnum(vv) + case float64: + parsedValue = Primitives_SomeEnum(v) + } + f = parsedValue + x.FieldH = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + +type RepPrimitives struct { + FieldA [][]byte `json:"fieldA"` + FieldB []string `json:"fieldB"` + FieldC []int32 `json:"fieldC"` + FieldD []uint32 `json:"fieldD"` + FieldE []int64 `json:"fieldE"` + FieldF []uint64 `json:"fieldF"` + FieldFu []uint64 `json:"fieldFu"` +} + +var ( + _ encoding.ProtoMarshaler = (*RepPrimitives)(nil) + _ encoding.ProtoUnmarshaler = (*RepPrimitives)(nil) + _ json.Marshaler = (*RepPrimitives)(nil) + _ json.Unmarshaler = (*RepPrimitives)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RepPrimitives) StableSize() (size int) { + if x == nil { + return 0 + } + var n int + size += proto.RepeatedBytesSize(1, x.FieldA) + size += proto.RepeatedStringSize(2, x.FieldB) + n, _ = proto.RepeatedInt32Size(3, x.FieldC) + size += n + n, _ = proto.RepeatedUInt32Size(4, x.FieldD) + size += n + n, _ = proto.RepeatedInt64Size(5, x.FieldE) + size += n + n, _ = proto.RepeatedUInt64Size(6, x.FieldF) + size += n + for i := range x.FieldFu { + size += protowire.SizeGroup(protowire.Number(7), protowire.SizeVarint(x.FieldFu[i])) + } + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *RepPrimitives) 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 *RepPrimitives) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + for j := range x.FieldA { + mm.AppendBytes(1, x.FieldA[j]) + } + for j := range x.FieldB { + mm.AppendString(2, x.FieldB[j]) + } + if len(x.FieldC) != 0 { + mm.AppendInt32s(3, x.FieldC) + } + if len(x.FieldD) != 0 { + mm.AppendUint32s(4, x.FieldD) + } + if len(x.FieldE) != 0 { + mm.AppendInt64s(5, x.FieldE) + } + if len(x.FieldF) != 0 { + mm.AppendUint64s(6, x.FieldF) + } + for j := range x.FieldFu { + mm.AppendUint64(7, x.FieldFu[j]) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *RepPrimitives) 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", "RepPrimitives") + } + switch fc.FieldNum { + case 1: // FieldA + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldA") + } + x.FieldA = append(x.FieldA, data) + case 2: // FieldB + data, ok := fc.String() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldB") + } + x.FieldB = append(x.FieldB, data) + case 3: // FieldC + data, ok := fc.UnpackInt32s(nil) + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldC") + } + x.FieldC = data + case 4: // FieldD + data, ok := fc.UnpackUint32s(nil) + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldD") + } + x.FieldD = data + case 5: // FieldE + data, ok := fc.UnpackInt64s(nil) + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldE") + } + x.FieldE = data + case 6: // FieldF + data, ok := fc.UnpackUint64s(nil) + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldF") + } + x.FieldF = data + case 7: // FieldFu + data, ok := fc.Uint64() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldFu") + } + x.FieldFu = append(x.FieldFu, data) + } + } + return nil +} +func (x *RepPrimitives) GetFieldA() [][]byte { + if x != nil { + return x.FieldA + } + return nil +} +func (x *RepPrimitives) SetFieldA(v [][]byte) { + x.FieldA = v +} +func (x *RepPrimitives) GetFieldB() []string { + if x != nil { + return x.FieldB + } + return nil +} +func (x *RepPrimitives) SetFieldB(v []string) { + x.FieldB = v +} +func (x *RepPrimitives) GetFieldC() []int32 { + if x != nil { + return x.FieldC + } + return nil +} +func (x *RepPrimitives) SetFieldC(v []int32) { + x.FieldC = v +} +func (x *RepPrimitives) GetFieldD() []uint32 { + if x != nil { + return x.FieldD + } + return nil +} +func (x *RepPrimitives) SetFieldD(v []uint32) { + x.FieldD = v +} +func (x *RepPrimitives) GetFieldE() []int64 { + if x != nil { + return x.FieldE + } + return nil +} +func (x *RepPrimitives) SetFieldE(v []int64) { + x.FieldE = v +} +func (x *RepPrimitives) GetFieldF() []uint64 { + if x != nil { + return x.FieldF + } + return nil +} +func (x *RepPrimitives) SetFieldF(v []uint64) { + x.FieldF = v +} +func (x *RepPrimitives) GetFieldFu() []uint64 { + if x != nil { + return x.FieldFu + } + return nil +} +func (x *RepPrimitives) SetFieldFu(v []uint64) { + x.FieldFu = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *RepPrimitives) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"fieldA\":" + out.RawString(prefix[1:]) + out.RawByte('[') + for i := range x.FieldA { + if i != 0 { + out.RawByte(',') + } + out.Base64Bytes(x.FieldA[i]) + } + out.RawByte(']') + } + { + const prefix string = ",\"fieldB\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldB { + if i != 0 { + out.RawByte(',') + } + out.String(x.FieldB[i]) + } + out.RawByte(']') + } + { + const prefix string = ",\"fieldC\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldC { + if i != 0 { + out.RawByte(',') + } + out.Int32(x.FieldC[i]) + } + out.RawByte(']') + } + { + const prefix string = ",\"fieldD\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldD { + if i != 0 { + out.RawByte(',') + } + out.Uint32(x.FieldD[i]) + } + out.RawByte(']') + } + { + const prefix string = ",\"fieldE\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldE { + if i != 0 { + out.RawByte(',') + } + out.Int64(x.FieldE[i]) + } + out.RawByte(']') + } + { + const prefix string = ",\"fieldF\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldF { + if i != 0 { + out.RawByte(',') + } + out.Uint64(x.FieldF[i]) + } + out.RawByte(']') + } + { + const prefix string = ",\"fieldFu\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldFu { + if i != 0 { + out.RawByte(',') + } + out.Uint64(x.FieldFu[i]) + } + out.RawByte(']') + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *RepPrimitives) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *RepPrimitives) 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 "fieldA": + { + var f []byte + var list [][]byte + in.Delim('[') + for !in.IsDelim(']') { + f = in.Bytes() + list = append(list, f) + in.WantComma() + } + x.FieldA = list + in.Delim(']') + } + case "fieldB": + { + var f string + var list []string + in.Delim('[') + for !in.IsDelim(']') { + f = in.String() + list = append(list, f) + in.WantComma() + } + x.FieldB = list + in.Delim(']') + } + case "fieldC": + { + var f int32 + var list []int32 + in.Delim('[') + for !in.IsDelim(']') { + f = in.Int32() + list = append(list, f) + in.WantComma() + } + x.FieldC = list + in.Delim(']') + } + case "fieldD": + { + var f uint32 + var list []uint32 + in.Delim('[') + for !in.IsDelim(']') { + f = in.Uint32() + list = append(list, f) + in.WantComma() + } + x.FieldD = list + in.Delim(']') + } + case "fieldE": + { + var f int64 + var list []int64 + in.Delim('[') + for !in.IsDelim(']') { + f = in.Int64() + list = append(list, f) + in.WantComma() + } + x.FieldE = list + in.Delim(']') + } + case "fieldF": + { + var f uint64 + var list []uint64 + in.Delim('[') + for !in.IsDelim(']') { + f = in.Uint64() + list = append(list, f) + in.WantComma() + } + x.FieldF = list + in.Delim(']') + } + case "fieldFu": + { + var f uint64 + var list []uint64 + in.Delim('[') + for !in.IsDelim(']') { + f = in.Uint64() + list = append(list, f) + in.WantComma() + } + x.FieldFu = list + in.Delim(']') + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} diff --git a/util/proto/test/test_frostfs.pb.go b/util/proto/test/test_frostfs.pb.go deleted file mode 100644 index 47c6d60..0000000 --- a/util/proto/test/test_frostfs.pb.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by protoc-gen-go-frostfs. DO NOT EDIT. - -package test - -import ( - binary "encoding/binary" - protowire "google.golang.org/protobuf/encoding/protowire" -) - -import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto" - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *Primitives) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.BytesSize(1, x.FieldA) - size += proto.StringSize(2, x.FieldB) - size += proto.BoolSize(200, x.FieldC) - size += proto.Int32Size(201, x.FieldD) - size += proto.UInt32Size(202, x.FieldE) - size += proto.Int64Size(203, x.FieldF) - size += proto.UInt64Size(204, x.FieldG) - size += proto.Fixed64Size(205, x.FieldI) - size += proto.Float64Size(206, x.FieldJ) - size += proto.Fixed32Size(207, x.FieldK) - size += proto.EnumSize(300, int32(x.FieldH)) - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), 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 binary format. -func (x *Primitives) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.BytesMarshal(1, buf[offset:], x.FieldA) - offset += proto.StringMarshal(2, buf[offset:], x.FieldB) - offset += proto.BoolMarshal(200, buf[offset:], x.FieldC) - offset += proto.Int32Marshal(201, buf[offset:], x.FieldD) - offset += proto.UInt32Marshal(202, buf[offset:], x.FieldE) - offset += proto.Int64Marshal(203, buf[offset:], x.FieldF) - offset += proto.UInt64Marshal(204, buf[offset:], x.FieldG) - offset += proto.Fixed64Marshal(205, buf[offset:], x.FieldI) - offset += proto.Float64Marshal(206, buf[offset:], x.FieldJ) - offset += proto.Fixed32Marshal(207, buf[offset:], x.FieldK) - offset += proto.EnumMarshal(300, buf[offset:], int32(x.FieldH)) - return buf -} - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *RepPrimitives) StableSize() (size int) { - if x == nil { - return 0 - } - var n int - size += proto.RepeatedBytesSize(1, x.FieldA) - size += proto.RepeatedStringSize(2, x.FieldB) - n, _ = proto.RepeatedInt32Size(3, x.FieldC) - size += n - n, _ = proto.RepeatedUInt32Size(4, x.FieldD) - size += n - n, _ = proto.RepeatedInt64Size(5, x.FieldE) - size += n - n, _ = proto.RepeatedUInt64Size(6, x.FieldF) - size += n - for i := range x.FieldFu { - size += protowire.SizeGroup(protowire.Number(7), protowire.SizeVarint(x.FieldFu[i])) - } - return size -} - -// StableMarshal marshals x in protobuf binary format with stable field order. -// -// If buffer length is less than x.StableSize(), 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 binary format. -func (x *RepPrimitives) StableMarshal(buf []byte) []byte { - if x == nil { - return []byte{} - } - if buf == nil { - buf = make([]byte, x.StableSize()) - } - var offset int - offset += proto.RepeatedBytesMarshal(1, buf[offset:], x.FieldA) - offset += proto.RepeatedStringMarshal(2, buf[offset:], x.FieldB) - offset += proto.RepeatedInt32Marshal(3, buf[offset:], x.FieldC) - offset += proto.RepeatedUInt32Marshal(4, buf[offset:], x.FieldD) - offset += proto.RepeatedInt64Marshal(5, buf[offset:], x.FieldE) - offset += proto.RepeatedUInt64Marshal(6, buf[offset:], x.FieldF) - for i := range x.FieldFu { - { - prefix := protowire.EncodeTag(protowire.Number(7), protowire.VarintType) - offset += binary.PutUvarint(buf[offset:], uint64(prefix)) - offset += binary.PutUvarint(buf[offset:], x.FieldFu[i]) - } - } - return buf -} diff --git a/util/protogen/internalgengo/file.go b/util/protogen/internalgengo/file.go new file mode 100644 index 0000000..b5b351c --- /dev/null +++ b/util/protogen/internalgengo/file.go @@ -0,0 +1,250 @@ +package internalgengo + +import ( + "fmt" + "sort" + "strconv" + "strings" + + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/reflect/protoreflect" +) + +var ( + strconvPackage = protogen.GoImportPath("strconv") + fmtPackage = protogen.GoImportPath("fmt") + jsonPackage = protogen.GoImportPath("encoding/json") + easyprotoPackage = protogen.GoImportPath("github.com/VictoriaMetrics/easyproto") + mpPackage = protogen.GoImportPath("git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool") + protoPackage = protogen.GoImportPath("git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto") + encodingPackage = protogen.GoImportPath("git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding") + + mp = mpPackage.Ident("MarshalerPool") +) + +// GenerateFile generates a *.pb.go file enforcing field-order serialization. +func GenerateFile(gen *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile { + filename := file.GeneratedFilenamePrefix + "_frostfs.pb.go" + g := gen.NewGeneratedFile(filename, file.GoImportPath) + + g.P("// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.") + g.P() + g.P("package ", file.GoPackageName) + g.P() + g.Import(encodingPackage) + + // Doesn't work for multiple files in a single package, use external pool. + // g.P("var mp ", easyprotoPackage.Ident("MarshalerPool")) + + for _, e := range file.Enums { + emitEnum(g, e) + } + for _, msg := range file.Messages { + emitEasyProto(g, msg) + } + return g +} + +func emitEnum(g *protogen.GeneratedFile, e *protogen.Enum) { + g.P("type " + e.GoIdent.GoName + " int32") + g.P("const (") + for _, ev := range e.Values { + g.P(ev.GoIdent.GoName, " ", e.GoIdent.GoName, " = ", ev.Desc.Number()) + } + g.P(")") + + g.P("var (") + g.P(e.GoIdent.GoName+"_name", " = map[int32]string{") + for _, value := range e.Values { + g.P(value.Desc.Number(), ": ", strconv.Quote(string(value.Desc.Name())), ",") + } + g.P("}") + g.P(e.GoIdent.GoName+"_value", " = map[string]int32{") + for _, value := range e.Values { + g.P(strconv.Quote(string(value.Desc.Name())), ": ", value.Desc.Number(), ",") + } + g.P("}") + g.P(")") + g.P() + + g.P("func (x ", e.GoIdent.GoName, ") String() string {") + g.P("if v, ok := ", e.GoIdent.GoName+"_name[int32(x)]; ok {") + g.P("return v") + g.P("}") + g.P("return ", strconvPackage.Ident("FormatInt"), "(int64(x), 10)") + g.P("}") + + g.P("func (x *", e.GoIdent.GoName, ") FromString(s string) bool {") + g.P("if v, ok := ", e.GoIdent.GoName+"_value[s]; ok {") + g.P("*x = ", e.GoIdent.GoName, "(v)") + g.P("return true") + g.P("}") + g.P("return false") + g.P("}") +} + +func emitEasyProto(g *protogen.GeneratedFile, msg *protogen.Message) { + for _, e := range msg.Enums { + emitEnum(g, e) + } + for _, m := range msg.Messages { + emitEasyProto(g, m) + } + + g.P("type " + msg.GoIdent.GoName + " struct {") + emitMessageFields(g, msg) + g.P("}") + + g.P("var (") + g.P("_ ", encodingPackage.Ident("ProtoMarshaler"), " = (*", msg.GoIdent.GoName, ")(nil)") + g.P("_ ", encodingPackage.Ident("ProtoUnmarshaler"), " = (*", msg.GoIdent.GoName, ")(nil)") + g.P("_ ", jsonPackage.Ident("Marshaler"), " = (*", msg.GoIdent.GoName, ")(nil)") + g.P("_ ", jsonPackage.Ident("Unmarshaler"), " = (*", msg.GoIdent.GoName, ")(nil)") + g.P(")") + + emitStableSize(g, msg) + if strings.HasSuffix(msg.GoIdent.GoName, "Request") || strings.HasSuffix(msg.GoIdent.GoName, "Response") { + emitSignatureMethods(g, msg) + } + + emitProtoMethods(g, msg) + emitGettersSetters(g, msg) + emitJSONMethods(g, msg) + + for _, f := range msg.Fields { + if isFirstOneof(f) { + genOneof(g, f) + } + } +} + +func isFirstOneof(f *protogen.Field) bool { + return f.Oneof != nil && f == f.Oneof.Fields[0] +} + +func emitOneofGettersSetters(g *protogen.GeneratedFile, msg *protogen.Message, ff *protogen.Field) { + // For some reason protoc generates different code for oneof message/non-message fields: + // 1. For message we have 2 level struct wrapping and setters use inner type. + // 2. For other types we also have 2 level wrapping, but setters use outer type. + if ff.Desc.Kind() == protoreflect.MessageKind { + ft := fieldType(g, ff) + + g.P("func (x *", msg.GoIdent.GoName, ") Get", ff.GoName, "() ", ft, " {") + g.P("if xx, ok := x.Get", ff.Oneof.GoName, "().(*", ff.GoIdent, "); ok { return xx.", ff.GoName, " }") + g.P("return nil") + g.P("}") + + g.P("func (x *", msg.GoIdent.GoName, ") Set", ff.GoName, "(v ", ft, ") {") + g.P("x.", ff.Oneof.GoName, " = &", ff.GoIdent, "{", ff.GoName, ": v}") + g.P("}") + } else { + g.P("func (x *", msg.GoIdent.GoName, ") Get", ff.GoName, "() *", ff.GoIdent, " {") + g.P("if xx, ok := x.Get", ff.Oneof.GoName, "().(*", ff.GoIdent, "); ok { return xx }") + g.P("return nil") + g.P("}") + + g.P("func (x *", msg.GoIdent.GoName, ") Set", ff.GoName, "(v *", ff.GoIdent, ") {") + g.P("x.", ff.Oneof.GoName, " = v") + g.P("}") + + ft := fieldType(g, ff) + emitGetterSetter(g, ff.GoIdent.GoName, ff.GoName, ft.String(), "nil") + } +} + +func emitGettersSetters(g *protogen.GeneratedFile, msg *protogen.Message) { + for _, f := range msg.Fields { + if f.Oneof != nil { + if f.Oneof.Fields[0] == f { + emitGetterSetter(g, msg.GoIdent.GoName, f.Oneof.GoName, oneOfDescriptor(f.Oneof), "nil") + for _, ff := range f.Oneof.Fields { + emitOneofGettersSetters(g, msg, ff) + } + } + continue + } + + ft := fieldType(g, f) + emitGetterSetter(g, msg.GoIdent.GoName, f.GoName, ft.String(), fieldDefaultValue(f)) + } +} + +func emitMessageFields(g *protogen.GeneratedFile, msg *protogen.Message) { + for _, field := range msg.Fields { + genMessageField(g, field) + } +} + +func genMessageField(g *protogen.GeneratedFile, field *protogen.Field) { + if field.Oneof != nil { + if field.Oneof.Fields[0] == field { + g.P(field.Oneof.GoName, " ", oneOfDescriptor(field.Oneof)) + } + return + } + + typ := fieldType(g, field) + g.P(field.GoName, " ", typ, fmt.Sprintf(" `json:%q`", fieldJSONName(field))) +} + +func oneOfDescriptor(oneof *protogen.Oneof) string { + return "is" + oneof.GoIdent.GoName +} + +func genOneof(g *protogen.GeneratedFile, field *protogen.Field) { + ifName := oneOfDescriptor(field.Oneof) + g.P("type ", ifName, " interface {") + g.P(ifName, "()") + g.P("}") + g.P() + for _, field := range field.Oneof.Fields { + g.P("type ", field.GoIdent, " struct {") + + ft := fieldType(g, field) + g.P(field.GoName, " ", ft) + g.P("}") + g.P() + } + for _, field := range field.Oneof.Fields { + g.P("func (*", field.GoIdent, ") ", ifName, "() {}") + g.P() + } +} + +func fieldDefaultValue(field *protogen.Field) string { + if field.Desc.Cardinality() == protoreflect.Repeated { + return "nil" + } + + switch field.Desc.Kind() { + case protoreflect.MessageKind, protoreflect.BytesKind: + return "nil" + case protoreflect.BoolKind: + return "false" + case protoreflect.StringKind: + return `""` + default: + return "0" + } +} + +func castFieldName(f *protogen.Field) string { + if f.Oneof != nil { + return "x." + f.Oneof.GoName + } + + name := "x." + f.GoName + if f.Desc.Kind() != protoreflect.EnumKind { + return name + } + return "int32(" + name + ")" +} + +func sortFields(fs []*protogen.Field) []*protogen.Field { + res := make([]*protogen.Field, len(fs)) + copy(res, fs) + sort.Slice(res, func(i, j int) bool { + return res[i].Desc.Number() < res[j].Desc.Number() + }) + return res +} diff --git a/util/protogen/internalgengo/fuzz.go b/util/protogen/internalgengo/fuzz.go new file mode 100644 index 0000000..ec99692 --- /dev/null +++ b/util/protogen/internalgengo/fuzz.go @@ -0,0 +1,69 @@ +package internalgengo + +import ( + "google.golang.org/protobuf/compiler/protogen" +) + +var testingPackage = protogen.GoImportPath("testing") + +func GenerateFuzzTests(gen *protogen.Plugin, file *protogen.File) { + { + filename := file.GeneratedFilenamePrefix + "_frostfs_fuzz.go" + g := gen.NewGeneratedFile(filename, file.GoImportPath) + + g.P("//go:build gofuzz") + g.P("// +build gofuzz") + g.P("// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.") + g.P() + g.P("package ", file.GoPackageName) + g.P() + + for _, msg := range file.Messages { + emitFuzzWrappers(g, msg) + } + } + { + filename := file.GeneratedFilenamePrefix + "_frostfs_test.go" + g := gen.NewGeneratedFile(filename, file.GoImportPath) + + g.P("//go:build gofuzz") + g.P("// +build gofuzz") + g.P("// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.") + g.P() + g.P("package ", file.GoPackageName) + g.P() + + for _, msg := range file.Messages { + emitFuzzTests(g, msg) + } + } +} + +func emitFuzzWrappers(g *protogen.GeneratedFile, msg *protogen.Message) { + g.P("func DoFuzzProto", msg.GoIdent.GoName, "(data []byte) int {") + g.P("msg := new(", msg.GoIdent.GoName, ")") + g.P("if err := msg.UnmarshalProtobuf(data); err != nil { return 0 }") + g.P("_ = msg.MarshalProtobuf(nil)") + g.P("return 1") + g.P("}") + + g.P("func DoFuzzJSON", msg.GoIdent.GoName, "(data []byte) int {") + g.P("msg := new(", msg.GoIdent.GoName, ")") + g.P("if err := msg.UnmarshalJSON(data); err != nil { return 0 }") + g.P("_, err := msg.MarshalJSON()") + g.P("if err != nil { panic(err) }") + g.P("return 1") + g.P("}") +} + +func emitFuzzTests(g *protogen.GeneratedFile, msg *protogen.Message) { + g.P("func FuzzProto", msg.GoIdent.GoName, "(f *", testingPackage.Ident("F"), ") {") + g.P("f.Fuzz(func(t *", testingPackage.Ident("T"), ", data []byte) {") + g.P("DoFuzzProto", msg.GoIdent.GoName, "(data)") + g.P("})}") + + g.P("func FuzzJSON", msg.GoIdent.GoName, "(f *", testingPackage.Ident("F"), ") {") + g.P("f.Fuzz(func(t *", testingPackage.Ident("T"), ", data []byte) {") + g.P("DoFuzzJSON", msg.GoIdent.GoName, "(data)") + g.P("})}") +} diff --git a/util/protogen/internalgengo/getter.go b/util/protogen/internalgengo/getter.go new file mode 100644 index 0000000..78deef7 --- /dev/null +++ b/util/protogen/internalgengo/getter.go @@ -0,0 +1,14 @@ +package internalgengo + +import "google.golang.org/protobuf/compiler/protogen" + +func emitGetterSetter(g *protogen.GeneratedFile, typeName string, fieldName string, fieldType string, defaultValue string) { + g.P("func (x *", typeName, ") Get", fieldName, "() ", fieldType, " {") + g.P("if x != nil { return x.", fieldName, "}") + g.P("return ", defaultValue) + g.P("}") + + g.P("func (x *", typeName, ") Set", fieldName, "(v ", fieldType, ") {") + g.P("x.", fieldName, " = v") + g.P("}") +} diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go new file mode 100644 index 0000000..ad43fc8 --- /dev/null +++ b/util/protogen/internalgengo/json.go @@ -0,0 +1,230 @@ +package internalgengo + +import ( + "fmt" + + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/reflect/protoreflect" +) + +var ( + jwriterPackage = protogen.GoImportPath("github.com/mailru/easyjson/jwriter") + jlexerPackage = protogen.GoImportPath("github.com/mailru/easyjson/jlexer") +) + +func emitJSONMethods(g *protogen.GeneratedFile, msg *protogen.Message) { + emitJSONMarshal(g, msg) + emitJSONUnmarshal(g, msg) +} + +func emitJSONUnmarshal(g *protogen.GeneratedFile, msg *protogen.Message) { + g.P("// UnmarshalJSON implements the json.Unmarshaler interface.") + g.P("func (x *", msg.GoIdent.GoName, ") UnmarshalJSON(data []byte) error {") + g.P("r := ", jlexerPackage.Ident("Lexer"), "{Data: data}") + g.P("x.UnmarshalEasyJSON(&r)") + g.P("return r.Error()") + g.P("}") + + g.P("func (x *", msg.GoIdent.GoName, ") UnmarshalEasyJSON(in *", jlexerPackage.Ident("Lexer"), ") {") + + g.P("isTopLevel := in.IsStart()") + g.P("if in.IsNull() {") + g.P("if isTopLevel { in.Consumed() }") + g.P("in.Skip()") + g.P("return") + g.P("}") + + g.P("in.Delim('{')") + g.P("for !in.IsDelim('}') {") + + g.P("key := in.UnsafeFieldName(false)") + g.P("in.WantColon()") + g.P("if in.IsNull() { in.Skip(); in.WantComma(); continue }") + g.P("switch key {") + for _, f := range msg.Fields { + g.P(`case "`, fieldJSONName(f), `":`) + if f.Oneof != nil { + g.P("xx := new(", f.GoIdent, ")") + g.P("x." + f.Oneof.GoName + " = xx") + emitJSONFieldRead(g, f, "xx") + continue + } + emitJSONFieldRead(g, f, "x") + } + g.P("}") + g.P("in.WantComma()") + g.P("}") + g.P("in.Delim('}')") + g.P("if isTopLevel { in.Consumed() }") + g.P("}") +} + +func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string) { + g.P("{") + defer g.P("}") + + if f.Desc.IsList() { + g.P("var f ", fieldType(g, f)[2:]) + g.P("var list ", fieldType(g, f)) + g.P("in.Delim('[')") + defer g.P("in.Delim(']')") + + g.P("for !in.IsDelim(']') {") + } else { + g.P("var f ", fieldType(g, f)) + } + + var template string + switch f.Desc.Kind() { + case protoreflect.BoolKind: + template = "%s = in.Bool()" + case protoreflect.EnumKind: + g.Import(strconvPackage) + + enumType := fieldType(g, f).String() + g.P("var parsedValue " + enumType) + g.P(`switch v := in.Interface().(type) { + case string: + if vv, ok := `+enumType+`_value[v]; ok { + parsedValue = `+enumType+`(vv) + break + } + vv, err := `, strconvPackage.Ident("ParseInt"), `(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + parsedValue = `+enumType+`(vv) + case float64: + parsedValue = `+enumType+`(v) + }`) + template = "%s = parsedValue" + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + template = "%s = in.Int32()" + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + template = "%s = in.Uint32()" + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + template = "%s = in.Int64()" + case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + template = "%s = in.Uint64()" + case protoreflect.FloatKind: + template = "%s = in.Float32()" + case protoreflect.DoubleKind: + template = "%s = in.Float64()" + case protoreflect.StringKind: + template = "%s = in.String()" + case protoreflect.BytesKind: + template = "%s = in.Bytes()" + case protoreflect.MessageKind: + if f.Desc.IsList() { + g.P("f = new(", fieldType(g, f)[3:], ")") + } else { + g.P("f = new(", fieldType(g, f)[1:], ")") + } + template = "%s.UnmarshalEasyJSON(in)" + case protoreflect.GroupKind: + panic("unimplemented") + } + g.P(fmt.Sprintf(template, "f")) + if f.Desc.IsList() { + g.P("list = append(list, f)") + g.P("in.WantComma()") + g.P("}") + g.P(name, ".", f.GoName, " = list") + } else { + g.P(name, ".", f.GoName, " = f") + } +} + +func emitJSONMarshal(g *protogen.GeneratedFile, msg *protogen.Message) { + g.P("// MarshalJSON implements the json.Marshaler interface.") + g.P("func (x *", msg.GoIdent.GoName, ") MarshalJSON() ([]byte, error) {") + g.P("w := ", jwriterPackage.Ident("Writer"), "{}") + g.P("x.MarshalEasyJSON(&w)") + g.P("return w.Buffer.BuildBytes(), w.Error") + g.P("}") + + g.P("func (x *", msg.GoIdent.GoName, ") MarshalEasyJSON(out *", jwriterPackage.Ident("Writer"), ") {") + g.P(`if x == nil { out.RawString("null"); return }`) + + g.P("out.RawByte('{')") + for i, f := range msg.Fields { + if f.Oneof != nil { + if f.Oneof.Fields[0] != f { + continue + } + + g.P("switch xx := x.", f.Oneof.GoName, ".(type) {") + for _, ff := range f.Oneof.Fields { + g.P("case *", ff.GoIdent, ":") + emitJSONFieldWrite(g, ff, "xx", i == 0) + } + g.P("default:") + g.P(`out.RawString("null")`) + g.P("}") + continue + } + emitJSONFieldWrite(g, f, "x", i == 0) + } + g.P("out.RawByte('}')") + g.P("}") +} + +func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name string, first bool) { + g.P("{") + defer g.P("}") + + g.P("const prefix string = ", `",\"`, fieldJSONName(f), `\":"`) + if first { + g.P("out.RawString(prefix[1:])") + } else { + g.P("out.RawString(prefix)") + } + + selector := name + "." + f.GoName + if f.Desc.IsList() { + selector += "[i]" + g.P("out.RawByte('[')") + defer g.P("out.RawByte(']')") + + g.P("for i := range ", name, ".", f.GoName, " {") + g.P("if i != 0 { out.RawByte(',') }") + defer g.P("}") + } + + var template string + switch f.Desc.Kind() { + case protoreflect.BoolKind: + template = "out.Bool(%s)" + case protoreflect.EnumKind: + template = "out.Int32(int32(%s))" + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + template = "out.Int32(%s)" + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + template = "out.Uint32(%s)" + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + template = "out.Int64(%s)" + case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + template = "out.Uint64(%s)" + case protoreflect.FloatKind: + template = "out.Float32(%s)" + case protoreflect.DoubleKind: + template = "out.Float64(%s)" + case protoreflect.StringKind: + template = "out.String(%s)" + case protoreflect.BytesKind: + template = "out.Base64Bytes(%s)" + case protoreflect.MessageKind: + template = "%s.MarshalEasyJSON(out)" + case protoreflect.GroupKind: + panic("unimplemented") + } + g.P(fmt.Sprintf(template, selector)) +} + +func fieldJSONName(f *protogen.Field) string { + if f.Desc.HasJSONName() { + return f.Desc.JSONName() + } + return string(f.Desc.Name()) +} diff --git a/util/protogen/internalgengo/options.go b/util/protogen/internalgengo/options.go new file mode 100644 index 0000000..8aab8f0 --- /dev/null +++ b/util/protogen/internalgengo/options.go @@ -0,0 +1,7 @@ +package internalgengo + +type Options struct { + Fuzz bool `yaml:"fuzz"` + JSON bool `yaml:"json"` + MessageData []string `yaml:"message_data"` +} diff --git a/util/protogen/internalgengo/proto.go b/util/protogen/internalgengo/proto.go new file mode 100644 index 0000000..8e5e967 --- /dev/null +++ b/util/protogen/internalgengo/proto.go @@ -0,0 +1,201 @@ +package internalgengo + +import ( + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/reflect/protoreflect" +) + +func emitProtoMethods(g *protogen.GeneratedFile, msg *protogen.Message) { + emitMarshalProtobuf(g, msg) + emitUnmarshalProtobuf(g, msg) +} + +func emitUnmarshalProtobuf(g *protogen.GeneratedFile, msg *protogen.Message) { + g.P("// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.") + g.P("func (x *", msg.GoIdent.GoName, ") UnmarshalProtobuf(src []byte) (err error) {") + g.P("var fc ", easyprotoPackage.Ident("FieldContext")) + g.P("for len(src) > 0 {") + { + g.P("src, err = fc.NextField(src)") + g.P("if err != nil { return ", fmtPackage.Ident("Errorf"), `("cannot read next field in %s", "`, msg.GoIdent.GoName, `")}`) + g.P("switch fc.FieldNum {") + { + for _, f := range msg.Fields { + g.P("case ", f.Desc.Number(), ":", " // ", f.GoName) + emitFieldUnmarshal(g, f) + } + } + g.P("}") + } + g.P("}") + + g.P("return nil") + g.P("}") +} + +func emitFieldUnmarshal(g *protogen.GeneratedFile, f *protogen.Field) { + name := castFieldName(f) + if f.Desc.Kind() == protoreflect.MessageKind { + g.P("data, ok := fc.MessageData()") + g.P(`if !ok { return fmt.Errorf("cannot unmarshal field %s", "`, f.GoName, `") }`) + if f.Desc.IsList() { + g.P(name, " = append(", name, ", new(", fieldType(g, f)[3:], "))") + g.P("ff := ", name, "[len(", name, ")-1]") + name = "ff" + } else if f.Oneof != nil { + const tmp = "oneofField" + g.P(tmp, " := &", f.GoIdent, "{", f.GoName, ": ", "new(", fieldType(g, f)[1:], ")}") + defer g.P(name, " = ", tmp) + + name = tmp + "." + f.GoName + } else { + g.P(name, " = new(", fieldType(g, f)[1:], ")") + } + + g.P(`if err := `, name, `.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err)}`) + return + } + + getter, _ := easyprotoKindInfo(f.Desc.Kind()) + + if f.Desc.IsList() && (f.Desc.Kind() == protoreflect.BytesKind || f.Desc.Kind() == protoreflect.StringKind || f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()) { + g.P("data, ok := fc.", getter, "()") + g.P(`if !ok { return fmt.Errorf("cannot unmarshal field %s", "`, f.GoName, `") }`) + g.P(name, " = append(", name, ", data)") + return + } + + if f.Desc.IsList() { + g.P("data, ok := fc.Unpack", getter, "s(nil)") + } else { + g.P("data, ok := fc.", getter, "()") + } + + g.P(`if !ok { return fmt.Errorf("cannot unmarshal field %s", "`, f.GoName, `") }`) + value := "data" + if f.Desc.Kind() == protoreflect.EnumKind { + value = fieldType(g, f).String() + "(data)" + } + + if f.Oneof == nil { + g.P("x.", f.GoName, " = ", value) + } else { + g.P("x.", f.Oneof.GoName, " = &", f.GoIdent, "{", f.GoName, ": data}") + } +} + +func emitMarshalProtobuf(g *protogen.GeneratedFile, msg *protogen.Message) { + g.P("// MarshalProtobuf implements the encoding.ProtoMarshaler interface.") + g.P("func (x *", msg.GoIdent.GoName, ") MarshalProtobuf(dst []byte) []byte {") + g.P("m := ", mp, ".Get()") + g.P("defer ", mp, ".Put(m)") + g.P("x.EmitProtobuf(m.MessageMarshaler())") + g.P("dst = m.Marshal(dst)") + g.P("return dst") + g.P("}\n") + + g.P("func (x *", msg.GoIdent.GoName, ") EmitProtobuf(mm *", easyprotoPackage.Ident("MessageMarshaler"), ") {") + if len(msg.Fields) != 0 { + fs := sortFields(msg.Fields) + + g.P("if x == nil { return }") + for _, f := range fs { + emitFieldMarshal(g, f) + } + } + g.P("}") +} + +func emitMarshalOneof(g *protogen.GeneratedFile, f *protogen.Field) { + name := "x." + f.Oneof.GoName + g.P("if inner, ok := ", name, ".(*", f.GoIdent.GoName, "); ok {") + defer g.P("}") + emitMarshalRaw(g, f, "inner."+f.GoName) +} + +// easyprotoKindInfo returns string name for kind, used in easyproto methods. +// The second return value is a condition to test for the default value of kind. +func easyprotoKindInfo(kind protoreflect.Kind) (string, func(string) string) { + switch kind { + case protoreflect.BoolKind: + return "Bool", identity + case protoreflect.EnumKind: + return "Int32", notZero + case protoreflect.Int32Kind: + return "Int32", notZero + case protoreflect.Sint32Kind: + return "Sint32", notZero + case protoreflect.Uint32Kind: + return "Uint32", notZero + case protoreflect.Int64Kind: + return "Int64", notZero + case protoreflect.Sint64Kind: + return "Sint64", notZero + case protoreflect.Uint64Kind: + return "Uint64", notZero + case protoreflect.Sfixed32Kind: + return "Sfixed32", notZero + case protoreflect.Fixed32Kind: + return "Fixed32", notZero + case protoreflect.FloatKind: + return "Float", notZero + case protoreflect.Sfixed64Kind: + return "Sfixed64", notZero + case protoreflect.Fixed64Kind: + return "Fixed64", notZero + case protoreflect.DoubleKind: + return "Double", notZero + case protoreflect.StringKind: + return "String", notEmpty + case protoreflect.BytesKind: + return "Bytes", notEmpty + case protoreflect.GroupKind: + panic("unimplemented") + default: + panic("unreachable") + } +} + +func emitFieldMarshal(g *protogen.GeneratedFile, f *protogen.Field) { + if f.Oneof != nil { + emitMarshalOneof(g, f) + return + } + + emitMarshalRaw(g, f, castFieldName(f)) +} + +func emitMarshalRaw(g *protogen.GeneratedFile, f *protogen.Field, name string) { + if f.Desc.Kind() == protoreflect.MessageKind { + if f.Desc.IsList() { + g.P("for i := range ", name, " {") + defer g.P("}") + + name += "[i]" + } + + g.P("if ", notNil(name), " && ", name, ".StableSize() != 0 {") + g.P(name, ".EmitProtobuf(mm.AppendMessage(", f.Desc.Number(), "))") + g.P("}") + return + } + + method, cond := easyprotoKindInfo(f.Desc.Kind()) + method = "Append" + method + if f.Desc.IsList() && !f.Desc.IsPacked() { + g.P("for j := range ", name, " {") + g.P("mm.", method, "(", f.Desc.Number(), ", ", name, "[j])") + g.P("}") + return + } + + if f.Desc.IsList() { + method += "s" + g.P("if ", notEmpty(name), "{") + } else { + g.P("if ", cond(name), " {") + } + + g.P("mm.", method, "(", f.Desc.Number(), ", ", name, ")") + g.P("}") +} diff --git a/util/protogen/internalgengo/proto_field_type.go b/util/protogen/internalgengo/proto_field_type.go new file mode 100644 index 0000000..09f6884 --- /dev/null +++ b/util/protogen/internalgengo/proto_field_type.go @@ -0,0 +1,56 @@ +package internalgengo + +import ( + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/reflect/protoreflect" +) + +type structField string + +func (f structField) String() string { + return string(f) +} + +func (f structField) PointerTo() structField { + return "*" + f +} + +func (f structField) SliceOf() structField { + return "[]" + f +} + +func fieldType(g *protogen.GeneratedFile, field *protogen.Field) structField { + var typ structField + switch field.Desc.Kind() { + case protoreflect.BoolKind: + typ = "bool" + case protoreflect.EnumKind: + typ = structField(g.QualifiedGoIdent(field.Enum.GoIdent)) + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + typ = "int32" + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + typ = "uint32" + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + typ = "int64" + case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + typ = "uint64" + case protoreflect.FloatKind: + typ = "float32" + case protoreflect.DoubleKind: + typ = "float64" + case protoreflect.StringKind: + typ = "string" + case protoreflect.BytesKind: + typ = "[]byte" + case protoreflect.MessageKind: + typ = structField(g.QualifiedGoIdent(field.Message.GoIdent)).PointerTo() + case protoreflect.GroupKind: + panic("unimplemented") + } + + if field.Desc.IsList() { + typ = "[]" + typ + } + + return typ +} diff --git a/util/protogen/internalgengo/proto_stable_compat.go b/util/protogen/internalgengo/proto_stable_compat.go new file mode 100644 index 0000000..c27b9d8 --- /dev/null +++ b/util/protogen/internalgengo/proto_stable_compat.go @@ -0,0 +1,124 @@ +package internalgengo + +import ( + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/reflect/protoreflect" +) + +var protowirePackage = protogen.GoImportPath("google.golang.org/protobuf/encoding/protowire") + +func emitStableSize(g *protogen.GeneratedFile, msg *protogen.Message) { + fs := sortFields(msg.Fields) + + g.P("// StableSize returns the size of x in protobuf format.") + g.P("//") + g.P("// Structures with the same field values have the same binary size.") + g.P("func (x *", msg.GoIdent.GoName, ") StableSize() (size int) {") + g.P("if x == nil { return 0 }") + if len(fs) != 0 { + for _, f := range fs { + if f.Desc.IsList() && marshalers[f.Desc.Kind()].RepeatedDouble && !(f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()) { + g.P("var n int") + break + } + } + for _, f := range fs { + emitFieldSize(g, f) + } + } + g.P("return size") + g.P("}\n") +} + +func emitSignatureMethods(g *protogen.GeneratedFile, msg *protogen.Message) { + // SignedDataSize implementation (only for requests and responses). + g.P("// ReadSignedData fills buf with signed data of x.") + g.P("// If buffer length is less than x.SignedDataSize(), new buffer is allocated.") + g.P("//") + g.P("// Returns any error encountered which did not allow writing the data completely.") + g.P("// Otherwise, returns the buffer in which the data is written.") + g.P("//") + g.P("// Structures with the same field values have the same signed data.") + g.P("func (x *", msg.GoIdent.GoName, ") SignedDataSize() int {") + g.P("return x.GetBody().StableSize()") + g.P("}\n") + + // ReadSignedData implementation (only for requests and responses). + g.P("// SignedDataSize returns size of the request signed data in bytes.") + g.P("//") + g.P("// Structures with the same field values have the same signed data size.") + g.P("func (x *", msg.GoIdent.GoName, ") ReadSignedData(buf []byte) ([]byte, error) {") + g.P("return x.GetBody().MarshalProtobuf(buf), nil") + g.P("}\n") +} + +func emitFieldSize(g *protogen.GeneratedFile, f *protogen.Field) { + m := marshalers[f.Desc.Kind()] + if m.Prefix == "" { + g.P("// FIXME missing field marshaler: ", f.GoName, " of type ", f.Desc.Kind().String()) + g.P(`panic("unimplemented")`) + return + } + + name := castFieldName(f) + if f.Oneof != nil { + name = "x." + f.Oneof.GoName + g.P("if inner, ok := ", name, ".(*", f.GoIdent.GoName, "); ok {") + defer g.P("}") + name = "inner." + f.GoName + } + + switch { + case f.Desc.IsList() && (f.Desc.Kind() == protoreflect.MessageKind || f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()): + g.P("for i := range ", name, "{") + if f.Desc.Kind() == protoreflect.MessageKind { + g.P("size += ", protoPackage.Ident("NestedStructureSize"), "(", f.Desc.Number(), ", ", name, "[i])") + } else { + if f.Desc.Kind() != protoreflect.Uint64Kind { + panic("only uint64 unpacked primitive is supported") + } + + g.P("size += ", protowirePackage.Ident("SizeGroup"), "(", + protowirePackage.Ident("Number"), "(", f.Desc.Number(), "), ", + protowirePackage.Ident("SizeVarint"), "(", name, "[i]))") + } + g.P("}") + + case f.Desc.IsList(): + if m.RepeatedDouble { + g.P("n, _ = ", protoPackage.Ident("Repeated"+m.Prefix+"Size"), "(", f.Desc.Number(), ", ", name, ")") + g.P("size += n") + } else { + g.P("size += ", protoPackage.Ident("Repeated"+m.Prefix+"Size"), "(", f.Desc.Number(), ", ", name, ")") + } + default: + g.P("size += ", protoPackage.Ident(m.Prefix+"Size"), "(", f.Desc.Number(), ", ", name, ")") + } +} + +type marshalerDesc struct { + Prefix string + RepeatedDouble bool +} + +// Unused kinds are commented. +var marshalers = map[protoreflect.Kind]marshalerDesc{ + protoreflect.BoolKind: {Prefix: "Bool"}, + protoreflect.EnumKind: {Prefix: "Enum"}, + protoreflect.Int32Kind: {Prefix: "Int32", RepeatedDouble: true}, + // protoreflect.Sint32Kind: "", + protoreflect.Uint32Kind: {Prefix: "UInt32", RepeatedDouble: true}, + protoreflect.Int64Kind: {Prefix: "Int64", RepeatedDouble: true}, + // protoreflect.Sint64Kind: "", + protoreflect.Uint64Kind: {Prefix: "UInt64", RepeatedDouble: true}, + // protoreflect.Sfixed32Kind: "", + protoreflect.Fixed32Kind: {Prefix: "Fixed32", RepeatedDouble: true}, + // protoreflect.FloatKind: "", + // protoreflect.Sfixed64Kind: "", + protoreflect.Fixed64Kind: {Prefix: "Fixed64", RepeatedDouble: true}, + protoreflect.DoubleKind: {Prefix: "Float64"}, + protoreflect.StringKind: {Prefix: "String"}, + protoreflect.BytesKind: {Prefix: "Bytes"}, + protoreflect.MessageKind: {Prefix: "NestedStructure"}, + // protoreflect.GroupKind: "", +} diff --git a/util/protogen/internalgengo/writer.go b/util/protogen/internalgengo/writer.go new file mode 100644 index 0000000..7b0d4f1 --- /dev/null +++ b/util/protogen/internalgengo/writer.go @@ -0,0 +1,30 @@ +package internalgengo + +import ( + "fmt" +) + +type condition = func(string) string + +var ( + _ condition = notZero + _ condition = notEmpty + _ condition = identity + _ condition = notNil +) + +func notZero(name string) string { + return fmt.Sprintf("%s != 0", name) +} + +func notEmpty(name string) string { + return fmt.Sprintf("len(%s) != 0", name) +} + +func identity(name string) string { + return name +} + +func notNil(name string) string { + return fmt.Sprintf("%s != nil", name) +} diff --git a/util/protogen/main.go b/util/protogen/main.go index 0f2a7ca..bfce1bf 100644 --- a/util/protogen/main.go +++ b/util/protogen/main.go @@ -1,258 +1,37 @@ package main import ( - "sort" - "strings" + "flag" + "fmt" + "os" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/protogen/internalgengo" "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/reflect/protoreflect" -) - -var ( - protowirePackage = protogen.GoImportPath("google.golang.org/protobuf/encoding/protowire") - binaryPackage = protogen.GoImportPath("encoding/binary") ) func main() { - protogen.Options{}.Run(func(gen *protogen.Plugin) error { + var flags flag.FlagSet + genFuzz := flags.Bool("fuzz", false, "generate fuzz tests") + yamlConfigPath := flags.String("config", "", "path to the configuration") + + protogen.Options{ + ParamFunc: flags.Set, + }.Run(func(gen *protogen.Plugin) error { + if *yamlConfigPath != "" { + s, e := os.Getwd() + fmt.Fprintln(os.Stderr, s, e) + data, err := os.ReadFile(*yamlConfigPath) + fmt.Fprintln(os.Stderr, string(data), err) + } + for _, f := range gen.Files { if f.Generate { - generateFile(gen, f) + internalgengo.GenerateFile(gen, f) + if *genFuzz { + internalgengo.GenerateFuzzTests(gen, f) + } } } return nil }) } - -// generateFile generates a *.pb.go file enforcing field-order serialization. -func generateFile(gen *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile { - filename := file.GeneratedFilenamePrefix + "_frostfs.pb.go" - g := gen.NewGeneratedFile(filename, file.GoImportPath) - g.P("// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.") - g.P() - g.P("package ", file.GoPackageName) - g.P() - g.P(`import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"`) - - //for _, e := range file.Enums { - // g.P("type " + e.GoIdent.GoName + " int32") - // g.P("const (") - // for _, ev := range e.Values { - // g.P(ev.GoIdent.GoName, " = ", ev.Desc.Number()) - // } - // g.P(")") - //} - for _, msg := range file.Messages { - emitMessage(g, msg) - } - return g -} - -func emitMessage(g *protogen.GeneratedFile, msg *protogen.Message) { - for _, inner := range msg.Messages { - emitMessage(g, inner) - } - - fs := sortFields(msg.Fields) - - // StableSize implementation. - g.P("// StableSize returns the size of x in protobuf format.") - g.P("//") - g.P("// Structures with the same field values have the same binary size.") - g.P("func (x *", msg.GoIdent.GoName, ") StableSize() (size int) {") - g.P("if x == nil { return 0 }") - if len(fs) != 0 { - for _, f := range fs { - if f.Desc.IsList() && marshalers[f.Desc.Kind()].RepeatedDouble && !(f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()) { - g.P("var n int") - break - } - } - for _, f := range fs { - emitFieldSize(g, f) - } - } - g.P("return size") - g.P("}\n") - - // StableMarshal implementation. - g.P("// StableMarshal marshals x in protobuf binary format with stable field order.") - g.P("//") - g.P("// If buffer length is less than x.StableSize(), new buffer is allocated.") - g.P("//") - g.P("// Returns any error encountered which did not allow writing the data completely.") - g.P("// Otherwise, returns the buffer in which the data is written.") - g.P("//") - g.P("// Structures with the same field values have the same binary format.") - g.P("func (x *", msg.GoIdent.GoName, ") StableMarshal(buf []byte) []byte {") - if len(fs) != 0 { - g.P("if x == nil { return []byte{} }") - g.P("if buf == nil { buf = make([]byte, x.StableSize()) }") - g.P("var offset int") - for _, f := range fs { - emitFieldMarshal(g, f) - } - } - g.P("return buf") - g.P("}\n") - - if strings.HasSuffix(msg.GoIdent.GoName, "Request") || strings.HasSuffix(msg.GoIdent.GoName, "Response") { - // SignedDataSize implementation (only for requests and responses). - g.P("// ReadSignedData fills buf with signed data of x.") - g.P("// If buffer length is less than x.SignedDataSize(), new buffer is allocated.") - g.P("//") - g.P("// Returns any error encountered which did not allow writing the data completely.") - g.P("// Otherwise, returns the buffer in which the data is written.") - g.P("//") - g.P("// Structures with the same field values have the same signed data.") - g.P("func (x *", msg.GoIdent.GoName, ") SignedDataSize() int {") - g.P("return x.GetBody().StableSize()") - g.P("}\n") - - // ReadSignedData implementation (only for requests and responses). - g.P("// SignedDataSize returns size of the request signed data in bytes.") - g.P("//") - g.P("// Structures with the same field values have the same signed data size.") - g.P("func (x *", msg.GoIdent.GoName, ") ReadSignedData(buf []byte) ([]byte, error) {") - g.P("return x.GetBody().StableMarshal(buf), nil") - g.P("}\n") - - // Signature setters and getters. - g.P("func (x *", msg.GoIdent.GoName, ") SetSignature(sig *Signature) {") - g.P("x.Signature = sig") - g.P("}\n") - } -} - -func emitFieldSize(g *protogen.GeneratedFile, f *protogen.Field) { - m := marshalers[f.Desc.Kind()] - if m.Prefix == "" { - g.P("// FIXME missing field marshaler: ", f.GoName, " of type ", f.Desc.Kind().String()) - g.P(`panic("unimplemented")`) - return - } - - name := castFieldName(f) - if f.Oneof != nil { - name = "x." + f.Oneof.GoName - g.P("if inner, ok := ", name, ".(*", f.GoIdent.GoName, "); ok {") - defer g.P("}") - name = "inner." + f.GoName - } - - switch { - case f.Desc.IsList() && (f.Desc.Kind() == protoreflect.MessageKind || f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()): - g.P("for i := range ", name, "{") - if f.Desc.Kind() == protoreflect.MessageKind { - g.P("size += proto.NestedStructureSize(", f.Desc.Number(), ", ", name, "[i])") - } else { - if f.Desc.Kind() != protoreflect.Uint64Kind { - panic("only uint64 unpacked primitive is supported") - } - - g.P("size += ", protowirePackage.Ident("SizeGroup"), "(", - protowirePackage.Ident("Number"), "(", f.Desc.Number(), "), ", - protowirePackage.Ident("SizeVarint"), "(", name, "[i]))") - } - g.P("}") - case f.Desc.IsList(): - if m.RepeatedDouble { - g.P("n, _ = proto.Repeated", m.Prefix, "Size(", f.Desc.Number(), ", ", name, ")") - g.P("size += n") - } else { - g.P("size += proto.Repeated", m.Prefix, "Size(", f.Desc.Number(), ", ", name, ")") - } - default: - g.P("size += proto.", m.Prefix, "Size(", f.Desc.Number(), ", ", name, ")") - } -} - -func emitFieldMarshal(g *protogen.GeneratedFile, f *protogen.Field) { - m := marshalers[f.Desc.Kind()] - if m.Prefix == "" { - g.P("// FIXME missing field marshaler: ", f.GoName, " of type ", f.Desc.Kind().String()) - g.P(`panic("unimplemented")`) - return - } - - name := castFieldName(f) - if f.Oneof != nil { - name = "x." + f.Oneof.GoName - g.P("if inner, ok := ", name, ".(*", f.GoIdent.GoName, "); ok {") - defer g.P("}") - name = "inner." + f.GoName - } - - prefix := m.Prefix - if f.Desc.IsList() { - prefix = "Repeated" + m.Prefix - } - switch { - case f.Desc.IsList() && (f.Desc.Kind() == protoreflect.MessageKind || f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()): - g.P("for i := range ", name, "{") - if f.Desc.Kind() == protoreflect.MessageKind { - g.P("offset += proto.NestedStructureMarshal(", f.Desc.Number(), ", buf[offset:], ", name, "[i])") - } else { - if f.Desc.Kind() != protoreflect.Uint64Kind { - panic("only uint64 unpacked primitive is supported") - } - g.P("{") - g.P("prefix := ", protowirePackage.Ident("EncodeTag"), "(", - protowirePackage.Ident("Number"), "(", f.Desc.Number(), "), ", - protowirePackage.Ident("VarintType"), ")") - g.P("offset += ", binaryPackage.Ident("PutUvarint"), "(buf[offset:], uint64(prefix))") - g.P("offset += ", binaryPackage.Ident("PutUvarint"), "(buf[offset:], ", name, "[i])") - g.P("}") - } - g.P("}") - case f.Desc.IsList(): - g.P("offset += proto.Repeated", m.Prefix, "Marshal(", f.Desc.Number(), ", buf[offset:], ", name, ")") - default: - g.P("offset += proto.", prefix, "Marshal(", f.Desc.Number(), ", buf[offset:], ", name, ")") - } -} - -func castFieldName(f *protogen.Field) string { - name := "x." + f.GoName - if f.Desc.Kind() != protoreflect.EnumKind { - return name - } - return "int32(" + name + ")" -} - -type marshalerDesc struct { - Prefix string - RepeatedDouble bool -} - -// Unused kinds are commented. -var marshalers = map[protoreflect.Kind]marshalerDesc{ - protoreflect.BoolKind: {Prefix: "Bool"}, - protoreflect.EnumKind: {Prefix: "Enum"}, - - protoreflect.Int32Kind: {Prefix: "Int32", RepeatedDouble: true}, - // protoreflect.Sint32Kind: "", - protoreflect.Uint32Kind: {Prefix: "UInt32", RepeatedDouble: true}, - protoreflect.Int64Kind: {Prefix: "Int64", RepeatedDouble: true}, - // protoreflect.Sint64Kind: "", - protoreflect.Uint64Kind: {Prefix: "UInt64", RepeatedDouble: true}, - // protoreflect.Sfixed32Kind: "", - protoreflect.Fixed32Kind: {Prefix: "Fixed32", RepeatedDouble: true}, - // protoreflect.FloatKind: "", - // protoreflect.Sfixed64Kind: "", - protoreflect.Fixed64Kind: {Prefix: "Fixed64", RepeatedDouble: true}, - protoreflect.DoubleKind: {Prefix: "Float64"}, - protoreflect.StringKind: {Prefix: "String"}, - protoreflect.BytesKind: {Prefix: "Bytes"}, - protoreflect.MessageKind: {Prefix: "NestedStructure"}, - // protoreflect.GroupKind: "", -} - -func sortFields(fs []*protogen.Field) []*protogen.Field { - res := make([]*protogen.Field, len(fs)) - copy(res, fs) - sort.Slice(res, func(i, j int) bool { - return res[i].Desc.Number() < res[j].Desc.Number() - }) - return res -} diff --git a/util/signature/data.go b/util/signature/data.go index 5e7c310..62c3eaf 100644 --- a/util/signature/data.go +++ b/util/signature/data.go @@ -63,12 +63,6 @@ func SignDataWithHandler(key *ecdsa.PrivateKey, src DataSource, handler KeySigna } func VerifyDataWithSource(dataSrc DataSource, sigSrc KeySignatureSource, opts ...SignOption) error { - cfg := defaultCfg() - - for i := range opts { - opts[i](cfg) - } - buffer := buffersPool.Get(uint32(dataSrc.SignedDataSize())) defer buffersPool.Put(buffer) @@ -77,7 +71,7 @@ func VerifyDataWithSource(dataSrc DataSource, sigSrc KeySignatureSource, opts .. return err } - return verify(cfg, data, sigSrc()) + return VerifyDataSlice(data, sigSrc, opts...) } func SignData(key *ecdsa.PrivateKey, v DataWithSignature, opts ...SignOption) error { @@ -87,3 +81,13 @@ func SignData(key *ecdsa.PrivateKey, v DataWithSignature, opts ...SignOption) er func VerifyData(src DataWithSignature, opts ...SignOption) error { return VerifyDataWithSource(src, src.GetSignature, opts...) } + +func VerifyDataSlice(data []byte, sigSrc KeySignatureSource, opts ...SignOption) error { + cfg := defaultCfg() + + for i := range opts { + opts[i](cfg) + } + + return verify(cfg, data, sigSrc()) +} From 7be31eb84738fc9094a8de07035b8cab44c92579 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 16 Aug 2024 11:08:47 +0300 Subject: [PATCH 130/169] [#77] protogen: Add tests for JSON format Signed-off-by: Evgenii Stratonikov --- util/proto/marshal_test.go | 101 +++++++++++++++++++++++++------------ 1 file changed, 68 insertions(+), 33 deletions(-) diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index e565b7c..d5758f2 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -8,6 +8,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test" generated "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test/custom" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/encoding/protojson" goproto "google.golang.org/protobuf/proto" ) @@ -51,33 +52,64 @@ func TestStableMarshalSingle(t *testing.T) { } for _, tc := range marshalCases { t.Run(tc.name, func(t *testing.T) { - r := tc.input.MarshalProtobuf(nil) - require.Equal(t, len(r), tc.input.StableSize()) - require.NotEmpty(t, r) + t.Run("proto", func(t *testing.T) { + r := tc.input.MarshalProtobuf(nil) + require.Equal(t, len(r), tc.input.StableSize()) + require.NotEmpty(t, r) - var actual test.Primitives - require.NoError(t, goproto.Unmarshal(r, &actual)) + var actual test.Primitives + require.NoError(t, goproto.Unmarshal(r, &actual)) - var actualFrostfs generated.Primitives - require.NoError(t, actualFrostfs.UnmarshalProtobuf(r)) - require.Equal(t, tc.input, &actualFrostfs) + var actualFrostfs generated.Primitives + require.NoError(t, actualFrostfs.UnmarshalProtobuf(r)) + require.Equal(t, tc.input, &actualFrostfs) - // Compare each field directly, because proto-generated code has private fields. - require.Equal(t, tc.input.FieldA, actual.FieldA) - require.Equal(t, tc.input.FieldB, actual.FieldB) - require.Equal(t, tc.input.FieldC, actual.FieldC) - require.Equal(t, tc.input.FieldD, actual.FieldD) - require.Equal(t, tc.input.FieldE, actual.FieldE) - require.Equal(t, tc.input.FieldF, actual.FieldF) - require.Equal(t, tc.input.FieldG, actual.FieldG) - require.Equal(t, tc.input.FieldI, actual.FieldI) - require.Equal(t, tc.input.FieldJ, actual.FieldJ) - require.Equal(t, tc.input.FieldK, actual.FieldK) - require.EqualValues(t, tc.input.FieldH, actual.FieldH) + primitivesEqual(t, tc.input, &actual) + }) + t.Run("json", func(t *testing.T) { + r, err := tc.input.MarshalJSON() + require.NoError(t, err) + require.NotEmpty(t, r) + + var actual test.Primitives + require.NoError(t, protojson.Unmarshal(r, &actual)) + + var actualFrostfs generated.Primitives + require.NoError(t, actualFrostfs.UnmarshalJSON(r)) + require.Equal(t, tc.input, &actualFrostfs) + + primitivesEqual(t, tc.input, &actual) + }) }) } } +func primitivesEqual(t *testing.T, a *generated.Primitives, b *test.Primitives) { + // Compare each field directly, because proto-generated code has private fields. + require.Equal(t, a.FieldA, b.FieldA) + require.Equal(t, a.FieldB, b.FieldB) + require.Equal(t, a.FieldC, b.FieldC) + require.Equal(t, a.FieldD, b.FieldD) + require.Equal(t, a.FieldE, b.FieldE) + require.Equal(t, a.FieldF, b.FieldF) + require.Equal(t, a.FieldG, b.FieldG) + require.Equal(t, a.FieldI, b.FieldI) + require.Equal(t, a.FieldJ, b.FieldJ) + require.Equal(t, a.FieldK, b.FieldK) + require.EqualValues(t, a.FieldH, b.FieldH) +} + +func repPrimitivesEqual(t *testing.T, a *generated.RepPrimitives, b *test.RepPrimitives) { + // Compare each field directly, because proto-generated code has private fields. + require.Equal(t, a.FieldA, b.FieldA) + require.Equal(t, a.FieldB, b.FieldB) + require.Equal(t, a.FieldC, b.FieldC) + require.Equal(t, a.FieldD, b.FieldD) + require.Equal(t, a.FieldE, b.FieldE) + require.Equal(t, a.FieldF, b.FieldF) + require.Equal(t, a.FieldFu, b.FieldFu) +} + func randIntSlice[T protoInt](n int, includeZero bool) []T { r := make([]T, n) if n == 0 { @@ -142,21 +174,24 @@ func TestStableMarshalRep(t *testing.T) { } for _, tc := range marshalCases { t.Run(tc.name, func(t *testing.T) { - r := tc.input.MarshalProtobuf(nil) - require.Equal(t, len(r), tc.input.StableSize()) - require.NotEmpty(t, r) + t.Run("proto", func(t *testing.T) { + r := tc.input.MarshalProtobuf(nil) + require.Equal(t, len(r), tc.input.StableSize()) + require.NotEmpty(t, r) - var actual test.RepPrimitives - require.NoError(t, goproto.Unmarshal(r, &actual)) + var actual test.RepPrimitives + require.NoError(t, goproto.Unmarshal(r, &actual)) + repPrimitivesEqual(t, tc.input, &actual) + }) + t.Run("json", func(t *testing.T) { + r, err := tc.input.MarshalJSON() + require.NoError(t, err) + require.NotEmpty(t, r) - // Compare each field directly, because proto-generated code has private fields. - require.Equal(t, tc.input.FieldA, actual.FieldA) - require.Equal(t, tc.input.FieldB, actual.FieldB) - require.Equal(t, tc.input.FieldC, actual.FieldC) - require.Equal(t, tc.input.FieldD, actual.FieldD) - require.Equal(t, tc.input.FieldE, actual.FieldE) - require.Equal(t, tc.input.FieldF, actual.FieldF) - require.Equal(t, tc.input.FieldFu, actual.FieldFu) + var actual test.RepPrimitives + require.NoError(t, protojson.Unmarshal(r, &actual)) + repPrimitivesEqual(t, tc.input, &actual) + }) }) } } From a43110e36326a60466080b458ca82172dbfc81ef Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 16 Aug 2024 17:11:08 +0300 Subject: [PATCH 131/169] [#77] Makefile: Mark protogen as .PHONY Signed-off-by: Evgenii Stratonikov --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7ed6954..271036a 100755 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ PROTOBUF_DIR ?= $(abspath $(BIN))/protobuf PROTOC_DIR ?= $(PROTOBUF_DIR)/protoc-v$(PROTOC_VERSION) PROTOC_GEN_GO_DIR ?= $(PROTOBUF_DIR)/protoc-gen-go-$(PROTOC_GEN_GO_VERSION) -.PHONY: dep fmts fumpt imports protoc test lint version help +.PHONY: dep fmts fumpt imports protoc test lint version help $(BIN)/protogen protoc-test # Pull go dependencies dep: @@ -72,12 +72,12 @@ protoc: --go-grpc_out=. --go-grpc_opt=paths=source_relative $$f; \ done -protogen: +$(BIN)/protogen: @go build -v -trimpath \ -o $(BIN)/protogen \ ./util/protogen -protoc-test: protoc protogen +protoc-test: protoc $(BIN)/protogen @$(PROTOC_DIR)/bin/protoc \ --plugin=protoc-gen-go-frostfs=$(abspath $(BIN)/protogen) \ --go-frostfs_opt=Mutil/proto/test/test.proto=git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test/custom \ From 33653962b72a841a024f81dcec95adfd01027e0e Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 21 Aug 2024 17:22:56 +0300 Subject: [PATCH 132/169] [#1316] go.mod: Bump go version to 1.22 Signed-off-by: Ekaterina Lebedeva --- .forgejo/workflows/dco.yml | 2 +- .forgejo/workflows/tests.yml | 6 +++--- go.mod | 2 +- go.sum | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/dco.yml b/.forgejo/workflows/dco.yml index 9aa0d31..2374802 100644 --- a/.forgejo/workflows/dco.yml +++ b/.forgejo/workflows/dco.yml @@ -13,7 +13,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 with: - go-version: '1.21' + go-version: '1.23' - name: Run commit format checker uses: https://git.frostfs.info/TrueCloudLab/dco-go@v3 diff --git a/.forgejo/workflows/tests.yml b/.forgejo/workflows/tests.yml index 2d44d34..7950b1c 100644 --- a/.forgejo/workflows/tests.yml +++ b/.forgejo/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '1.20' + go-version: '1.23' cache: true - name: golangci-lint @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go_versions: [ '1.19', '1.20' ] + go_versions: [ '1.22', '1.23' ] fail-fast: false steps: - uses: actions/checkout@v3 @@ -47,7 +47,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '1.20' + go-version: '1.23' cache: true - name: Run tests diff --git a/go.mod b/go.mod index 13fa1b7..a241dd5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 -go 1.20 +go 1.22 require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 diff --git a/go.sum b/go.sum index 620642f..83963fe 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,7 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= From c1b5f46f98a8a6ac7fc04f64633f66d39a8aaf33 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 26 Aug 2024 09:51:28 +0300 Subject: [PATCH 133/169] [#107] protogen: Remove unused parameter Signed-off-by: Evgenii Stratonikov --- util/protogen/main.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/util/protogen/main.go b/util/protogen/main.go index bfce1bf..8fdd666 100644 --- a/util/protogen/main.go +++ b/util/protogen/main.go @@ -2,8 +2,6 @@ package main import ( "flag" - "fmt" - "os" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/protogen/internalgengo" "google.golang.org/protobuf/compiler/protogen" @@ -12,18 +10,10 @@ import ( func main() { var flags flag.FlagSet genFuzz := flags.Bool("fuzz", false, "generate fuzz tests") - yamlConfigPath := flags.String("config", "", "path to the configuration") protogen.Options{ ParamFunc: flags.Set, }.Run(func(gen *protogen.Plugin) error { - if *yamlConfigPath != "" { - s, e := os.Getwd() - fmt.Fprintln(os.Stderr, s, e) - data, err := os.ReadFile(*yamlConfigPath) - fmt.Fprintln(os.Stderr, string(data), err) - } - for _, f := range gen.Files { if f.Generate { internalgengo.GenerateFile(gen, f) From 61f6f0f4a207c7e58b6573329a21d81cdee1091f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 26 Aug 2024 14:14:38 +0300 Subject: [PATCH 134/169] [#107] proto/test: Regenerate *.pb.go Signed-off-by: Evgenii Stratonikov --- util/proto/test/custom/test_frostfs.pb.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index 28a3044..c99234e 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -18,9 +18,9 @@ import ( type Primitives_SomeEnum int32 const ( - Primitives_UNKNOWN = 0 - Primitives_POSITIVE = 1 - Primitives_NEGATIVE = -1 + Primitives_UNKNOWN Primitives_SomeEnum = 0 + Primitives_POSITIVE Primitives_SomeEnum = 1 + Primitives_NEGATIVE Primitives_SomeEnum = -1 ) var ( From f484ce6b0bfb74d77b1af162c462e4acc6ddcf5b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 26 Aug 2024 14:15:00 +0300 Subject: [PATCH 135/169] [#107] Makefile: Generate standard protobuf bindings for tests It was removed accidentally during transition. Signed-off-by: Evgenii Stratonikov --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 271036a..abcabc7 100755 --- a/Makefile +++ b/Makefile @@ -79,6 +79,7 @@ $(BIN)/protogen: protoc-test: protoc $(BIN)/protogen @$(PROTOC_DIR)/bin/protoc \ + --go_out=. --go_opt=paths=source_relative \ --plugin=protoc-gen-go-frostfs=$(abspath $(BIN)/protogen) \ --go-frostfs_opt=Mutil/proto/test/test.proto=git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/test/custom \ --go-frostfs_opt=module=git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 \ From 4a00ef946fdf8e82cc9dce7313c63db825adea4b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 26 Aug 2024 14:16:10 +0300 Subject: [PATCH 136/169] [#107] protogen: Fix oneof getter scalar default value Signed-off-by: Evgenii Stratonikov --- util/protogen/internalgengo/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/protogen/internalgengo/file.go b/util/protogen/internalgengo/file.go index b5b351c..cd54fa0 100644 --- a/util/protogen/internalgengo/file.go +++ b/util/protogen/internalgengo/file.go @@ -148,7 +148,7 @@ func emitOneofGettersSetters(g *protogen.GeneratedFile, msg *protogen.Message, f g.P("}") ft := fieldType(g, ff) - emitGetterSetter(g, ff.GoIdent.GoName, ff.GoName, ft.String(), "nil") + emitGetterSetter(g, ff.GoIdent.GoName, ff.GoName, ft.String(), fieldDefaultValue(ff)) } } From 937a53683a3c083f9ab5d970c205200d10c058bf Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 26 Aug 2024 14:19:28 +0300 Subject: [PATCH 137/169] [#107] protogen: Fix oneof JSON marshaling Signed-off-by: Evgenii Stratonikov --- util/protogen/internalgengo/json.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go index ad43fc8..4ae24e7 100644 --- a/util/protogen/internalgengo/json.go +++ b/util/protogen/internalgengo/json.go @@ -159,8 +159,6 @@ func emitJSONMarshal(g *protogen.GeneratedFile, msg *protogen.Message) { g.P("case *", ff.GoIdent, ":") emitJSONFieldWrite(g, ff, "xx", i == 0) } - g.P("default:") - g.P(`out.RawString("null")`) g.P("}") continue } From 866db105ed8d64e9218d94991a3707dfec39efa8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 26 Aug 2024 14:33:18 +0300 Subject: [PATCH 138/169] [#107] protogen: Unify oneof getters with default protoc plugin Signed-off-by: Evgenii Stratonikov --- util/protogen/internalgengo/file.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/util/protogen/internalgengo/file.go b/util/protogen/internalgengo/file.go index cd54fa0..ff1c830 100644 --- a/util/protogen/internalgengo/file.go +++ b/util/protogen/internalgengo/file.go @@ -126,23 +126,18 @@ func emitOneofGettersSetters(g *protogen.GeneratedFile, msg *protogen.Message, f // For some reason protoc generates different code for oneof message/non-message fields: // 1. For message we have 2 level struct wrapping and setters use inner type. // 2. For other types we also have 2 level wrapping, but setters use outer type. + ft := fieldType(g, ff) + + g.P("func (x *", msg.GoIdent.GoName, ") Get", ff.GoName, "() ", ft, " {") + g.P("if xx, ok := x.Get", ff.Oneof.GoName, "().(*", ff.GoIdent, "); ok { return xx.", ff.GoName, " }") + g.P("return ", fieldDefaultValue(ff)) + g.P("}") + if ff.Desc.Kind() == protoreflect.MessageKind { - ft := fieldType(g, ff) - - g.P("func (x *", msg.GoIdent.GoName, ") Get", ff.GoName, "() ", ft, " {") - g.P("if xx, ok := x.Get", ff.Oneof.GoName, "().(*", ff.GoIdent, "); ok { return xx.", ff.GoName, " }") - g.P("return nil") - g.P("}") - g.P("func (x *", msg.GoIdent.GoName, ") Set", ff.GoName, "(v ", ft, ") {") g.P("x.", ff.Oneof.GoName, " = &", ff.GoIdent, "{", ff.GoName, ": v}") g.P("}") } else { - g.P("func (x *", msg.GoIdent.GoName, ") Get", ff.GoName, "() *", ff.GoIdent, " {") - g.P("if xx, ok := x.Get", ff.Oneof.GoName, "().(*", ff.GoIdent, "); ok { return xx }") - g.P("return nil") - g.P("}") - g.P("func (x *", msg.GoIdent.GoName, ") Set", ff.GoName, "(v *", ff.GoIdent, ") {") g.P("x.", ff.Oneof.GoName, " = v") g.P("}") From 981dc785f34aaff6b26ee6a24f460f58bba02596 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 26 Aug 2024 14:33:30 +0300 Subject: [PATCH 139/169] [#107] proto/test: Add oneof test Signed-off-by: Evgenii Stratonikov --- util/proto/marshal_test.go | 5 + util/proto/test/custom/test_frostfs.pb.go | 297 ++++++++++++++++++++++ util/proto/test/test.pb.go | 186 ++++++++++++-- util/proto/test/test.proto | 8 + 4 files changed, 469 insertions(+), 27 deletions(-) diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index d5758f2..5d887ce 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -49,6 +49,8 @@ func TestStableMarshalSingle(t *testing.T) { {name: "fixed32", input: &generated.Primitives{FieldK: nonZero[uint32]()}}, {name: "enum, positive", input: &generated.Primitives{FieldH: generated.Primitives_POSITIVE}}, {name: "enum, negative", input: &generated.Primitives{FieldH: generated.Primitives_NEGATIVE}}, + {name: "oneof, first", input: &generated.Primitives{FieldM: &generated.Primitives_FieldMa{FieldMa: []byte{4, 2}}}}, + {name: "oneof, second", input: &generated.Primitives{FieldM: &generated.Primitives_FieldMe{FieldMe: nonZero[uint32]()}}}, } for _, tc := range marshalCases { t.Run(tc.name, func(t *testing.T) { @@ -97,6 +99,9 @@ func primitivesEqual(t *testing.T, a *generated.Primitives, b *test.Primitives) require.Equal(t, a.FieldJ, b.FieldJ) require.Equal(t, a.FieldK, b.FieldK) require.EqualValues(t, a.FieldH, b.FieldH) + require.Equal(t, a.GetFieldMa(), b.GetFieldMa()) + require.Equal(t, a.GetFieldMe(), b.GetFieldMe()) + require.Equal(t, a.GetFieldAux().GetInnerField(), b.GetFieldAux().GetInnerField()) } func repPrimitivesEqual(t *testing.T, a *generated.RepPrimitives, b *test.RepPrimitives) { diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index c99234e..b1d2cf2 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -50,6 +50,135 @@ func (x *Primitives_SomeEnum) FromString(s string) bool { return false } +type Primitives_Aux struct { + InnerField uint32 `json:"innerField"` +} + +var ( + _ encoding.ProtoMarshaler = (*Primitives_Aux)(nil) + _ encoding.ProtoUnmarshaler = (*Primitives_Aux)(nil) + _ json.Marshaler = (*Primitives_Aux)(nil) + _ json.Unmarshaler = (*Primitives_Aux)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *Primitives_Aux) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt32Size(1, x.InnerField) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *Primitives_Aux) 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 *Primitives_Aux) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.InnerField != 0 { + mm.AppendUint32(1, x.InnerField) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *Primitives_Aux) 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", "Primitives_Aux") + } + switch fc.FieldNum { + case 1: // InnerField + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "InnerField") + } + x.InnerField = data + } + } + return nil +} +func (x *Primitives_Aux) GetInnerField() uint32 { + if x != nil { + return x.InnerField + } + return 0 +} +func (x *Primitives_Aux) SetInnerField(v uint32) { + x.InnerField = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *Primitives_Aux) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *Primitives_Aux) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"innerField\":" + out.RawString(prefix[1:]) + out.Uint32(x.InnerField) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *Primitives_Aux) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *Primitives_Aux) 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 "innerField": + { + var f uint32 + f = in.Uint32() + x.InnerField = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + type Primitives struct { FieldA []byte `json:"fieldA"` FieldB string `json:"fieldB"` @@ -62,6 +191,7 @@ type Primitives struct { FieldJ float64 `json:"fieldJ"` FieldK uint32 `json:"fieldK"` FieldH Primitives_SomeEnum `json:"fieldH"` + FieldM isPrimitives_FieldM } var ( @@ -89,6 +219,15 @@ func (x *Primitives) StableSize() (size int) { size += proto.Float64Size(206, x.FieldJ) size += proto.Fixed32Size(207, x.FieldK) size += proto.EnumSize(300, int32(x.FieldH)) + if inner, ok := x.FieldM.(*Primitives_FieldMa); ok { + size += proto.BytesSize(401, inner.FieldMa) + } + if inner, ok := x.FieldM.(*Primitives_FieldMe); ok { + size += proto.UInt32Size(402, inner.FieldMe) + } + if inner, ok := x.FieldM.(*Primitives_FieldAux); ok { + size += proto.NestedStructureSize(403, inner.FieldAux) + } return size } @@ -138,6 +277,21 @@ func (x *Primitives) EmitProtobuf(mm *easyproto.MessageMarshaler) { if int32(x.FieldH) != 0 { mm.AppendInt32(300, int32(x.FieldH)) } + if inner, ok := x.FieldM.(*Primitives_FieldMa); ok { + if len(inner.FieldMa) != 0 { + mm.AppendBytes(401, inner.FieldMa) + } + } + if inner, ok := x.FieldM.(*Primitives_FieldMe); ok { + if inner.FieldMe != 0 { + mm.AppendUint32(402, inner.FieldMe) + } + } + if inner, ok := x.FieldM.(*Primitives_FieldAux); ok { + if inner.FieldAux != nil && inner.FieldAux.StableSize() != 0 { + inner.FieldAux.EmitProtobuf(mm.AppendMessage(403)) + } + } } // UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. @@ -215,6 +369,28 @@ func (x *Primitives) UnmarshalProtobuf(src []byte) (err error) { return fmt.Errorf("cannot unmarshal field %s", "FieldH") } x.FieldH = Primitives_SomeEnum(data) + case 401: // FieldMa + data, ok := fc.Bytes() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldMa") + } + x.FieldM = &Primitives_FieldMa{FieldMa: data} + case 402: // FieldMe + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldMe") + } + x.FieldM = &Primitives_FieldMe{FieldMe: data} + case 403: // FieldAux + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldAux") + } + oneofField := &Primitives_FieldAux{FieldAux: new(Primitives_Aux)} + if err := oneofField.FieldAux.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + x.FieldM = oneofField } } return nil @@ -318,6 +494,60 @@ func (x *Primitives) GetFieldH() Primitives_SomeEnum { func (x *Primitives) SetFieldH(v Primitives_SomeEnum) { x.FieldH = v } +func (x *Primitives) GetFieldM() isPrimitives_FieldM { + if x != nil { + return x.FieldM + } + return nil +} +func (x *Primitives) SetFieldM(v isPrimitives_FieldM) { + x.FieldM = v +} +func (x *Primitives) GetFieldMa() []byte { + if xx, ok := x.GetFieldM().(*Primitives_FieldMa); ok { + return xx.FieldMa + } + return nil +} +func (x *Primitives) SetFieldMa(v *Primitives_FieldMa) { + x.FieldM = v +} +func (x *Primitives_FieldMa) GetFieldMa() []byte { + if x != nil { + return x.FieldMa + } + return nil +} +func (x *Primitives_FieldMa) SetFieldMa(v []byte) { + x.FieldMa = v +} +func (x *Primitives) GetFieldMe() uint32 { + if xx, ok := x.GetFieldM().(*Primitives_FieldMe); ok { + return xx.FieldMe + } + return 0 +} +func (x *Primitives) SetFieldMe(v *Primitives_FieldMe) { + x.FieldM = v +} +func (x *Primitives_FieldMe) GetFieldMe() uint32 { + if x != nil { + return x.FieldMe + } + return 0 +} +func (x *Primitives_FieldMe) SetFieldMe(v uint32) { + x.FieldMe = v +} +func (x *Primitives) GetFieldAux() *Primitives_Aux { + if xx, ok := x.GetFieldM().(*Primitives_FieldAux); ok { + return xx.FieldAux + } + return nil +} +func (x *Primitives) SetFieldAux(v *Primitives_Aux) { + x.FieldM = &Primitives_FieldAux{FieldAux: v} +} // MarshalJSON implements the json.Marshaler interface. func (x *Primitives) MarshalJSON() ([]byte, error) { @@ -386,6 +616,26 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) { out.RawString(prefix) out.Int32(int32(x.FieldH)) } + switch xx := x.FieldM.(type) { + case *Primitives_FieldMa: + { + const prefix string = ",\"fieldMa\":" + out.RawString(prefix) + out.Base64Bytes(xx.FieldMa) + } + case *Primitives_FieldMe: + { + const prefix string = ",\"fieldMe\":" + out.RawString(prefix) + out.Uint32(xx.FieldMe) + } + case *Primitives_FieldAux: + { + const prefix string = ",\"fieldAux\":" + out.RawString(prefix) + xx.FieldAux.MarshalEasyJSON(out) + } + } out.RawByte('}') } @@ -496,6 +746,31 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) { f = parsedValue x.FieldH = f } + case "fieldMa": + xx := new(Primitives_FieldMa) + x.FieldM = xx + { + var f []byte + f = in.Bytes() + xx.FieldMa = f + } + case "fieldMe": + xx := new(Primitives_FieldMe) + x.FieldM = xx + { + var f uint32 + f = in.Uint32() + xx.FieldMe = f + } + case "fieldAux": + xx := new(Primitives_FieldAux) + x.FieldM = xx + { + var f *Primitives_Aux + f = new(Primitives_Aux) + f.UnmarshalEasyJSON(in) + xx.FieldAux = f + } } in.WantComma() } @@ -505,6 +780,28 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) { } } +type isPrimitives_FieldM interface { + isPrimitives_FieldM() +} + +type Primitives_FieldMa struct { + FieldMa []byte +} + +type Primitives_FieldMe struct { + FieldMe uint32 +} + +type Primitives_FieldAux struct { + FieldAux *Primitives_Aux +} + +func (*Primitives_FieldMa) isPrimitives_FieldM() {} + +func (*Primitives_FieldMe) isPrimitives_FieldM() {} + +func (*Primitives_FieldAux) isPrimitives_FieldM() {} + type RepPrimitives struct { FieldA [][]byte `json:"fieldA"` FieldB []string `json:"fieldB"` diff --git a/util/proto/test/test.pb.go b/util/proto/test/test.pb.go index 57f7fb0..de8ec65 100644 --- a/util/proto/test/test.pb.go +++ b/util/proto/test/test.pb.go @@ -85,6 +85,12 @@ type Primitives struct { FieldJ float64 `protobuf:"fixed64,206,opt,name=field_j,json=fieldJ,proto3" json:"field_j,omitempty"` FieldK uint32 `protobuf:"fixed32,207,opt,name=field_k,json=fieldK,proto3" json:"field_k,omitempty"` FieldH Primitives_SomeEnum `protobuf:"varint,300,opt,name=field_h,json=fieldH,proto3,enum=test.Primitives_SomeEnum" json:"field_h,omitempty"` + // Types that are assignable to FieldM: + // + // *Primitives_FieldMa + // *Primitives_FieldMe + // *Primitives_FieldAux + FieldM isPrimitives_FieldM `protobuf_oneof:"field_m"` } func (x *Primitives) Reset() { @@ -196,6 +202,56 @@ func (x *Primitives) GetFieldH() Primitives_SomeEnum { return Primitives_UNKNOWN } +func (m *Primitives) GetFieldM() isPrimitives_FieldM { + if m != nil { + return m.FieldM + } + return nil +} + +func (x *Primitives) GetFieldMa() []byte { + if x, ok := x.GetFieldM().(*Primitives_FieldMa); ok { + return x.FieldMa + } + return nil +} + +func (x *Primitives) GetFieldMe() uint32 { + if x, ok := x.GetFieldM().(*Primitives_FieldMe); ok { + return x.FieldMe + } + return 0 +} + +func (x *Primitives) GetFieldAux() *Primitives_Aux { + if x, ok := x.GetFieldM().(*Primitives_FieldAux); ok { + return x.FieldAux + } + return nil +} + +type isPrimitives_FieldM interface { + isPrimitives_FieldM() +} + +type Primitives_FieldMa struct { + FieldMa []byte `protobuf:"bytes,401,opt,name=field_ma,json=fieldMa,proto3,oneof"` +} + +type Primitives_FieldMe struct { + FieldMe uint32 `protobuf:"varint,402,opt,name=field_me,json=fieldMe,proto3,oneof"` +} + +type Primitives_FieldAux struct { + FieldAux *Primitives_Aux `protobuf:"bytes,403,opt,name=field_aux,json=fieldAux,proto3,oneof"` +} + +func (*Primitives_FieldMa) isPrimitives_FieldM() {} + +func (*Primitives_FieldMe) isPrimitives_FieldM() {} + +func (*Primitives_FieldAux) isPrimitives_FieldM() {} + type RepPrimitives struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -291,12 +347,59 @@ func (x *RepPrimitives) GetFieldFu() []uint64 { return nil } +type Primitives_Aux struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InnerField uint32 `protobuf:"varint,1,opt,name=inner_field,json=innerField,proto3" json:"inner_field,omitempty"` +} + +func (x *Primitives_Aux) Reset() { + *x = Primitives_Aux{} + if protoimpl.UnsafeEnabled { + mi := &file_util_proto_test_test_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Primitives_Aux) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Primitives_Aux) ProtoMessage() {} + +func (x *Primitives_Aux) ProtoReflect() protoreflect.Message { + mi := &file_util_proto_test_test_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Primitives_Aux.ProtoReflect.Descriptor instead. +func (*Primitives_Aux) Descriptor() ([]byte, []int) { + return file_util_proto_test_test_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Primitives_Aux) GetInnerField() uint32 { + if x != nil { + return x.InnerField + } + return 0 +} + var File_util_proto_test_test_proto protoreflect.FileDescriptor var file_util_proto_test_test_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x74, 0x65, - 0x73, 0x74, 0x22, 0x81, 0x03, 0x0a, 0x0a, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x73, 0x74, 0x22, 0xa6, 0x04, 0x0a, 0x0a, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, @@ -316,25 +419,35 @@ var file_util_proto_test_test_proto_rawDesc = []byte{ 0x6c, 0x64, 0x4b, 0x12, 0x33, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x68, 0x18, 0xac, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6f, 0x6d, 0x65, 0x45, 0x6e, 0x75, 0x6d, - 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x48, 0x22, 0x3c, 0x0a, 0x08, 0x53, 0x6f, 0x6d, 0x65, - 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, - 0x15, 0x0a, 0x08, 0x4e, 0x45, 0x47, 0x41, 0x54, 0x49, 0x56, 0x45, 0x10, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x22, 0xc4, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x50, 0x72, - 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x41, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x43, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x64, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x12, 0x17, 0x0a, 0x07, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x45, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x12, 0x1d, - 0x0a, 0x08, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, 0x75, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, - 0x42, 0x02, 0x10, 0x00, 0x52, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x75, 0x42, 0x11, 0x5a, - 0x0f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x48, 0x12, 0x1c, 0x0a, 0x08, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x6d, 0x61, 0x18, 0x91, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x07, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x12, 0x1c, 0x0a, 0x08, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, + 0x6d, 0x65, 0x18, 0x92, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x07, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x4d, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x61, 0x75, + 0x78, 0x18, 0x93, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x41, 0x75, 0x78, 0x48, 0x00, + 0x52, 0x08, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x75, 0x78, 0x1a, 0x26, 0x0a, 0x03, 0x41, 0x75, + 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x22, 0x3c, 0x0a, 0x08, 0x53, 0x6f, 0x6d, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0b, + 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, + 0x4f, 0x53, 0x49, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x08, 0x4e, 0x45, 0x47, + 0x41, 0x54, 0x49, 0x56, 0x45, 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, + 0x42, 0x09, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x22, 0xc4, 0x01, 0x0a, 0x0d, + 0x52, 0x65, 0x70, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x12, 0x17, 0x0a, + 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, + 0x62, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x12, + 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x44, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x5f, 0x66, 0x18, 0x06, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x46, 0x12, 0x1d, 0x0a, 0x08, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, 0x75, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x02, 0x10, 0x00, 0x52, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x46, 0x75, 0x42, 0x11, 0x5a, 0x0f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -350,19 +463,21 @@ func file_util_proto_test_test_proto_rawDescGZIP() []byte { } var file_util_proto_test_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_util_proto_test_test_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_util_proto_test_test_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_util_proto_test_test_proto_goTypes = []interface{}{ (Primitives_SomeEnum)(0), // 0: test.Primitives.SomeEnum (*Primitives)(nil), // 1: test.Primitives (*RepPrimitives)(nil), // 2: test.RepPrimitives + (*Primitives_Aux)(nil), // 3: test.Primitives.Aux } var file_util_proto_test_test_proto_depIdxs = []int32{ 0, // 0: test.Primitives.field_h:type_name -> test.Primitives.SomeEnum - 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 + 3, // 1: test.Primitives.field_aux:type_name -> test.Primitives.Aux + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_util_proto_test_test_proto_init() } @@ -395,6 +510,23 @@ func file_util_proto_test_test_proto_init() { return nil } } + file_util_proto_test_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Primitives_Aux); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_util_proto_test_test_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Primitives_FieldMa)(nil), + (*Primitives_FieldMe)(nil), + (*Primitives_FieldAux)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -402,7 +534,7 @@ func file_util_proto_test_test_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_util_proto_test_test_proto_rawDesc, NumEnums: 1, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/util/proto/test/test.proto b/util/proto/test/test.proto index 14f6ac2..f33be49 100644 --- a/util/proto/test/test.proto +++ b/util/proto/test/test.proto @@ -22,6 +22,14 @@ message Primitives { NEGATIVE = -1; } SomeEnum field_h = 300; + + message Aux { uint32 inner_field = 1; } + + oneof field_m { + bytes field_ma = 401; + uint32 field_me = 402; + Aux field_aux = 403; + } } message RepPrimitives { From 9e82a5a31a888f44219dac09cc4a6d07ad1a215b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 26 Aug 2024 14:36:02 +0300 Subject: [PATCH 140/169] [#107] Regenerate proto files Signed-off-by: Evgenii Stratonikov --- ape/grpc/types_frostfs.pb.go | 6 ++---- object/grpc/service_frostfs.pb.go | 20 ++++++-------------- session/grpc/types_frostfs.pb.go | 2 -- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/ape/grpc/types_frostfs.pb.go b/ape/grpc/types_frostfs.pb.go index 1e92f22..216415b 100644 --- a/ape/grpc/types_frostfs.pb.go +++ b/ape/grpc/types_frostfs.pb.go @@ -303,9 +303,9 @@ func (x *Chain) GetKind() isChain_Kind { func (x *Chain) SetKind(v isChain_Kind) { x.Kind = v } -func (x *Chain) GetRaw() *Chain_Raw { +func (x *Chain) GetRaw() []byte { if xx, ok := x.GetKind().(*Chain_Raw); ok { - return xx + return xx.Raw } return nil } @@ -341,8 +341,6 @@ func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) { out.RawString(prefix[1:]) out.Base64Bytes(xx.Raw) } - default: - out.RawString("null") } out.RawByte('}') } diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go index 08b2860..ce8336a 100644 --- a/object/grpc/service_frostfs.pb.go +++ b/object/grpc/service_frostfs.pb.go @@ -739,9 +739,9 @@ func (x *GetResponse_Body) GetInit() *GetResponse_Body_Init { func (x *GetResponse_Body) SetInit(v *GetResponse_Body_Init) { x.ObjectPart = &GetResponse_Body_Init_{Init: v} } -func (x *GetResponse_Body) GetChunk() *GetResponse_Body_Chunk { +func (x *GetResponse_Body) GetChunk() []byte { if xx, ok := x.GetObjectPart().(*GetResponse_Body_Chunk); ok { - return xx + return xx.Chunk } return nil } @@ -813,8 +813,6 @@ func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString(prefix[1:]) xx.EcInfo.MarshalEasyJSON(out) } - default: - out.RawString("null") } out.RawByte('}') } @@ -1486,9 +1484,9 @@ func (x *PutRequest_Body) GetInit() *PutRequest_Body_Init { func (x *PutRequest_Body) SetInit(v *PutRequest_Body_Init) { x.ObjectPart = &PutRequest_Body_Init_{Init: v} } -func (x *PutRequest_Body) GetChunk() *PutRequest_Body_Chunk { +func (x *PutRequest_Body) GetChunk() []byte { if xx, ok := x.GetObjectPart().(*PutRequest_Body_Chunk); ok { - return xx + return xx.Chunk } return nil } @@ -1530,8 +1528,6 @@ func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString(prefix[1:]) out.Base64Bytes(xx.Chunk) } - default: - out.RawString("null") } out.RawByte('}') } @@ -3674,8 +3670,6 @@ func (x *HeadResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString(prefix[1:]) xx.EcInfo.MarshalEasyJSON(out) } - default: - out.RawString("null") } out.RawByte('}') } @@ -5706,9 +5700,9 @@ func (x *GetRangeResponse_Body) GetRangePart() isGetRangeResponse_Body_RangePart func (x *GetRangeResponse_Body) SetRangePart(v isGetRangeResponse_Body_RangePart) { x.RangePart = v } -func (x *GetRangeResponse_Body) GetChunk() *GetRangeResponse_Body_Chunk { +func (x *GetRangeResponse_Body) GetChunk() []byte { if xx, ok := x.GetRangePart().(*GetRangeResponse_Body_Chunk); ok { - return xx + return xx.Chunk } return nil } @@ -5774,8 +5768,6 @@ func (x *GetRangeResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString(prefix[1:]) xx.EcInfo.MarshalEasyJSON(out) } - default: - out.RawString("null") } out.RawByte('}') } diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go index 6a0d75c..af95210 100644 --- a/session/grpc/types_frostfs.pb.go +++ b/session/grpc/types_frostfs.pb.go @@ -1121,8 +1121,6 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString(prefix) xx.Container.MarshalEasyJSON(out) } - default: - out.RawString("null") } out.RawByte('}') } From 11e194d274c45c0643518fea052d9467845e5ce6 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 27 Aug 2024 10:50:15 +0300 Subject: [PATCH 141/169] [#108] rpc/message: Add compatibility tests for marshaling Signed-off-by: Evgenii Stratonikov --- rpc/message/test/message.go | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/rpc/message/test/message.go b/rpc/message/test/message.go index 435f20a..1f7097e 100644 --- a/rpc/message/test/message.go +++ b/rpc/message/test/message.go @@ -7,6 +7,7 @@ import ( "testing" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding" "github.com/stretchr/testify/require" ) @@ -68,6 +69,64 @@ func TestRPCMessage(t *testing.T, msgGens ...func(empty bool) message.Message) { require.Equal(t, bm, bm2) }) } + t.Run("compatibility", func(t *testing.T) { + testCompatibility(t, msgGen) + }) }) } } + +func testCompatibility(t *testing.T, msgGen func(empty bool) message.Message) { + compareBinary := func(t *testing.T, msg message.Message) { + am, ok := msg.(binaryMessage) + if !ok { + t.Skip() + } + + a := am.StableMarshal(nil) + b := msg.ToGRPCMessage().(encoding.ProtoMarshaler).MarshalProtobuf(nil) + if len(a) == 0 { + require.Empty(t, b) + } else { + require.Equal(t, a, b) + } + } + compareJSON := func(t *testing.T, msg message.Message) { + am, ok := msg.(jsonMessage) + if !ok { + t.Skip() + } + + a, err := am.MarshalJSON() + require.NoError(t, err) + + b, err := json.Marshal(msg.ToGRPCMessage()) + require.NoError(t, err) + + require.JSONEq(t, string(a), string(b)) + if len(a) == 0 { + require.Empty(t, b) + } else { + require.Equal(t, a, b) + } + } + t.Run("empty", func(t *testing.T) { + t.Skip() + msg := msgGen(true) + t.Run(fmt.Sprintf("Binary_%T", msg), func(t *testing.T) { + compareBinary(t, msg) + }) + t.Run(fmt.Sprintf("JSON_%T", msg), func(t *testing.T) { + compareJSON(t, msg) + }) + }) + t.Run("not empty", func(t *testing.T) { + msg := msgGen(false) + t.Run(fmt.Sprintf("Binary_%T", msg), func(t *testing.T) { + compareBinary(t, msg) + }) + t.Run(fmt.Sprintf("JSON_%T", msg), func(t *testing.T) { + compareJSON(t, msg) + }) + }) +} From 5fece80b42035acef87108d128d2d33b0239f343 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 27 Aug 2024 10:53:43 +0300 Subject: [PATCH 142/169] [#108] protogen: Distinguish between empty and nil messages Refs #59 Signed-off-by: Evgenii Stratonikov --- accounting/grpc/service_frostfs.pb.go | 16 +- acl/grpc/types_frostfs.pb.go | 26 ++-- apemanager/grpc/service_frostfs.pb.go | 46 +++--- container/grpc/service_frostfs.pb.go | 90 +++++------ container/grpc/types_frostfs.pb.go | 8 +- lock/grpc/types_frostfs.pb.go | 2 +- netmap/grpc/service_frostfs.pb.go | 44 +++--- netmap/grpc/types_frostfs.pb.go | 16 +- object/grpc/service_frostfs.pb.go | 180 +++++++++++----------- object/grpc/types_frostfs.pb.go | 56 +++---- refs/grpc/types_frostfs.pb.go | 4 +- rpc/message/test/message.go | 1 - session/grpc/service_frostfs.pb.go | 14 +- session/grpc/types_frostfs.pb.go | 54 +++---- status/grpc/types_frostfs.pb.go | 2 +- tombstone/grpc/types_frostfs.pb.go | 2 +- util/proto/test/custom/test_frostfs.pb.go | 2 +- util/protogen/internalgengo/proto.go | 2 +- 18 files changed, 282 insertions(+), 283 deletions(-) diff --git a/accounting/grpc/service_frostfs.pb.go b/accounting/grpc/service_frostfs.pb.go index e44d7d4..b70fd27 100644 --- a/accounting/grpc/service_frostfs.pb.go +++ b/accounting/grpc/service_frostfs.pb.go @@ -50,7 +50,7 @@ func (x *BalanceRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + if x.OwnerId != nil { x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) } } @@ -205,13 +205,13 @@ func (x *BalanceRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -404,7 +404,7 @@ func (x *BalanceResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Balance != nil && x.Balance.StableSize() != 0 { + if x.Balance != nil { x.Balance.EmitProtobuf(mm.AppendMessage(1)) } } @@ -559,13 +559,13 @@ func (x *BalanceResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } diff --git a/acl/grpc/types_frostfs.pb.go b/acl/grpc/types_frostfs.pb.go index e542a19..931f3b3 100644 --- a/acl/grpc/types_frostfs.pb.go +++ b/acl/grpc/types_frostfs.pb.go @@ -708,12 +708,12 @@ func (x *EACLRecord) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendInt32(2, int32(x.Action)) } for i := range x.Filters { - if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 { + if x.Filters[i] != nil { x.Filters[i].EmitProtobuf(mm.AppendMessage(3)) } } for i := range x.Targets { - if x.Targets[i] != nil && x.Targets[i].StableSize() != 0 { + if x.Targets[i] != nil { x.Targets[i].EmitProtobuf(mm.AppendMessage(4)) } } @@ -997,14 +997,14 @@ func (x *EACLTable) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Version != nil && x.Version.StableSize() != 0 { + if x.Version != nil { x.Version.EmitProtobuf(mm.AppendMessage(1)) } - if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + if x.ContainerId != nil { x.ContainerId.EmitProtobuf(mm.AppendMessage(2)) } for i := range x.Records { - if x.Records[i] != nil && x.Records[i].StableSize() != 0 { + if x.Records[i] != nil { x.Records[i].EmitProtobuf(mm.AppendMessage(3)) } } @@ -1408,11 +1408,11 @@ func (x *BearerToken_Body_APEOverride) EmitProtobuf(mm *easyproto.MessageMarshal if x == nil { return } - if x.Target != nil && x.Target.StableSize() != 0 { + if x.Target != nil { x.Target.EmitProtobuf(mm.AppendMessage(1)) } for i := range x.Chains { - if x.Chains[i] != nil && x.Chains[i].StableSize() != 0 { + if x.Chains[i] != nil { x.Chains[i].EmitProtobuf(mm.AppendMessage(2)) } } @@ -1599,19 +1599,19 @@ func (x *BearerToken_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.EaclTable != nil && x.EaclTable.StableSize() != 0 { + if x.EaclTable != nil { x.EaclTable.EmitProtobuf(mm.AppendMessage(1)) } - if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + if x.OwnerId != nil { x.OwnerId.EmitProtobuf(mm.AppendMessage(2)) } - if x.Lifetime != nil && x.Lifetime.StableSize() != 0 { + if x.Lifetime != nil { x.Lifetime.EmitProtobuf(mm.AppendMessage(3)) } if x.AllowImpersonate { mm.AppendBool(4, x.AllowImpersonate) } - if x.ApeOverride != nil && x.ApeOverride.StableSize() != 0 { + if x.ApeOverride != nil { x.ApeOverride.EmitProtobuf(mm.AppendMessage(5)) } } @@ -1862,10 +1862,10 @@ func (x *BearerToken) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.Signature != nil && x.Signature.StableSize() != 0 { + if x.Signature != nil { x.Signature.EmitProtobuf(mm.AppendMessage(2)) } } diff --git a/apemanager/grpc/service_frostfs.pb.go b/apemanager/grpc/service_frostfs.pb.go index 380ba30..c1d28ed 100644 --- a/apemanager/grpc/service_frostfs.pb.go +++ b/apemanager/grpc/service_frostfs.pb.go @@ -52,10 +52,10 @@ func (x *AddChainRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Target != nil && x.Target.StableSize() != 0 { + if x.Target != nil { x.Target.EmitProtobuf(mm.AppendMessage(1)) } - if x.Chain != nil && x.Chain.StableSize() != 0 { + if x.Chain != nil { x.Chain.EmitProtobuf(mm.AppendMessage(2)) } } @@ -240,13 +240,13 @@ func (x *AddChainRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -590,13 +590,13 @@ func (x *AddChainResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -791,7 +791,7 @@ func (x *RemoveChainRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Target != nil && x.Target.StableSize() != 0 { + if x.Target != nil { x.Target.EmitProtobuf(mm.AppendMessage(1)) } if len(x.ChainId) != 0 { @@ -975,13 +975,13 @@ func (x *RemoveChainRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1291,13 +1291,13 @@ func (x *RemoveChainResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1490,7 +1490,7 @@ func (x *ListChainsRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Target != nil && x.Target.StableSize() != 0 { + if x.Target != nil { x.Target.EmitProtobuf(mm.AppendMessage(1)) } } @@ -1645,13 +1645,13 @@ func (x *ListChainsRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1847,7 +1847,7 @@ func (x *ListChainsResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.Chains { - if x.Chains[i] != nil && x.Chains[i].StableSize() != 0 { + if x.Chains[i] != nil { x.Chains[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -2018,13 +2018,13 @@ func (x *ListChainsResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } diff --git a/container/grpc/service_frostfs.pb.go b/container/grpc/service_frostfs.pb.go index 7590435..514f03b 100644 --- a/container/grpc/service_frostfs.pb.go +++ b/container/grpc/service_frostfs.pb.go @@ -53,10 +53,10 @@ func (x *PutRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Container != nil && x.Container.StableSize() != 0 { + if x.Container != nil { x.Container.EmitProtobuf(mm.AppendMessage(1)) } - if x.Signature != nil && x.Signature.StableSize() != 0 { + if x.Signature != nil { x.Signature.EmitProtobuf(mm.AppendMessage(2)) } } @@ -241,13 +241,13 @@ func (x *PutRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -440,7 +440,7 @@ func (x *PutResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + if x.ContainerId != nil { x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) } } @@ -595,13 +595,13 @@ func (x *PutResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -796,10 +796,10 @@ func (x *DeleteRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + if x.ContainerId != nil { x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) } - if x.Signature != nil && x.Signature.StableSize() != 0 { + if x.Signature != nil { x.Signature.EmitProtobuf(mm.AppendMessage(2)) } } @@ -984,13 +984,13 @@ func (x *DeleteRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1300,13 +1300,13 @@ func (x *DeleteResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1499,7 +1499,7 @@ func (x *GetRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + if x.ContainerId != nil { x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) } } @@ -1654,13 +1654,13 @@ func (x *GetRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1857,13 +1857,13 @@ func (x *GetResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Container != nil && x.Container.StableSize() != 0 { + if x.Container != nil { x.Container.EmitProtobuf(mm.AppendMessage(1)) } - if x.Signature != nil && x.Signature.StableSize() != 0 { + if x.Signature != nil { x.Signature.EmitProtobuf(mm.AppendMessage(2)) } - if x.SessionToken != nil && x.SessionToken.StableSize() != 0 { + if x.SessionToken != nil { x.SessionToken.EmitProtobuf(mm.AppendMessage(3)) } } @@ -2078,13 +2078,13 @@ func (x *GetResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -2277,7 +2277,7 @@ func (x *ListRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + if x.OwnerId != nil { x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) } } @@ -2432,13 +2432,13 @@ func (x *ListRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -2634,7 +2634,7 @@ func (x *ListResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.ContainerIds { - if x.ContainerIds[i] != nil && x.ContainerIds[i].StableSize() != 0 { + if x.ContainerIds[i] != nil { x.ContainerIds[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -2805,13 +2805,13 @@ func (x *ListResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -3004,7 +3004,7 @@ func (x *GetExtendedACLRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler if x == nil { return } - if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + if x.ContainerId != nil { x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) } } @@ -3159,13 +3159,13 @@ func (x *GetExtendedACLRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -3362,13 +3362,13 @@ func (x *GetExtendedACLResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshale if x == nil { return } - if x.Eacl != nil && x.Eacl.StableSize() != 0 { + if x.Eacl != nil { x.Eacl.EmitProtobuf(mm.AppendMessage(1)) } - if x.Signature != nil && x.Signature.StableSize() != 0 { + if x.Signature != nil { x.Signature.EmitProtobuf(mm.AppendMessage(2)) } - if x.SessionToken != nil && x.SessionToken.StableSize() != 0 { + if x.SessionToken != nil { x.SessionToken.EmitProtobuf(mm.AppendMessage(3)) } } @@ -3583,13 +3583,13 @@ func (x *GetExtendedACLResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } diff --git a/container/grpc/types_frostfs.pb.go b/container/grpc/types_frostfs.pb.go index 3e0d882..dcb9cf4 100644 --- a/container/grpc/types_frostfs.pb.go +++ b/container/grpc/types_frostfs.pb.go @@ -222,10 +222,10 @@ func (x *Container) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Version != nil && x.Version.StableSize() != 0 { + if x.Version != nil { x.Version.EmitProtobuf(mm.AppendMessage(1)) } - if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + if x.OwnerId != nil { x.OwnerId.EmitProtobuf(mm.AppendMessage(2)) } if len(x.Nonce) != 0 { @@ -235,11 +235,11 @@ func (x *Container) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint32(4, x.BasicAcl) } for i := range x.Attributes { - if x.Attributes[i] != nil && x.Attributes[i].StableSize() != 0 { + if x.Attributes[i] != nil { x.Attributes[i].EmitProtobuf(mm.AppendMessage(5)) } } - if x.PlacementPolicy != nil && x.PlacementPolicy.StableSize() != 0 { + if x.PlacementPolicy != nil { x.PlacementPolicy.EmitProtobuf(mm.AppendMessage(6)) } } diff --git a/lock/grpc/types_frostfs.pb.go b/lock/grpc/types_frostfs.pb.go index 3012111..52a1a2d 100644 --- a/lock/grpc/types_frostfs.pb.go +++ b/lock/grpc/types_frostfs.pb.go @@ -52,7 +52,7 @@ func (x *Lock) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.Members { - if x.Members[i] != nil && x.Members[i].StableSize() != 0 { + if x.Members[i] != nil { x.Members[i].EmitProtobuf(mm.AppendMessage(1)) } } diff --git a/netmap/grpc/service_frostfs.pb.go b/netmap/grpc/service_frostfs.pb.go index 1ce80ff..3d62855 100644 --- a/netmap/grpc/service_frostfs.pb.go +++ b/netmap/grpc/service_frostfs.pb.go @@ -167,13 +167,13 @@ func (x *LocalNodeInfoRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -368,10 +368,10 @@ func (x *LocalNodeInfoResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler if x == nil { return } - if x.Version != nil && x.Version.StableSize() != 0 { + if x.Version != nil { x.Version.EmitProtobuf(mm.AppendMessage(1)) } - if x.NodeInfo != nil && x.NodeInfo.StableSize() != 0 { + if x.NodeInfo != nil { x.NodeInfo.EmitProtobuf(mm.AppendMessage(2)) } } @@ -556,13 +556,13 @@ func (x *LocalNodeInfoResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -872,13 +872,13 @@ func (x *NetworkInfoRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1071,7 +1071,7 @@ func (x *NetworkInfoResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) if x == nil { return } - if x.NetworkInfo != nil && x.NetworkInfo.StableSize() != 0 { + if x.NetworkInfo != nil { x.NetworkInfo.EmitProtobuf(mm.AppendMessage(1)) } } @@ -1226,13 +1226,13 @@ func (x *NetworkInfoResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1542,13 +1542,13 @@ func (x *NetmapSnapshotRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1741,7 +1741,7 @@ func (x *NetmapSnapshotResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshale if x == nil { return } - if x.Netmap != nil && x.Netmap.StableSize() != 0 { + if x.Netmap != nil { x.Netmap.EmitProtobuf(mm.AppendMessage(1)) } } @@ -1896,13 +1896,13 @@ func (x *NetmapSnapshotResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } diff --git a/netmap/grpc/types_frostfs.pb.go b/netmap/grpc/types_frostfs.pb.go index 3bab079..6ecf0fa 100644 --- a/netmap/grpc/types_frostfs.pb.go +++ b/netmap/grpc/types_frostfs.pb.go @@ -166,7 +166,7 @@ func (x *Filter) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendString(4, x.Value) } for i := range x.Filters { - if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 { + if x.Filters[i] != nil { x.Filters[i].EmitProtobuf(mm.AppendMessage(5)) } } @@ -941,7 +941,7 @@ func (x *PlacementPolicy) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.Replicas { - if x.Replicas[i] != nil && x.Replicas[i].StableSize() != 0 { + if x.Replicas[i] != nil { x.Replicas[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -949,12 +949,12 @@ func (x *PlacementPolicy) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint32(2, x.ContainerBackupFactor) } for i := range x.Selectors { - if x.Selectors[i] != nil && x.Selectors[i].StableSize() != 0 { + if x.Selectors[i] != nil { x.Selectors[i].EmitProtobuf(mm.AppendMessage(3)) } } for i := range x.Filters { - if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 { + if x.Filters[i] != nil { x.Filters[i].EmitProtobuf(mm.AppendMessage(4)) } } @@ -1506,7 +1506,7 @@ func (x *NodeInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendString(2, x.Addresses[j]) } for i := range x.Attributes { - if x.Attributes[i] != nil && x.Attributes[i].StableSize() != 0 { + if x.Attributes[i] != nil { x.Attributes[i].EmitProtobuf(mm.AppendMessage(3)) } } @@ -1774,7 +1774,7 @@ func (x *Netmap) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint64(1, x.Epoch) } for i := range x.Nodes { - if x.Nodes[i] != nil && x.Nodes[i].StableSize() != 0 { + if x.Nodes[i] != nil { x.Nodes[i].EmitProtobuf(mm.AppendMessage(2)) } } @@ -2112,7 +2112,7 @@ func (x *NetworkConfig) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.Parameters { - if x.Parameters[i] != nil && x.Parameters[i].StableSize() != 0 { + if x.Parameters[i] != nil { x.Parameters[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -2276,7 +2276,7 @@ func (x *NetworkInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x.MsPerBlock != 0 { mm.AppendInt64(3, x.MsPerBlock) } - if x.NetworkConfig != nil && x.NetworkConfig.StableSize() != 0 { + if x.NetworkConfig != nil { x.NetworkConfig.EmitProtobuf(mm.AppendMessage(4)) } } diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go index ce8336a..0bd0111 100644 --- a/object/grpc/service_frostfs.pb.go +++ b/object/grpc/service_frostfs.pb.go @@ -53,7 +53,7 @@ func (x *GetRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Address != nil && x.Address.StableSize() != 0 { + if x.Address != nil { x.Address.EmitProtobuf(mm.AppendMessage(1)) } if x.Raw { @@ -237,13 +237,13 @@ func (x *GetRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -440,13 +440,13 @@ func (x *GetResponse_Body_Init) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + if x.ObjectId != nil { x.ObjectId.EmitProtobuf(mm.AppendMessage(1)) } - if x.Signature != nil && x.Signature.StableSize() != 0 { + if x.Signature != nil { x.Signature.EmitProtobuf(mm.AppendMessage(2)) } - if x.Header != nil && x.Header.StableSize() != 0 { + if x.Header != nil { x.Header.EmitProtobuf(mm.AppendMessage(3)) } } @@ -651,7 +651,7 @@ func (x *GetResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } if inner, ok := x.ObjectPart.(*GetResponse_Body_Init_); ok { - if inner.Init != nil && inner.Init.StableSize() != 0 { + if inner.Init != nil { inner.Init.EmitProtobuf(mm.AppendMessage(1)) } } @@ -661,12 +661,12 @@ func (x *GetResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { } } if inner, ok := x.ObjectPart.(*GetResponse_Body_SplitInfo); ok { - if inner.SplitInfo != nil && inner.SplitInfo.StableSize() != 0 { + if inner.SplitInfo != nil { inner.SplitInfo.EmitProtobuf(mm.AppendMessage(3)) } } if inner, ok := x.ObjectPart.(*GetResponse_Body_EcInfo); ok { - if inner.EcInfo != nil && inner.EcInfo.StableSize() != 0 { + if inner.EcInfo != nil { inner.EcInfo.EmitProtobuf(mm.AppendMessage(4)) } } @@ -971,13 +971,13 @@ func (x *GetResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1178,13 +1178,13 @@ func (x *PutRequest_Body_Init) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + if x.ObjectId != nil { x.ObjectId.EmitProtobuf(mm.AppendMessage(1)) } - if x.Signature != nil && x.Signature.StableSize() != 0 { + if x.Signature != nil { x.Signature.EmitProtobuf(mm.AppendMessage(2)) } - if x.Header != nil && x.Header.StableSize() != 0 { + if x.Header != nil { x.Header.EmitProtobuf(mm.AppendMessage(3)) } if len(x.CopiesNumber) != 0 { @@ -1426,7 +1426,7 @@ func (x *PutRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } if inner, ok := x.ObjectPart.(*PutRequest_Body_Init_); ok { - if inner.Init != nil && inner.Init.StableSize() != 0 { + if inner.Init != nil { inner.Init.EmitProtobuf(mm.AppendMessage(1)) } } @@ -1656,13 +1656,13 @@ func (x *PutRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -1855,7 +1855,7 @@ func (x *PutResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + if x.ObjectId != nil { x.ObjectId.EmitProtobuf(mm.AppendMessage(1)) } } @@ -2010,13 +2010,13 @@ func (x *PutResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -2209,7 +2209,7 @@ func (x *DeleteRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Address != nil && x.Address.StableSize() != 0 { + if x.Address != nil { x.Address.EmitProtobuf(mm.AppendMessage(1)) } } @@ -2364,13 +2364,13 @@ func (x *DeleteRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -2563,7 +2563,7 @@ func (x *DeleteResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Tombstone != nil && x.Tombstone.StableSize() != 0 { + if x.Tombstone != nil { x.Tombstone.EmitProtobuf(mm.AppendMessage(1)) } } @@ -2718,13 +2718,13 @@ func (x *DeleteResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -2921,7 +2921,7 @@ func (x *HeadRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Address != nil && x.Address.StableSize() != 0 { + if x.Address != nil { x.Address.EmitProtobuf(mm.AppendMessage(1)) } if x.MainOnly { @@ -3134,13 +3134,13 @@ func (x *HeadRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -3335,10 +3335,10 @@ func (x *HeaderWithSignature) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Header != nil && x.Header.StableSize() != 0 { + if x.Header != nil { x.Header.EmitProtobuf(mm.AppendMessage(1)) } - if x.Signature != nil && x.Signature.StableSize() != 0 { + if x.Signature != nil { x.Signature.EmitProtobuf(mm.AppendMessage(2)) } } @@ -3513,22 +3513,22 @@ func (x *HeadResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } if inner, ok := x.Head.(*HeadResponse_Body_Header); ok { - if inner.Header != nil && inner.Header.StableSize() != 0 { + if inner.Header != nil { inner.Header.EmitProtobuf(mm.AppendMessage(1)) } } if inner, ok := x.Head.(*HeadResponse_Body_ShortHeader); ok { - if inner.ShortHeader != nil && inner.ShortHeader.StableSize() != 0 { + if inner.ShortHeader != nil { inner.ShortHeader.EmitProtobuf(mm.AppendMessage(2)) } } if inner, ok := x.Head.(*HeadResponse_Body_SplitInfo); ok { - if inner.SplitInfo != nil && inner.SplitInfo.StableSize() != 0 { + if inner.SplitInfo != nil { inner.SplitInfo.EmitProtobuf(mm.AppendMessage(3)) } } if inner, ok := x.Head.(*HeadResponse_Body_EcInfo); ok { - if inner.EcInfo != nil && inner.EcInfo.StableSize() != 0 { + if inner.EcInfo != nil { inner.EcInfo.EmitProtobuf(mm.AppendMessage(4)) } } @@ -3829,13 +3829,13 @@ func (x *HeadResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -4241,14 +4241,14 @@ func (x *SearchRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + if x.ContainerId != nil { x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) } if x.Version != 0 { mm.AppendUint32(2, x.Version) } for i := range x.Filters { - if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 { + if x.Filters[i] != nil { x.Filters[i].EmitProtobuf(mm.AppendMessage(3)) } } @@ -4475,13 +4475,13 @@ func (x *SearchRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -4677,7 +4677,7 @@ func (x *SearchResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.IdList { - if x.IdList[i] != nil && x.IdList[i].StableSize() != 0 { + if x.IdList[i] != nil { x.IdList[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -4848,13 +4848,13 @@ func (x *SearchResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -5211,10 +5211,10 @@ func (x *GetRangeRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Address != nil && x.Address.StableSize() != 0 { + if x.Address != nil { x.Address.EmitProtobuf(mm.AppendMessage(1)) } - if x.Range != nil && x.Range.StableSize() != 0 { + if x.Range != nil { x.Range.EmitProtobuf(mm.AppendMessage(2)) } if x.Raw { @@ -5428,13 +5428,13 @@ func (x *GetRangeRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -5641,12 +5641,12 @@ func (x *GetRangeResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { } } if inner, ok := x.RangePart.(*GetRangeResponse_Body_SplitInfo); ok { - if inner.SplitInfo != nil && inner.SplitInfo.StableSize() != 0 { + if inner.SplitInfo != nil { inner.SplitInfo.EmitProtobuf(mm.AppendMessage(2)) } } if inner, ok := x.RangePart.(*GetRangeResponse_Body_EcInfo); ok { - if inner.EcInfo != nil && inner.EcInfo.StableSize() != 0 { + if inner.EcInfo != nil { inner.EcInfo.EmitProtobuf(mm.AppendMessage(3)) } } @@ -5911,13 +5911,13 @@ func (x *GetRangeResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -6118,11 +6118,11 @@ func (x *GetRangeHashRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) if x == nil { return } - if x.Address != nil && x.Address.StableSize() != 0 { + if x.Address != nil { x.Address.EmitProtobuf(mm.AppendMessage(1)) } for i := range x.Ranges { - if x.Ranges[i] != nil && x.Ranges[i].StableSize() != 0 { + if x.Ranges[i] != nil { x.Ranges[i].EmitProtobuf(mm.AppendMessage(2)) } } @@ -6397,13 +6397,13 @@ func (x *GetRangeHashRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -6808,13 +6808,13 @@ func (x *GetRangeHashResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -7011,7 +7011,7 @@ func (x *PutSingleRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Object != nil && x.Object.StableSize() != 0 { + if x.Object != nil { x.Object.EmitProtobuf(mm.AppendMessage(1)) } if len(x.CopiesNumber) != 0 { @@ -7209,13 +7209,13 @@ func (x *PutSingleRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -7525,13 +7525,13 @@ func (x *PutSingleResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -7726,7 +7726,7 @@ func (x *PatchRequest_Body_Patch) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.SourceRange != nil && x.SourceRange.StableSize() != 0 { + if x.SourceRange != nil { x.SourceRange.EmitProtobuf(mm.AppendMessage(1)) } if len(x.Chunk) != 0 { @@ -7896,18 +7896,18 @@ func (x *PatchRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Address != nil && x.Address.StableSize() != 0 { + if x.Address != nil { x.Address.EmitProtobuf(mm.AppendMessage(1)) } for i := range x.NewAttributes { - if x.NewAttributes[i] != nil && x.NewAttributes[i].StableSize() != 0 { + if x.NewAttributes[i] != nil { x.NewAttributes[i].EmitProtobuf(mm.AppendMessage(2)) } } if x.ReplaceAttributes { mm.AppendBool(3, x.ReplaceAttributes) } - if x.Patch != nil && x.Patch.StableSize() != 0 { + if x.Patch != nil { x.Patch.EmitProtobuf(mm.AppendMessage(4)) } } @@ -8163,13 +8163,13 @@ func (x *PatchRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -8362,7 +8362,7 @@ func (x *PatchResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + if x.ObjectId != nil { x.ObjectId.EmitProtobuf(mm.AppendMessage(1)) } } @@ -8517,13 +8517,13 @@ func (x *PatchResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } diff --git a/object/grpc/types_frostfs.pb.go b/object/grpc/types_frostfs.pb.go index 492ee48..04a3e29 100644 --- a/object/grpc/types_frostfs.pb.go +++ b/object/grpc/types_frostfs.pb.go @@ -139,13 +139,13 @@ func (x *ShortHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Version != nil && x.Version.StableSize() != 0 { + if x.Version != nil { x.Version.EmitProtobuf(mm.AppendMessage(1)) } if x.CreationEpoch != 0 { mm.AppendUint64(2, x.CreationEpoch) } - if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + if x.OwnerId != nil { x.OwnerId.EmitProtobuf(mm.AppendMessage(3)) } if int32(x.ObjectType) != 0 { @@ -154,10 +154,10 @@ func (x *ShortHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x.PayloadLength != 0 { mm.AppendUint64(5, x.PayloadLength) } - if x.PayloadHash != nil && x.PayloadHash.StableSize() != 0 { + if x.PayloadHash != nil { x.PayloadHash.EmitProtobuf(mm.AppendMessage(6)) } - if x.HomomorphicHash != nil && x.HomomorphicHash.StableSize() != 0 { + if x.HomomorphicHash != nil { x.HomomorphicHash.EmitProtobuf(mm.AppendMessage(7)) } } @@ -646,20 +646,20 @@ func (x *Header_Split) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Parent != nil && x.Parent.StableSize() != 0 { + if x.Parent != nil { x.Parent.EmitProtobuf(mm.AppendMessage(1)) } - if x.Previous != nil && x.Previous.StableSize() != 0 { + if x.Previous != nil { x.Previous.EmitProtobuf(mm.AppendMessage(2)) } - if x.ParentSignature != nil && x.ParentSignature.StableSize() != 0 { + if x.ParentSignature != nil { x.ParentSignature.EmitProtobuf(mm.AppendMessage(3)) } - if x.ParentHeader != nil && x.ParentHeader.StableSize() != 0 { + if x.ParentHeader != nil { x.ParentHeader.EmitProtobuf(mm.AppendMessage(4)) } for i := range x.Children { - if x.Children[i] != nil && x.Children[i].StableSize() != 0 { + if x.Children[i] != nil { x.Children[i].EmitProtobuf(mm.AppendMessage(5)) } } @@ -973,7 +973,7 @@ func (x *Header_EC) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Parent != nil && x.Parent.StableSize() != 0 { + if x.Parent != nil { x.Parent.EmitProtobuf(mm.AppendMessage(1)) } if x.Index != 0 { @@ -991,11 +991,11 @@ func (x *Header_EC) EmitProtobuf(mm *easyproto.MessageMarshaler) { if len(x.ParentSplitId) != 0 { mm.AppendBytes(6, x.ParentSplitId) } - if x.ParentSplitParentId != nil && x.ParentSplitParentId.StableSize() != 0 { + if x.ParentSplitParentId != nil { x.ParentSplitParentId.EmitProtobuf(mm.AppendMessage(7)) } for i := range x.ParentAttributes { - if x.ParentAttributes[i] != nil && x.ParentAttributes[i].StableSize() != 0 { + if x.ParentAttributes[i] != nil { x.ParentAttributes[i].EmitProtobuf(mm.AppendMessage(8)) } } @@ -1358,13 +1358,13 @@ func (x *Header) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Version != nil && x.Version.StableSize() != 0 { + if x.Version != nil { x.Version.EmitProtobuf(mm.AppendMessage(1)) } - if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + if x.ContainerId != nil { x.ContainerId.EmitProtobuf(mm.AppendMessage(2)) } - if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + if x.OwnerId != nil { x.OwnerId.EmitProtobuf(mm.AppendMessage(3)) } if x.CreationEpoch != 0 { @@ -1373,27 +1373,27 @@ func (x *Header) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x.PayloadLength != 0 { mm.AppendUint64(5, x.PayloadLength) } - if x.PayloadHash != nil && x.PayloadHash.StableSize() != 0 { + if x.PayloadHash != nil { x.PayloadHash.EmitProtobuf(mm.AppendMessage(6)) } if int32(x.ObjectType) != 0 { mm.AppendInt32(7, int32(x.ObjectType)) } - if x.HomomorphicHash != nil && x.HomomorphicHash.StableSize() != 0 { + if x.HomomorphicHash != nil { x.HomomorphicHash.EmitProtobuf(mm.AppendMessage(8)) } - if x.SessionToken != nil && x.SessionToken.StableSize() != 0 { + if x.SessionToken != nil { x.SessionToken.EmitProtobuf(mm.AppendMessage(9)) } for i := range x.Attributes { - if x.Attributes[i] != nil && x.Attributes[i].StableSize() != 0 { + if x.Attributes[i] != nil { x.Attributes[i].EmitProtobuf(mm.AppendMessage(10)) } } - if x.Split != nil && x.Split.StableSize() != 0 { + if x.Split != nil { x.Split.EmitProtobuf(mm.AppendMessage(11)) } - if x.Ec != nil && x.Ec.StableSize() != 0 { + if x.Ec != nil { x.Ec.EmitProtobuf(mm.AppendMessage(12)) } } @@ -1881,13 +1881,13 @@ func (x *Object) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + if x.ObjectId != nil { x.ObjectId.EmitProtobuf(mm.AppendMessage(1)) } - if x.Signature != nil && x.Signature.StableSize() != 0 { + if x.Signature != nil { x.Signature.EmitProtobuf(mm.AppendMessage(2)) } - if x.Header != nil && x.Header.StableSize() != 0 { + if x.Header != nil { x.Header.EmitProtobuf(mm.AppendMessage(3)) } if len(x.Payload) != 0 { @@ -2116,10 +2116,10 @@ func (x *SplitInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) { if len(x.SplitId) != 0 { mm.AppendBytes(1, x.SplitId) } - if x.LastPart != nil && x.LastPart.StableSize() != 0 { + if x.LastPart != nil { x.LastPart.EmitProtobuf(mm.AppendMessage(2)) } - if x.Link != nil && x.Link.StableSize() != 0 { + if x.Link != nil { x.Link.EmitProtobuf(mm.AppendMessage(3)) } } @@ -2312,7 +2312,7 @@ func (x *ECInfo_Chunk) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Id != nil && x.Id.StableSize() != 0 { + if x.Id != nil { x.Id.EmitProtobuf(mm.AppendMessage(1)) } if x.Index != 0 { @@ -2506,7 +2506,7 @@ func (x *ECInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.Chunks { - if x.Chunks[i] != nil && x.Chunks[i].StableSize() != 0 { + if x.Chunks[i] != nil { x.Chunks[i].EmitProtobuf(mm.AppendMessage(1)) } } diff --git a/refs/grpc/types_frostfs.pb.go b/refs/grpc/types_frostfs.pb.go index 881a06f..35febe9 100644 --- a/refs/grpc/types_frostfs.pb.go +++ b/refs/grpc/types_frostfs.pb.go @@ -121,10 +121,10 @@ func (x *Address) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + if x.ContainerId != nil { x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) } - if x.ObjectId != nil && x.ObjectId.StableSize() != 0 { + if x.ObjectId != nil { x.ObjectId.EmitProtobuf(mm.AppendMessage(2)) } } diff --git a/rpc/message/test/message.go b/rpc/message/test/message.go index 1f7097e..0849b20 100644 --- a/rpc/message/test/message.go +++ b/rpc/message/test/message.go @@ -111,7 +111,6 @@ func testCompatibility(t *testing.T, msgGen func(empty bool) message.Message) { } } t.Run("empty", func(t *testing.T) { - t.Skip() msg := msgGen(true) t.Run(fmt.Sprintf("Binary_%T", msg), func(t *testing.T) { compareBinary(t, msg) diff --git a/session/grpc/service_frostfs.pb.go b/session/grpc/service_frostfs.pb.go index cfec4d6..aa42ee8 100644 --- a/session/grpc/service_frostfs.pb.go +++ b/session/grpc/service_frostfs.pb.go @@ -51,7 +51,7 @@ func (x *CreateRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + if x.OwnerId != nil { x.OwnerId.EmitProtobuf(mm.AppendMessage(1)) } if x.Expiration != 0 { @@ -235,13 +235,13 @@ func (x *CreateRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } @@ -616,13 +616,13 @@ func (x *CreateResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 { + if x.MetaHeader != nil { x.MetaHeader.EmitProtobuf(mm.AppendMessage(2)) } - if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 { + if x.VerifyHeader != nil { x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3)) } } diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go index af95210..4f8bf81 100644 --- a/session/grpc/types_frostfs.pb.go +++ b/session/grpc/types_frostfs.pb.go @@ -109,11 +109,11 @@ func (x *ObjectSessionContext_Target) EmitProtobuf(mm *easyproto.MessageMarshale if x == nil { return } - if x.Container != nil && x.Container.StableSize() != 0 { + if x.Container != nil { x.Container.EmitProtobuf(mm.AppendMessage(1)) } for i := range x.Objects { - if x.Objects[i] != nil && x.Objects[i].StableSize() != 0 { + if x.Objects[i] != nil { x.Objects[i].EmitProtobuf(mm.AppendMessage(2)) } } @@ -297,7 +297,7 @@ func (x *ObjectSessionContext) EmitProtobuf(mm *easyproto.MessageMarshaler) { if int32(x.Verb) != 0 { mm.AppendInt32(1, int32(x.Verb)) } - if x.Target != nil && x.Target.StableSize() != 0 { + if x.Target != nil { x.Target.EmitProtobuf(mm.AppendMessage(2)) } } @@ -520,7 +520,7 @@ func (x *ContainerSessionContext) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x.Wildcard { mm.AppendBool(2, x.Wildcard) } - if x.ContainerId != nil && x.ContainerId.StableSize() != 0 { + if x.ContainerId != nil { x.ContainerId.EmitProtobuf(mm.AppendMessage(3)) } } @@ -928,22 +928,22 @@ func (x *SessionToken_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { if len(x.Id) != 0 { mm.AppendBytes(1, x.Id) } - if x.OwnerId != nil && x.OwnerId.StableSize() != 0 { + if x.OwnerId != nil { x.OwnerId.EmitProtobuf(mm.AppendMessage(2)) } - if x.Lifetime != nil && x.Lifetime.StableSize() != 0 { + if x.Lifetime != nil { x.Lifetime.EmitProtobuf(mm.AppendMessage(3)) } if len(x.SessionKey) != 0 { mm.AppendBytes(4, x.SessionKey) } if inner, ok := x.Context.(*SessionToken_Body_Object); ok { - if inner.Object != nil && inner.Object.StableSize() != 0 { + if inner.Object != nil { inner.Object.EmitProtobuf(mm.AppendMessage(5)) } } if inner, ok := x.Context.(*SessionToken_Body_Container); ok { - if inner.Container != nil && inner.Container.StableSize() != 0 { + if inner.Container != nil { inner.Container.EmitProtobuf(mm.AppendMessage(6)) } } @@ -1256,10 +1256,10 @@ func (x *SessionToken) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Body != nil && x.Body.StableSize() != 0 { + if x.Body != nil { x.Body.EmitProtobuf(mm.AppendMessage(1)) } - if x.Signature != nil && x.Signature.StableSize() != 0 { + if x.Signature != nil { x.Signature.EmitProtobuf(mm.AppendMessage(2)) } } @@ -1598,7 +1598,7 @@ func (x *RequestMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Version != nil && x.Version.StableSize() != 0 { + if x.Version != nil { x.Version.EmitProtobuf(mm.AppendMessage(1)) } if x.Epoch != 0 { @@ -1608,17 +1608,17 @@ func (x *RequestMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint32(3, x.Ttl) } for i := range x.XHeaders { - if x.XHeaders[i] != nil && x.XHeaders[i].StableSize() != 0 { + if x.XHeaders[i] != nil { x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) } } - if x.SessionToken != nil && x.SessionToken.StableSize() != 0 { + if x.SessionToken != nil { x.SessionToken.EmitProtobuf(mm.AppendMessage(5)) } - if x.BearerToken != nil && x.BearerToken.StableSize() != 0 { + if x.BearerToken != nil { x.BearerToken.EmitProtobuf(mm.AppendMessage(6)) } - if x.Origin != nil && x.Origin.StableSize() != 0 { + if x.Origin != nil { x.Origin.EmitProtobuf(mm.AppendMessage(7)) } if x.MagicNumber != 0 { @@ -1979,7 +1979,7 @@ func (x *ResponseMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { if x == nil { return } - if x.Version != nil && x.Version.StableSize() != 0 { + if x.Version != nil { x.Version.EmitProtobuf(mm.AppendMessage(1)) } if x.Epoch != 0 { @@ -1989,14 +1989,14 @@ func (x *ResponseMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint32(3, x.Ttl) } for i := range x.XHeaders { - if x.XHeaders[i] != nil && x.XHeaders[i].StableSize() != 0 { + if x.XHeaders[i] != nil { x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) } } - if x.Origin != nil && x.Origin.StableSize() != 0 { + if x.Origin != nil { x.Origin.EmitProtobuf(mm.AppendMessage(5)) } - if x.Status != nil && x.Status.StableSize() != 0 { + if x.Status != nil { x.Status.EmitProtobuf(mm.AppendMessage(6)) } } @@ -2292,16 +2292,16 @@ func (x *RequestVerificationHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) if x == nil { return } - if x.BodySignature != nil && x.BodySignature.StableSize() != 0 { + if x.BodySignature != nil { x.BodySignature.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaSignature != nil && x.MetaSignature.StableSize() != 0 { + if x.MetaSignature != nil { x.MetaSignature.EmitProtobuf(mm.AppendMessage(2)) } - if x.OriginSignature != nil && x.OriginSignature.StableSize() != 0 { + if x.OriginSignature != nil { x.OriginSignature.EmitProtobuf(mm.AppendMessage(3)) } - if x.Origin != nil && x.Origin.StableSize() != 0 { + if x.Origin != nil { x.Origin.EmitProtobuf(mm.AppendMessage(4)) } } @@ -2530,16 +2530,16 @@ func (x *ResponseVerificationHeader) EmitProtobuf(mm *easyproto.MessageMarshaler if x == nil { return } - if x.BodySignature != nil && x.BodySignature.StableSize() != 0 { + if x.BodySignature != nil { x.BodySignature.EmitProtobuf(mm.AppendMessage(1)) } - if x.MetaSignature != nil && x.MetaSignature.StableSize() != 0 { + if x.MetaSignature != nil { x.MetaSignature.EmitProtobuf(mm.AppendMessage(2)) } - if x.OriginSignature != nil && x.OriginSignature.StableSize() != 0 { + if x.OriginSignature != nil { x.OriginSignature.EmitProtobuf(mm.AppendMessage(3)) } - if x.Origin != nil && x.Origin.StableSize() != 0 { + if x.Origin != nil { x.Origin.EmitProtobuf(mm.AppendMessage(4)) } } diff --git a/status/grpc/types_frostfs.pb.go b/status/grpc/types_frostfs.pb.go index a12ab55..5012491 100644 --- a/status/grpc/types_frostfs.pb.go +++ b/status/grpc/types_frostfs.pb.go @@ -476,7 +476,7 @@ func (x *Status) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendString(2, x.Message) } for i := range x.Details { - if x.Details[i] != nil && x.Details[i].StableSize() != 0 { + if x.Details[i] != nil { x.Details[i].EmitProtobuf(mm.AppendMessage(3)) } } diff --git a/tombstone/grpc/types_frostfs.pb.go b/tombstone/grpc/types_frostfs.pb.go index b0924c0..8c2e83c 100644 --- a/tombstone/grpc/types_frostfs.pb.go +++ b/tombstone/grpc/types_frostfs.pb.go @@ -62,7 +62,7 @@ func (x *Tombstone) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendBytes(2, x.SplitId) } for i := range x.Members { - if x.Members[i] != nil && x.Members[i].StableSize() != 0 { + if x.Members[i] != nil { x.Members[i].EmitProtobuf(mm.AppendMessage(3)) } } diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index b1d2cf2..a39bba7 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -288,7 +288,7 @@ func (x *Primitives) EmitProtobuf(mm *easyproto.MessageMarshaler) { } } if inner, ok := x.FieldM.(*Primitives_FieldAux); ok { - if inner.FieldAux != nil && inner.FieldAux.StableSize() != 0 { + if inner.FieldAux != nil { inner.FieldAux.EmitProtobuf(mm.AppendMessage(403)) } } diff --git a/util/protogen/internalgengo/proto.go b/util/protogen/internalgengo/proto.go index 8e5e967..8894cde 100644 --- a/util/protogen/internalgengo/proto.go +++ b/util/protogen/internalgengo/proto.go @@ -174,7 +174,7 @@ func emitMarshalRaw(g *protogen.GeneratedFile, f *protogen.Field, name string) { name += "[i]" } - g.P("if ", notNil(name), " && ", name, ".StableSize() != 0 {") + g.P("if ", notNil(name), " {") g.P(name, ".EmitProtobuf(mm.AppendMessage(", f.Desc.Number(), "))") g.P("}") return From ca33fc4adb9715559cafccb48b3625b032c5d266 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 27 Aug 2024 11:35:49 +0300 Subject: [PATCH 143/169] [#109] rpc/message: Remove incorrect copypaste Signed-off-by: Evgenii Stratonikov --- rpc/message/test/message.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/rpc/message/test/message.go b/rpc/message/test/message.go index 0849b20..96b6de4 100644 --- a/rpc/message/test/message.go +++ b/rpc/message/test/message.go @@ -104,11 +104,6 @@ func testCompatibility(t *testing.T, msgGen func(empty bool) message.Message) { require.NoError(t, err) require.JSONEq(t, string(a), string(b)) - if len(a) == 0 { - require.Empty(t, b) - } else { - require.Equal(t, a, b) - } } t.Run("empty", func(t *testing.T) { msg := msgGen(true) From eba18f6e67ac7fd47670b8dad63f1a1379a04cac Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 27 Aug 2024 13:45:04 +0300 Subject: [PATCH 144/169] [#110] object: Add getter and setter for `PatchResponseBody` Signed-off-by: Airat Arifullin --- object/types.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/object/types.go b/object/types.go index 160e820..0ca3f12 100644 --- a/object/types.go +++ b/object/types.go @@ -1615,6 +1615,18 @@ func (r *PatchResponse) SetBody(v *PatchResponseBody) { r.Body = v } +func (r *PatchResponseBody) GetObjectID() *refs.ObjectID { + if r != nil { + return r.ObjectID + } + + return nil +} + +func (r *PatchResponseBody) SetObjectID(objectID *refs.ObjectID) { + r.ObjectID = objectID +} + func (r *PatchRequestBodyPatch) GetChunk() []byte { if r != nil { return r.Chunk From a2025376fcd42534661cff65360c50f0b4643d3a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 27 Aug 2024 15:02:16 +0300 Subject: [PATCH 145/169] [#111] proto/test: Add repeated message test Signed-off-by: Evgenii Stratonikov --- util/proto/marshal_test.go | 15 ++ util/proto/test/custom/test_frostfs.pb.go | 197 +++++++++++++++++++++- util/proto/test/test.pb.go | 117 ++++++++++--- util/proto/test/test.proto | 3 + 4 files changed, 304 insertions(+), 28 deletions(-) diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index 5d887ce..a848bb5 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -113,6 +113,10 @@ func repPrimitivesEqual(t *testing.T, a *generated.RepPrimitives, b *test.RepPri require.Equal(t, a.FieldE, b.FieldE) require.Equal(t, a.FieldF, b.FieldF) require.Equal(t, a.FieldFu, b.FieldFu) + require.Equal(t, len(a.GetFieldAux()), len(b.GetFieldAux())) + for i := range a.FieldAux { + require.Equal(t, a.GetFieldAux()[i].GetInnerField(), b.GetFieldAux()[i].GetInnerField()) + } } func randIntSlice[T protoInt](n int, includeZero bool) []T { @@ -129,6 +133,14 @@ func randIntSlice[T protoInt](n int, includeZero bool) []T { return r } +func uint32SliceToAux(s []uint32) []*generated.RepPrimitives_Aux { + r := make([]*generated.RepPrimitives_Aux, len(s)) + for i := range s { + r[i] = &generated.RepPrimitives_Aux{s[i]} + } + return r +} + func TestStableMarshalRep(t *testing.T) { t.Run("empty", func(t *testing.T) { marshalCases := []struct { @@ -176,6 +188,9 @@ func TestStableMarshalRep(t *testing.T) { {name: "uint64", input: &generated.RepPrimitives{FieldFu: randIntSlice[uint64](1, true)}}, {name: "uint64", input: &generated.RepPrimitives{FieldFu: randIntSlice[uint64](2, true)}}, {name: "uint64", input: &generated.RepPrimitives{FieldFu: randIntSlice[uint64](2, false)}}, + {name: "message", input: &generated.RepPrimitives{FieldAux: uint32SliceToAux(randIntSlice[uint32](1, true))}}, + {name: "message", input: &generated.RepPrimitives{FieldAux: uint32SliceToAux(randIntSlice[uint32](2, true))}}, + {name: "message", input: &generated.RepPrimitives{FieldAux: uint32SliceToAux(randIntSlice[uint32](2, false))}}, } for _, tc := range marshalCases { t.Run(tc.name, func(t *testing.T) { diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index a39bba7..f3b958f 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -802,14 +802,144 @@ func (*Primitives_FieldMe) isPrimitives_FieldM() {} func (*Primitives_FieldAux) isPrimitives_FieldM() {} +type RepPrimitives_Aux struct { + InnerField uint32 `json:"innerField"` +} + +var ( + _ encoding.ProtoMarshaler = (*RepPrimitives_Aux)(nil) + _ encoding.ProtoUnmarshaler = (*RepPrimitives_Aux)(nil) + _ json.Marshaler = (*RepPrimitives_Aux)(nil) + _ json.Unmarshaler = (*RepPrimitives_Aux)(nil) +) + +// StableSize returns the size of x in protobuf format. +// +// Structures with the same field values have the same binary size. +func (x *RepPrimitives_Aux) StableSize() (size int) { + if x == nil { + return 0 + } + size += proto.UInt32Size(1, x.InnerField) + return size +} + +// MarshalProtobuf implements the encoding.ProtoMarshaler interface. +func (x *RepPrimitives_Aux) 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 *RepPrimitives_Aux) EmitProtobuf(mm *easyproto.MessageMarshaler) { + if x == nil { + return + } + if x.InnerField != 0 { + mm.AppendUint32(1, x.InnerField) + } +} + +// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. +func (x *RepPrimitives_Aux) 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", "RepPrimitives_Aux") + } + switch fc.FieldNum { + case 1: // InnerField + data, ok := fc.Uint32() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "InnerField") + } + x.InnerField = data + } + } + return nil +} +func (x *RepPrimitives_Aux) GetInnerField() uint32 { + if x != nil { + return x.InnerField + } + return 0 +} +func (x *RepPrimitives_Aux) SetInnerField(v uint32) { + x.InnerField = v +} + +// MarshalJSON implements the json.Marshaler interface. +func (x *RepPrimitives_Aux) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + x.MarshalEasyJSON(&w) + return w.Buffer.BuildBytes(), w.Error +} +func (x *RepPrimitives_Aux) MarshalEasyJSON(out *jwriter.Writer) { + if x == nil { + out.RawString("null") + return + } + out.RawByte('{') + { + const prefix string = ",\"innerField\":" + out.RawString(prefix[1:]) + out.Uint32(x.InnerField) + } + out.RawByte('}') +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (x *RepPrimitives_Aux) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + x.UnmarshalEasyJSON(&r) + return r.Error() +} +func (x *RepPrimitives_Aux) 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 "innerField": + { + var f uint32 + f = in.Uint32() + x.InnerField = f + } + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} + type RepPrimitives struct { - FieldA [][]byte `json:"fieldA"` - FieldB []string `json:"fieldB"` - FieldC []int32 `json:"fieldC"` - FieldD []uint32 `json:"fieldD"` - FieldE []int64 `json:"fieldE"` - FieldF []uint64 `json:"fieldF"` - FieldFu []uint64 `json:"fieldFu"` + FieldA [][]byte `json:"fieldA"` + FieldB []string `json:"fieldB"` + FieldC []int32 `json:"fieldC"` + FieldD []uint32 `json:"fieldD"` + FieldE []int64 `json:"fieldE"` + FieldF []uint64 `json:"fieldF"` + FieldFu []uint64 `json:"fieldFu"` + FieldAux []*RepPrimitives_Aux `json:"fieldAux"` } var ( @@ -840,6 +970,9 @@ func (x *RepPrimitives) StableSize() (size int) { for i := range x.FieldFu { size += protowire.SizeGroup(protowire.Number(7), protowire.SizeVarint(x.FieldFu[i])) } + for i := range x.FieldAux { + size += proto.NestedStructureSize(8, x.FieldAux[i]) + } return size } @@ -877,6 +1010,11 @@ func (x *RepPrimitives) EmitProtobuf(mm *easyproto.MessageMarshaler) { for j := range x.FieldFu { mm.AppendUint64(7, x.FieldFu[j]) } + for i := range x.FieldAux { + if x.FieldAux[i] != nil { + x.FieldAux[i].EmitProtobuf(mm.AppendMessage(8)) + } + } } // UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. @@ -930,6 +1068,16 @@ func (x *RepPrimitives) UnmarshalProtobuf(src []byte) (err error) { return fmt.Errorf("cannot unmarshal field %s", "FieldFu") } x.FieldFu = append(x.FieldFu, data) + case 8: // FieldAux + data, ok := fc.MessageData() + if !ok { + return fmt.Errorf("cannot unmarshal field %s", "FieldAux") + } + x.FieldAux = append(x.FieldAux, new(RepPrimitives_Aux)) + ff := x.FieldAux[len(x.FieldAux)-1] + if err := ff.UnmarshalProtobuf(data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } } } return nil @@ -997,6 +1145,15 @@ func (x *RepPrimitives) GetFieldFu() []uint64 { func (x *RepPrimitives) SetFieldFu(v []uint64) { x.FieldFu = v } +func (x *RepPrimitives) GetFieldAux() []*RepPrimitives_Aux { + if x != nil { + return x.FieldAux + } + return nil +} +func (x *RepPrimitives) SetFieldAux(v []*RepPrimitives_Aux) { + x.FieldAux = v +} // MarshalJSON implements the json.Marshaler interface. func (x *RepPrimitives) MarshalJSON() ([]byte, error) { @@ -1094,6 +1251,18 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) { } out.RawByte(']') } + { + const prefix string = ",\"fieldAux\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldAux { + if i != 0 { + out.RawByte(',') + } + x.FieldAux[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } out.RawByte('}') } @@ -1213,6 +1382,20 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) { x.FieldFu = list in.Delim(']') } + case "fieldAux": + { + var f *RepPrimitives_Aux + var list []*RepPrimitives_Aux + in.Delim('[') + for !in.IsDelim(']') { + f = new(RepPrimitives_Aux) + f.UnmarshalEasyJSON(in) + list = append(list, f) + in.WantComma() + } + x.FieldAux = list + in.Delim(']') + } } in.WantComma() } diff --git a/util/proto/test/test.pb.go b/util/proto/test/test.pb.go index de8ec65..e7d5699 100644 --- a/util/proto/test/test.pb.go +++ b/util/proto/test/test.pb.go @@ -257,13 +257,14 @@ type RepPrimitives struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FieldA [][]byte `protobuf:"bytes,1,rep,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"` - FieldB []string `protobuf:"bytes,2,rep,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"` - FieldC []int32 `protobuf:"varint,3,rep,packed,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"` - FieldD []uint32 `protobuf:"varint,4,rep,packed,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"` - FieldE []int64 `protobuf:"varint,5,rep,packed,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"` - FieldF []uint64 `protobuf:"varint,6,rep,packed,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"` - FieldFu []uint64 `protobuf:"varint,7,rep,name=field_fu,json=fieldFu,proto3" json:"field_fu,omitempty"` + FieldA [][]byte `protobuf:"bytes,1,rep,name=field_a,json=fieldA,proto3" json:"field_a,omitempty"` + FieldB []string `protobuf:"bytes,2,rep,name=field_b,json=fieldB,proto3" json:"field_b,omitempty"` + FieldC []int32 `protobuf:"varint,3,rep,packed,name=field_c,json=fieldC,proto3" json:"field_c,omitempty"` + FieldD []uint32 `protobuf:"varint,4,rep,packed,name=field_d,json=fieldD,proto3" json:"field_d,omitempty"` + FieldE []int64 `protobuf:"varint,5,rep,packed,name=field_e,json=fieldE,proto3" json:"field_e,omitempty"` + FieldF []uint64 `protobuf:"varint,6,rep,packed,name=field_f,json=fieldF,proto3" json:"field_f,omitempty"` + FieldFu []uint64 `protobuf:"varint,7,rep,name=field_fu,json=fieldFu,proto3" json:"field_fu,omitempty"` + FieldAux []*RepPrimitives_Aux `protobuf:"bytes,8,rep,name=field_aux,json=fieldAux,proto3" json:"field_aux,omitempty"` } func (x *RepPrimitives) Reset() { @@ -347,6 +348,13 @@ func (x *RepPrimitives) GetFieldFu() []uint64 { return nil } +func (x *RepPrimitives) GetFieldAux() []*RepPrimitives_Aux { + if x != nil { + return x.FieldAux + } + return nil +} + type Primitives_Aux struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -394,6 +402,53 @@ func (x *Primitives_Aux) GetInnerField() uint32 { return 0 } +type RepPrimitives_Aux struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InnerField uint32 `protobuf:"varint,1,opt,name=inner_field,json=innerField,proto3" json:"inner_field,omitempty"` +} + +func (x *RepPrimitives_Aux) Reset() { + *x = RepPrimitives_Aux{} + if protoimpl.UnsafeEnabled { + mi := &file_util_proto_test_test_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RepPrimitives_Aux) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepPrimitives_Aux) ProtoMessage() {} + +func (x *RepPrimitives_Aux) ProtoReflect() protoreflect.Message { + mi := &file_util_proto_test_test_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RepPrimitives_Aux.ProtoReflect.Descriptor instead. +func (*RepPrimitives_Aux) Descriptor() ([]byte, []int) { + return file_util_proto_test_test_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *RepPrimitives_Aux) GetInnerField() uint32 { + if x != nil { + return x.InnerField + } + return 0 +} + var File_util_proto_test_test_proto protoreflect.FileDescriptor var file_util_proto_test_test_proto_rawDesc = []byte{ @@ -433,7 +488,7 @@ var file_util_proto_test_test_proto_rawDesc = []byte{ 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x08, 0x4e, 0x45, 0x47, 0x41, 0x54, 0x49, 0x56, 0x45, 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, - 0x42, 0x09, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x22, 0xc4, 0x01, 0x0a, 0x0d, + 0x42, 0x09, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x22, 0xa2, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, @@ -446,8 +501,14 @@ var file_util_proto_test_test_proto_rawDesc = []byte{ 0x65, 0x6c, 0x64, 0x5f, 0x66, 0x18, 0x06, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x46, 0x12, 0x1d, 0x0a, 0x08, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x66, 0x75, 0x18, 0x07, 0x20, 0x03, 0x28, 0x04, 0x42, 0x02, 0x10, 0x00, 0x52, 0x07, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x46, 0x75, 0x42, 0x11, 0x5a, 0x0f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x46, 0x75, 0x12, 0x34, 0x0a, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x61, 0x75, 0x78, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x70, + 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x41, 0x75, 0x78, 0x52, 0x08, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x75, 0x78, 0x1a, 0x26, 0x0a, 0x03, 0x41, 0x75, 0x78, 0x12, + 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x42, 0x11, 0x5a, 0x0f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, + 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -463,21 +524,23 @@ func file_util_proto_test_test_proto_rawDescGZIP() []byte { } var file_util_proto_test_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_util_proto_test_test_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_util_proto_test_test_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_util_proto_test_test_proto_goTypes = []interface{}{ - (Primitives_SomeEnum)(0), // 0: test.Primitives.SomeEnum - (*Primitives)(nil), // 1: test.Primitives - (*RepPrimitives)(nil), // 2: test.RepPrimitives - (*Primitives_Aux)(nil), // 3: test.Primitives.Aux + (Primitives_SomeEnum)(0), // 0: test.Primitives.SomeEnum + (*Primitives)(nil), // 1: test.Primitives + (*RepPrimitives)(nil), // 2: test.RepPrimitives + (*Primitives_Aux)(nil), // 3: test.Primitives.Aux + (*RepPrimitives_Aux)(nil), // 4: test.RepPrimitives.Aux } var file_util_proto_test_test_proto_depIdxs = []int32{ 0, // 0: test.Primitives.field_h:type_name -> test.Primitives.SomeEnum 3, // 1: test.Primitives.field_aux:type_name -> test.Primitives.Aux - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 4, // 2: test.RepPrimitives.field_aux:type_name -> test.RepPrimitives.Aux + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_util_proto_test_test_proto_init() } @@ -522,6 +585,18 @@ func file_util_proto_test_test_proto_init() { return nil } } + file_util_proto_test_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RepPrimitives_Aux); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_util_proto_test_test_proto_msgTypes[0].OneofWrappers = []interface{}{ (*Primitives_FieldMa)(nil), @@ -534,7 +609,7 @@ func file_util_proto_test_test_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_util_proto_test_test_proto_rawDesc, NumEnums: 1, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/util/proto/test/test.proto b/util/proto/test/test.proto index f33be49..58cee2f 100644 --- a/util/proto/test/test.proto +++ b/util/proto/test/test.proto @@ -40,4 +40,7 @@ message RepPrimitives { repeated int64 field_e = 5; repeated uint64 field_f = 6; repeated uint64 field_fu = 7 [ packed = false ]; + + message Aux { uint32 inner_field = 1; } + repeated Aux field_aux = 8; } From 5e1c6a908f61d357acd71c1b0a1320f962ea5827 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 27 Aug 2024 15:12:31 +0300 Subject: [PATCH 146/169] [#111] protogen: Emit slice of messages without a pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` goos: linux goarch: amd64 pkg: git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz │ old │ new │ │ sec/op │ sec/op vs base │ ObjectIDSlice/0_elements/to_grpc_message-8 3.193n ± 2% 3.242n ± 0% +1.50% (p=0.034 n=10) ObjectIDSlice/0_elements/from_grpc_message-8 3.197n ± 2% 3.343n ± 1% +4.57% (p=0.000 n=10) ObjectIDSlice/0_elements/marshal-8 5.666n ± 3% 5.642n ± 0% -0.42% (p=0.000 n=10) ObjectIDSlice/1_elements/to_grpc_message-8 53.10n ± 6% 29.78n ± 12% -43.92% (p=0.000 n=10) ObjectIDSlice/1_elements/from_grpc_message-8 28.99n ± 5% 29.77n ± 7% ~ (p=0.165 n=10) ObjectIDSlice/1_elements/marshal-8 49.08n ± 7% 50.72n ± 6% ~ (p=0.218 n=10) ObjectIDSlice/50_elements/to_grpc_message-8 1652.5n ± 7% 277.2n ± 1% -83.22% (p=0.000 n=10) ObjectIDSlice/50_elements/from_grpc_message-8 261.2n ± 11% 226.7n ± 15% -13.19% (p=0.003 n=10) ObjectIDSlice/50_elements/marshal-8 1.512µ ± 6% 1.514µ ± 6% ~ (p=0.955 n=10) geomean 52.15n 39.99n -23.31% │ old │ new │ │ B/op │ B/op vs base │ ObjectIDSlice/0_elements/to_grpc_message-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/0_elements/from_grpc_message-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/0_elements/marshal-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/1_elements/to_grpc_message-8 32.00 ± 0% 24.00 ± 0% -25.00% (p=0.000 n=10) ObjectIDSlice/1_elements/from_grpc_message-8 24.00 ± 0% 24.00 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/1_elements/marshal-8 48.00 ± 0% 48.00 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/50_elements/to_grpc_message-8 1.578Ki ± 0% 1.250Ki ± 0% -20.79% (p=0.000 n=10) ObjectIDSlice/50_elements/from_grpc_message-8 1.250Ki ± 0% 1.250Ki ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/50_elements/marshal-8 2.000Ki ± 0% 2.000Ki ± 0% ~ (p=1.000 n=10) ¹ geomean ² -5.62% ² ¹ all samples are equal ² summaries must be >0 to compute geomean │ old │ new │ │ allocs/op │ allocs/op vs base │ ObjectIDSlice/0_elements/to_grpc_message-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/0_elements/from_grpc_message-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/0_elements/marshal-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/1_elements/to_grpc_message-8 2.000 ± 0% 1.000 ± 0% -50.00% (p=0.000 n=10) ObjectIDSlice/1_elements/from_grpc_message-8 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/1_elements/marshal-8 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/50_elements/to_grpc_message-8 51.000 ± 0% 1.000 ± 0% -98.04% (p=0.000 n=10) ObjectIDSlice/50_elements/from_grpc_message-8 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹ ObjectIDSlice/50_elements/marshal-8 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹ geomean ² -40.18% ² ¹ all samples are equal ² summaries must be >0 to compute geomean ``` Signed-off-by: Evgenii Stratonikov --- acl/convert.go | 54 +++--- acl/grpc/types_frostfs.pb.go | 92 +++++----- apemanager/convert.go | 6 +- apemanager/grpc/service_frostfs.pb.go | 22 ++- container/convert.go | 16 +- container/grpc/service_frostfs.pb.go | 22 ++- container/grpc/types_frostfs.pb.go | 22 ++- lock/grpc/types_frostfs.pb.go | 22 ++- netmap/convert.go | 82 ++++----- netmap/grpc/types_frostfs.pb.go | 166 ++++++++---------- object/convert.go | 54 +++--- object/grpc/service_frostfs.pb.go | 92 +++++----- object/grpc/types_frostfs.pb.go | 112 ++++++------ object/lock.go | 8 +- refs/convert.go | 32 ++-- session/convert.go | 16 +- session/grpc/types_frostfs.pb.go | 66 ++++--- status/convert.go | 12 +- status/grpc/types_frostfs.pb.go | 26 ++- tombstone/grpc/types_frostfs.pb.go | 26 ++- util/proto/marshal_test.go | 6 +- util/proto/test/custom/test_frostfs.pb.go | 36 ++-- util/protogen/internalgengo/json.go | 2 +- util/protogen/internalgengo/proto.go | 9 +- .../internalgengo/proto_field_type.go | 5 +- .../internalgengo/proto_stable_compat.go | 2 +- 26 files changed, 461 insertions(+), 547 deletions(-) diff --git a/acl/convert.go b/acl/convert.go index c5768ad..f5de743 100644 --- a/acl/convert.go +++ b/acl/convert.go @@ -187,28 +187,26 @@ 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 { - if fs[i] != nil { - err = res[i].FromGRPCMessage(fs[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&fs[i]) + if err != nil { + return } } } @@ -241,28 +239,26 @@ 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 { - if fs[i] != nil { - err = res[i].FromGRPCMessage(fs[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&fs[i]) + if err != nil { + return } } } @@ -309,28 +305,26 @@ 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 { - if fs[i] != nil { - err = res[i].FromGRPCMessage(fs[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&fs[i]) + if err != nil { + return } } } @@ -429,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) } @@ -459,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 } } diff --git a/acl/grpc/types_frostfs.pb.go b/acl/grpc/types_frostfs.pb.go index 931f3b3..2b116bd 100644 --- a/acl/grpc/types_frostfs.pb.go +++ b/acl/grpc/types_frostfs.pb.go @@ -657,10 +657,10 @@ func (x *EACLRecord_Target) UnmarshalEasyJSON(in *jlexer.Lexer) { } type EACLRecord struct { - Operation Operation `json:"operation"` - Action Action `json:"action"` - Filters []*EACLRecord_Filter `json:"filters"` - Targets []*EACLRecord_Target `json:"targets"` + Operation Operation `json:"operation"` + Action Action `json:"action"` + Filters []EACLRecord_Filter `json:"filters"` + Targets []EACLRecord_Target `json:"targets"` } var ( @@ -680,10 +680,10 @@ func (x *EACLRecord) StableSize() (size int) { size += proto.EnumSize(1, int32(x.Operation)) size += proto.EnumSize(2, int32(x.Action)) for i := range x.Filters { - size += proto.NestedStructureSize(3, x.Filters[i]) + size += proto.NestedStructureSizeUnchecked(3, &x.Filters[i]) } for i := range x.Targets { - size += proto.NestedStructureSize(4, x.Targets[i]) + size += proto.NestedStructureSizeUnchecked(4, &x.Targets[i]) } return size } @@ -708,14 +708,10 @@ func (x *EACLRecord) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendInt32(2, int32(x.Action)) } for i := range x.Filters { - if x.Filters[i] != nil { - x.Filters[i].EmitProtobuf(mm.AppendMessage(3)) - } + x.Filters[i].EmitProtobuf(mm.AppendMessage(3)) } for i := range x.Targets { - if x.Targets[i] != nil { - x.Targets[i].EmitProtobuf(mm.AppendMessage(4)) - } + x.Targets[i].EmitProtobuf(mm.AppendMessage(4)) } } @@ -745,8 +741,8 @@ func (x *EACLRecord) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Filters") } - x.Filters = append(x.Filters, new(EACLRecord_Filter)) - ff := x.Filters[len(x.Filters)-1] + x.Filters = append(x.Filters, EACLRecord_Filter{}) + ff := &x.Filters[len(x.Filters)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -755,8 +751,8 @@ func (x *EACLRecord) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Targets") } - x.Targets = append(x.Targets, new(EACLRecord_Target)) - ff := x.Targets[len(x.Targets)-1] + x.Targets = append(x.Targets, EACLRecord_Target{}) + ff := &x.Targets[len(x.Targets)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -782,22 +778,22 @@ func (x *EACLRecord) GetAction() Action { func (x *EACLRecord) SetAction(v Action) { x.Action = v } -func (x *EACLRecord) GetFilters() []*EACLRecord_Filter { +func (x *EACLRecord) GetFilters() []EACLRecord_Filter { if x != nil { return x.Filters } return nil } -func (x *EACLRecord) SetFilters(v []*EACLRecord_Filter) { +func (x *EACLRecord) SetFilters(v []EACLRecord_Filter) { x.Filters = v } -func (x *EACLRecord) GetTargets() []*EACLRecord_Target { +func (x *EACLRecord) GetTargets() []EACLRecord_Target { if x != nil { return x.Targets } return nil } -func (x *EACLRecord) SetTargets(v []*EACLRecord_Target) { +func (x *EACLRecord) SetTargets(v []EACLRecord_Target) { x.Targets = v } @@ -921,11 +917,11 @@ func (x *EACLRecord) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "filters": { - var f *EACLRecord_Filter - var list []*EACLRecord_Filter + var f EACLRecord_Filter + var list []EACLRecord_Filter in.Delim('[') for !in.IsDelim(']') { - f = new(EACLRecord_Filter) + f = EACLRecord_Filter{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -935,11 +931,11 @@ func (x *EACLRecord) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "targets": { - var f *EACLRecord_Target - var list []*EACLRecord_Target + var f EACLRecord_Target + var list []EACLRecord_Target in.Delim('[') for !in.IsDelim(']') { - f = new(EACLRecord_Target) + f = EACLRecord_Target{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -959,7 +955,7 @@ func (x *EACLRecord) UnmarshalEasyJSON(in *jlexer.Lexer) { type EACLTable struct { Version *grpc.Version `json:"version"` ContainerId *grpc.ContainerID `json:"containerID"` - Records []*EACLRecord `json:"records"` + Records []EACLRecord `json:"records"` } var ( @@ -979,7 +975,7 @@ func (x *EACLTable) StableSize() (size int) { size += proto.NestedStructureSize(1, x.Version) size += proto.NestedStructureSize(2, x.ContainerId) for i := range x.Records { - size += proto.NestedStructureSize(3, x.Records[i]) + size += proto.NestedStructureSizeUnchecked(3, &x.Records[i]) } return size } @@ -1004,9 +1000,7 @@ func (x *EACLTable) EmitProtobuf(mm *easyproto.MessageMarshaler) { x.ContainerId.EmitProtobuf(mm.AppendMessage(2)) } for i := range x.Records { - if x.Records[i] != nil { - x.Records[i].EmitProtobuf(mm.AppendMessage(3)) - } + x.Records[i].EmitProtobuf(mm.AppendMessage(3)) } } @@ -1042,8 +1036,8 @@ func (x *EACLTable) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Records") } - x.Records = append(x.Records, new(EACLRecord)) - ff := x.Records[len(x.Records)-1] + x.Records = append(x.Records, EACLRecord{}) + ff := &x.Records[len(x.Records)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1069,13 +1063,13 @@ func (x *EACLTable) GetContainerId() *grpc.ContainerID { func (x *EACLTable) SetContainerId(v *grpc.ContainerID) { x.ContainerId = v } -func (x *EACLTable) GetRecords() []*EACLRecord { +func (x *EACLTable) GetRecords() []EACLRecord { if x != nil { return x.Records } return nil } -func (x *EACLTable) SetRecords(v []*EACLRecord) { +func (x *EACLTable) SetRecords(v []EACLRecord) { x.Records = v } @@ -1157,11 +1151,11 @@ func (x *EACLTable) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "records": { - var f *EACLRecord - var list []*EACLRecord + var f EACLRecord + var list []EACLRecord in.Delim('[') for !in.IsDelim(']') { - f = new(EACLRecord) + f = EACLRecord{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -1371,7 +1365,7 @@ func (x *BearerToken_Body_TokenLifetime) UnmarshalEasyJSON(in *jlexer.Lexer) { type BearerToken_Body_APEOverride struct { Target *grpc1.ChainTarget `json:"target"` - Chains []*grpc1.Chain `json:"chains"` + Chains []grpc1.Chain `json:"chains"` } var ( @@ -1390,7 +1384,7 @@ func (x *BearerToken_Body_APEOverride) StableSize() (size int) { } size += proto.NestedStructureSize(1, x.Target) for i := range x.Chains { - size += proto.NestedStructureSize(2, x.Chains[i]) + size += proto.NestedStructureSizeUnchecked(2, &x.Chains[i]) } return size } @@ -1412,9 +1406,7 @@ func (x *BearerToken_Body_APEOverride) EmitProtobuf(mm *easyproto.MessageMarshal x.Target.EmitProtobuf(mm.AppendMessage(1)) } for i := range x.Chains { - if x.Chains[i] != nil { - x.Chains[i].EmitProtobuf(mm.AppendMessage(2)) - } + x.Chains[i].EmitProtobuf(mm.AppendMessage(2)) } } @@ -1441,8 +1433,8 @@ func (x *BearerToken_Body_APEOverride) UnmarshalProtobuf(src []byte) (err error) if !ok { return fmt.Errorf("cannot unmarshal field %s", "Chains") } - x.Chains = append(x.Chains, new(grpc1.Chain)) - ff := x.Chains[len(x.Chains)-1] + x.Chains = append(x.Chains, grpc1.Chain{}) + ff := &x.Chains[len(x.Chains)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1459,13 +1451,13 @@ func (x *BearerToken_Body_APEOverride) GetTarget() *grpc1.ChainTarget { func (x *BearerToken_Body_APEOverride) SetTarget(v *grpc1.ChainTarget) { x.Target = v } -func (x *BearerToken_Body_APEOverride) GetChains() []*grpc1.Chain { +func (x *BearerToken_Body_APEOverride) GetChains() []grpc1.Chain { if x != nil { return x.Chains } return nil } -func (x *BearerToken_Body_APEOverride) SetChains(v []*grpc1.Chain) { +func (x *BearerToken_Body_APEOverride) SetChains(v []grpc1.Chain) { x.Chains = v } @@ -1535,11 +1527,11 @@ func (x *BearerToken_Body_APEOverride) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "chains": { - var f *grpc1.Chain - var list []*grpc1.Chain + var f grpc1.Chain + var list []grpc1.Chain in.Delim('[') for !in.IsDelim(']') { - f = new(grpc1.Chain) + f = grpc1.Chain{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/apemanager/convert.go b/apemanager/convert.go index fdc5132..5677b25 100644 --- a/apemanager/convert.go +++ b/apemanager/convert.go @@ -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) diff --git a/apemanager/grpc/service_frostfs.pb.go b/apemanager/grpc/service_frostfs.pb.go index c1d28ed..99abeb2 100644 --- a/apemanager/grpc/service_frostfs.pb.go +++ b/apemanager/grpc/service_frostfs.pb.go @@ -1810,7 +1810,7 @@ func (x *ListChainsRequest) UnmarshalEasyJSON(in *jlexer.Lexer) { } type ListChainsResponse_Body struct { - Chains []*grpc.Chain `json:"chains"` + Chains []grpc.Chain `json:"chains"` } var ( @@ -1828,7 +1828,7 @@ func (x *ListChainsResponse_Body) StableSize() (size int) { return 0 } for i := range x.Chains { - size += proto.NestedStructureSize(1, x.Chains[i]) + size += proto.NestedStructureSizeUnchecked(1, &x.Chains[i]) } return size } @@ -1847,9 +1847,7 @@ func (x *ListChainsResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.Chains { - if x.Chains[i] != nil { - x.Chains[i].EmitProtobuf(mm.AppendMessage(1)) - } + x.Chains[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -1867,8 +1865,8 @@ func (x *ListChainsResponse_Body) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Chains") } - x.Chains = append(x.Chains, new(grpc.Chain)) - ff := x.Chains[len(x.Chains)-1] + x.Chains = append(x.Chains, grpc.Chain{}) + ff := &x.Chains[len(x.Chains)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1876,13 +1874,13 @@ func (x *ListChainsResponse_Body) UnmarshalProtobuf(src []byte) (err error) { } return nil } -func (x *ListChainsResponse_Body) GetChains() []*grpc.Chain { +func (x *ListChainsResponse_Body) GetChains() []grpc.Chain { if x != nil { return x.Chains } return nil } -func (x *ListChainsResponse_Body) SetChains(v []*grpc.Chain) { +func (x *ListChainsResponse_Body) SetChains(v []grpc.Chain) { x.Chains = v } @@ -1940,11 +1938,11 @@ func (x *ListChainsResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { switch key { case "chains": { - var f *grpc.Chain - var list []*grpc.Chain + var f grpc.Chain + var list []grpc.Chain in.Delim('[') for !in.IsDelim(']') { - f = new(grpc.Chain) + f = grpc.Chain{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/container/convert.go b/container/convert.go index c5f9cd7..b487f40 100644 --- a/container/convert.go +++ b/container/convert.go @@ -39,28 +39,26 @@ 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 { - if xs[i] != nil { - err = res[i].FromGRPCMessage(xs[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&xs[i]) + if err != nil { + return } } } diff --git a/container/grpc/service_frostfs.pb.go b/container/grpc/service_frostfs.pb.go index 514f03b..f38b0de 100644 --- a/container/grpc/service_frostfs.pb.go +++ b/container/grpc/service_frostfs.pb.go @@ -2597,7 +2597,7 @@ func (x *ListRequest) UnmarshalEasyJSON(in *jlexer.Lexer) { } type ListResponse_Body struct { - ContainerIds []*grpc.ContainerID `json:"containerIds"` + ContainerIds []grpc.ContainerID `json:"containerIds"` } var ( @@ -2615,7 +2615,7 @@ func (x *ListResponse_Body) StableSize() (size int) { return 0 } for i := range x.ContainerIds { - size += proto.NestedStructureSize(1, x.ContainerIds[i]) + size += proto.NestedStructureSizeUnchecked(1, &x.ContainerIds[i]) } return size } @@ -2634,9 +2634,7 @@ func (x *ListResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.ContainerIds { - if x.ContainerIds[i] != nil { - x.ContainerIds[i].EmitProtobuf(mm.AppendMessage(1)) - } + x.ContainerIds[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -2654,8 +2652,8 @@ func (x *ListResponse_Body) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "ContainerIds") } - x.ContainerIds = append(x.ContainerIds, new(grpc.ContainerID)) - ff := x.ContainerIds[len(x.ContainerIds)-1] + x.ContainerIds = append(x.ContainerIds, grpc.ContainerID{}) + ff := &x.ContainerIds[len(x.ContainerIds)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -2663,13 +2661,13 @@ func (x *ListResponse_Body) UnmarshalProtobuf(src []byte) (err error) { } return nil } -func (x *ListResponse_Body) GetContainerIds() []*grpc.ContainerID { +func (x *ListResponse_Body) GetContainerIds() []grpc.ContainerID { if x != nil { return x.ContainerIds } return nil } -func (x *ListResponse_Body) SetContainerIds(v []*grpc.ContainerID) { +func (x *ListResponse_Body) SetContainerIds(v []grpc.ContainerID) { x.ContainerIds = v } @@ -2727,11 +2725,11 @@ func (x *ListResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { switch key { case "containerIds": { - var f *grpc.ContainerID - var list []*grpc.ContainerID + var f grpc.ContainerID + var list []grpc.ContainerID in.Delim('[') for !in.IsDelim(']') { - f = new(grpc.ContainerID) + f = grpc.ContainerID{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/container/grpc/types_frostfs.pb.go b/container/grpc/types_frostfs.pb.go index dcb9cf4..3010eb0 100644 --- a/container/grpc/types_frostfs.pb.go +++ b/container/grpc/types_frostfs.pb.go @@ -180,7 +180,7 @@ type Container struct { OwnerId *grpc.OwnerID `json:"ownerID"` Nonce []byte `json:"nonce"` BasicAcl uint32 `json:"basicACL"` - Attributes []*Container_Attribute `json:"attributes"` + Attributes []Container_Attribute `json:"attributes"` PlacementPolicy *grpc1.PlacementPolicy `json:"placementPolicy"` } @@ -203,7 +203,7 @@ func (x *Container) StableSize() (size int) { size += proto.BytesSize(3, x.Nonce) size += proto.UInt32Size(4, x.BasicAcl) for i := range x.Attributes { - size += proto.NestedStructureSize(5, x.Attributes[i]) + size += proto.NestedStructureSizeUnchecked(5, &x.Attributes[i]) } size += proto.NestedStructureSize(6, x.PlacementPolicy) return size @@ -235,9 +235,7 @@ func (x *Container) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint32(4, x.BasicAcl) } for i := range x.Attributes { - if x.Attributes[i] != nil { - x.Attributes[i].EmitProtobuf(mm.AppendMessage(5)) - } + x.Attributes[i].EmitProtobuf(mm.AppendMessage(5)) } if x.PlacementPolicy != nil { x.PlacementPolicy.EmitProtobuf(mm.AppendMessage(6)) @@ -288,8 +286,8 @@ func (x *Container) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Attributes") } - x.Attributes = append(x.Attributes, new(Container_Attribute)) - ff := x.Attributes[len(x.Attributes)-1] + 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) } @@ -342,13 +340,13 @@ func (x *Container) GetBasicAcl() uint32 { func (x *Container) SetBasicAcl(v uint32) { x.BasicAcl = v } -func (x *Container) GetAttributes() []*Container_Attribute { +func (x *Container) GetAttributes() []Container_Attribute { if x != nil { return x.Attributes } return nil } -func (x *Container) SetAttributes(v []*Container_Attribute) { +func (x *Container) SetAttributes(v []Container_Attribute) { x.Attributes = v } func (x *Container) GetPlacementPolicy() *grpc1.PlacementPolicy { @@ -466,11 +464,11 @@ func (x *Container) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "attributes": { - var f *Container_Attribute - var list []*Container_Attribute + var f Container_Attribute + var list []Container_Attribute in.Delim('[') for !in.IsDelim(']') { - f = new(Container_Attribute) + f = Container_Attribute{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/lock/grpc/types_frostfs.pb.go b/lock/grpc/types_frostfs.pb.go index 52a1a2d..58be895 100644 --- a/lock/grpc/types_frostfs.pb.go +++ b/lock/grpc/types_frostfs.pb.go @@ -15,7 +15,7 @@ import ( ) type Lock struct { - Members []*grpc.ObjectID `json:"members"` + Members []grpc.ObjectID `json:"members"` } var ( @@ -33,7 +33,7 @@ func (x *Lock) StableSize() (size int) { return 0 } for i := range x.Members { - size += proto.NestedStructureSize(1, x.Members[i]) + size += proto.NestedStructureSizeUnchecked(1, &x.Members[i]) } return size } @@ -52,9 +52,7 @@ func (x *Lock) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.Members { - if x.Members[i] != nil { - x.Members[i].EmitProtobuf(mm.AppendMessage(1)) - } + x.Members[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -72,8 +70,8 @@ func (x *Lock) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Members") } - x.Members = append(x.Members, new(grpc.ObjectID)) - ff := x.Members[len(x.Members)-1] + 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) } @@ -81,13 +79,13 @@ func (x *Lock) UnmarshalProtobuf(src []byte) (err error) { } return nil } -func (x *Lock) GetMembers() []*grpc.ObjectID { +func (x *Lock) GetMembers() []grpc.ObjectID { if x != nil { return x.Members } return nil } -func (x *Lock) SetMembers(v []*grpc.ObjectID) { +func (x *Lock) SetMembers(v []grpc.ObjectID) { x.Members = v } @@ -145,11 +143,11 @@ func (x *Lock) UnmarshalEasyJSON(in *jlexer.Lexer) { switch key { case "members": { - var f *grpc.ObjectID - var list []*grpc.ObjectID + var f grpc.ObjectID + var list []grpc.ObjectID in.Delim('[') for !in.IsDelim(']') { - f = new(grpc.ObjectID) + f = grpc.ObjectID{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/netmap/convert.go b/netmap/convert.go index fad7380..659b798 100644 --- a/netmap/convert.go +++ b/netmap/convert.go @@ -45,28 +45,26 @@ 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 { - if fs[i] != nil { - err = res[i].FromGRPCMessage(fs[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&fs[i]) + if err != nil { + return } } } @@ -105,28 +103,26 @@ 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 { - if ss[i] != nil { - err = res[i].FromGRPCMessage(ss[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&ss[i]) + if err != nil { + return } } } @@ -163,28 +159,26 @@ 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 { - if rs[i] != nil { - err = res[i].FromGRPCMessage(rs[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&rs[i]) + if err != nil { + return } } } @@ -289,28 +283,26 @@ 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 { - if as[i] != nil { - err = res[i].FromGRPCMessage(as[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&as[i]) + if err != nil { + return } } } @@ -528,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 := 0; i < ln; i++ { - ps = append(ps, x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter)) + ps = append(ps, *x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter)) } } @@ -561,10 +553,8 @@ func (x *NetworkConfig) FromGRPCMessage(m grpc.Message) error { ps = make([]NetworkParameter, ln) for i := 0; i < ln; i++ { - if psV2[i] != nil { - if err := ps[i].FromGRPCMessage(psV2[i]); err != nil { - return err - } + if err := ps[i].FromGRPCMessage(&psV2[i]); err != nil { + return err } } } @@ -756,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) @@ -784,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 } diff --git a/netmap/grpc/types_frostfs.pb.go b/netmap/grpc/types_frostfs.pb.go index 6ecf0fa..e7597ea 100644 --- a/netmap/grpc/types_frostfs.pb.go +++ b/netmap/grpc/types_frostfs.pb.go @@ -113,7 +113,7 @@ type Filter struct { Key string `json:"key"` Op Operation `json:"op"` Value string `json:"value"` - Filters []*Filter `json:"filters"` + Filters []Filter `json:"filters"` } var ( @@ -135,7 +135,7 @@ func (x *Filter) StableSize() (size int) { size += proto.EnumSize(3, int32(x.Op)) size += proto.StringSize(4, x.Value) for i := range x.Filters { - size += proto.NestedStructureSize(5, x.Filters[i]) + size += proto.NestedStructureSizeUnchecked(5, &x.Filters[i]) } return size } @@ -166,9 +166,7 @@ func (x *Filter) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendString(4, x.Value) } for i := range x.Filters { - if x.Filters[i] != nil { - x.Filters[i].EmitProtobuf(mm.AppendMessage(5)) - } + x.Filters[i].EmitProtobuf(mm.AppendMessage(5)) } } @@ -210,8 +208,8 @@ func (x *Filter) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Filters") } - x.Filters = append(x.Filters, new(Filter)) - ff := x.Filters[len(x.Filters)-1] + x.Filters = append(x.Filters, Filter{}) + ff := &x.Filters[len(x.Filters)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -255,13 +253,13 @@ func (x *Filter) GetValue() string { func (x *Filter) SetValue(v string) { x.Value = v } -func (x *Filter) GetFilters() []*Filter { +func (x *Filter) GetFilters() []Filter { if x != nil { return x.Filters } return nil } -func (x *Filter) SetFilters(v []*Filter) { +func (x *Filter) SetFilters(v []Filter) { x.Filters = v } @@ -379,11 +377,11 @@ func (x *Filter) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "filters": { - var f *Filter - var list []*Filter + var f Filter + var list []Filter in.Delim('[') for !in.IsDelim(']') { - f = new(Filter) + f = Filter{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -892,11 +890,11 @@ func (x *Replica) UnmarshalEasyJSON(in *jlexer.Lexer) { } type PlacementPolicy struct { - Replicas []*Replica `json:"replicas"` - ContainerBackupFactor uint32 `json:"containerBackupFactor"` - Selectors []*Selector `json:"selectors"` - Filters []*Filter `json:"filters"` - Unique bool `json:"unique"` + Replicas []Replica `json:"replicas"` + ContainerBackupFactor uint32 `json:"containerBackupFactor"` + Selectors []Selector `json:"selectors"` + Filters []Filter `json:"filters"` + Unique bool `json:"unique"` } var ( @@ -914,14 +912,14 @@ func (x *PlacementPolicy) StableSize() (size int) { return 0 } for i := range x.Replicas { - size += proto.NestedStructureSize(1, x.Replicas[i]) + size += proto.NestedStructureSizeUnchecked(1, &x.Replicas[i]) } size += proto.UInt32Size(2, x.ContainerBackupFactor) for i := range x.Selectors { - size += proto.NestedStructureSize(3, x.Selectors[i]) + size += proto.NestedStructureSizeUnchecked(3, &x.Selectors[i]) } for i := range x.Filters { - size += proto.NestedStructureSize(4, x.Filters[i]) + size += proto.NestedStructureSizeUnchecked(4, &x.Filters[i]) } size += proto.BoolSize(5, x.Unique) return size @@ -941,22 +939,16 @@ func (x *PlacementPolicy) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.Replicas { - if x.Replicas[i] != nil { - x.Replicas[i].EmitProtobuf(mm.AppendMessage(1)) - } + x.Replicas[i].EmitProtobuf(mm.AppendMessage(1)) } if x.ContainerBackupFactor != 0 { mm.AppendUint32(2, x.ContainerBackupFactor) } for i := range x.Selectors { - if x.Selectors[i] != nil { - x.Selectors[i].EmitProtobuf(mm.AppendMessage(3)) - } + x.Selectors[i].EmitProtobuf(mm.AppendMessage(3)) } for i := range x.Filters { - if x.Filters[i] != nil { - x.Filters[i].EmitProtobuf(mm.AppendMessage(4)) - } + x.Filters[i].EmitProtobuf(mm.AppendMessage(4)) } if x.Unique { mm.AppendBool(5, x.Unique) @@ -977,8 +969,8 @@ func (x *PlacementPolicy) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Replicas") } - x.Replicas = append(x.Replicas, new(Replica)) - ff := x.Replicas[len(x.Replicas)-1] + x.Replicas = append(x.Replicas, Replica{}) + ff := &x.Replicas[len(x.Replicas)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -993,8 +985,8 @@ func (x *PlacementPolicy) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Selectors") } - x.Selectors = append(x.Selectors, new(Selector)) - ff := x.Selectors[len(x.Selectors)-1] + x.Selectors = append(x.Selectors, Selector{}) + ff := &x.Selectors[len(x.Selectors)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1003,8 +995,8 @@ func (x *PlacementPolicy) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Filters") } - x.Filters = append(x.Filters, new(Filter)) - ff := x.Filters[len(x.Filters)-1] + x.Filters = append(x.Filters, Filter{}) + ff := &x.Filters[len(x.Filters)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1018,13 +1010,13 @@ func (x *PlacementPolicy) UnmarshalProtobuf(src []byte) (err error) { } return nil } -func (x *PlacementPolicy) GetReplicas() []*Replica { +func (x *PlacementPolicy) GetReplicas() []Replica { if x != nil { return x.Replicas } return nil } -func (x *PlacementPolicy) SetReplicas(v []*Replica) { +func (x *PlacementPolicy) SetReplicas(v []Replica) { x.Replicas = v } func (x *PlacementPolicy) GetContainerBackupFactor() uint32 { @@ -1036,22 +1028,22 @@ func (x *PlacementPolicy) GetContainerBackupFactor() uint32 { func (x *PlacementPolicy) SetContainerBackupFactor(v uint32) { x.ContainerBackupFactor = v } -func (x *PlacementPolicy) GetSelectors() []*Selector { +func (x *PlacementPolicy) GetSelectors() []Selector { if x != nil { return x.Selectors } return nil } -func (x *PlacementPolicy) SetSelectors(v []*Selector) { +func (x *PlacementPolicy) SetSelectors(v []Selector) { x.Selectors = v } -func (x *PlacementPolicy) GetFilters() []*Filter { +func (x *PlacementPolicy) GetFilters() []Filter { if x != nil { return x.Filters } return nil } -func (x *PlacementPolicy) SetFilters(v []*Filter) { +func (x *PlacementPolicy) SetFilters(v []Filter) { x.Filters = v } func (x *PlacementPolicy) GetUnique() bool { @@ -1152,11 +1144,11 @@ func (x *PlacementPolicy) UnmarshalEasyJSON(in *jlexer.Lexer) { switch key { case "replicas": { - var f *Replica - var list []*Replica + var f Replica + var list []Replica in.Delim('[') for !in.IsDelim(']') { - f = new(Replica) + f = Replica{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -1172,11 +1164,11 @@ func (x *PlacementPolicy) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "selectors": { - var f *Selector - var list []*Selector + var f Selector + var list []Selector in.Delim('[') for !in.IsDelim(']') { - f = new(Selector) + f = Selector{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -1186,11 +1178,11 @@ func (x *PlacementPolicy) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "filters": { - var f *Filter - var list []*Filter + var f Filter + var list []Filter in.Delim('[') for !in.IsDelim(']') { - f = new(Filter) + f = Filter{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -1457,10 +1449,10 @@ func (x *NodeInfo_Attribute) UnmarshalEasyJSON(in *jlexer.Lexer) { } type NodeInfo struct { - PublicKey []byte `json:"publicKey"` - Addresses []string `json:"addresses"` - Attributes []*NodeInfo_Attribute `json:"attributes"` - State NodeInfo_State `json:"state"` + PublicKey []byte `json:"publicKey"` + Addresses []string `json:"addresses"` + Attributes []NodeInfo_Attribute `json:"attributes"` + State NodeInfo_State `json:"state"` } var ( @@ -1480,7 +1472,7 @@ func (x *NodeInfo) StableSize() (size int) { size += proto.BytesSize(1, x.PublicKey) size += proto.RepeatedStringSize(2, x.Addresses) for i := range x.Attributes { - size += proto.NestedStructureSize(3, x.Attributes[i]) + size += proto.NestedStructureSizeUnchecked(3, &x.Attributes[i]) } size += proto.EnumSize(4, int32(x.State)) return size @@ -1506,9 +1498,7 @@ func (x *NodeInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendString(2, x.Addresses[j]) } for i := range x.Attributes { - if x.Attributes[i] != nil { - x.Attributes[i].EmitProtobuf(mm.AppendMessage(3)) - } + x.Attributes[i].EmitProtobuf(mm.AppendMessage(3)) } if int32(x.State) != 0 { mm.AppendInt32(4, int32(x.State)) @@ -1541,8 +1531,8 @@ func (x *NodeInfo) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Attributes") } - x.Attributes = append(x.Attributes, new(NodeInfo_Attribute)) - ff := x.Attributes[len(x.Attributes)-1] + x.Attributes = append(x.Attributes, NodeInfo_Attribute{}) + ff := &x.Attributes[len(x.Attributes)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1574,13 +1564,13 @@ func (x *NodeInfo) GetAddresses() []string { func (x *NodeInfo) SetAddresses(v []string) { x.Addresses = v } -func (x *NodeInfo) GetAttributes() []*NodeInfo_Attribute { +func (x *NodeInfo) GetAttributes() []NodeInfo_Attribute { if x != nil { return x.Attributes } return nil } -func (x *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) { +func (x *NodeInfo) SetAttributes(v []NodeInfo_Attribute) { x.Attributes = v } func (x *NodeInfo) GetState() NodeInfo_State { @@ -1688,11 +1678,11 @@ func (x *NodeInfo) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "attributes": { - var f *NodeInfo_Attribute - var list []*NodeInfo_Attribute + var f NodeInfo_Attribute + var list []NodeInfo_Attribute in.Delim('[') for !in.IsDelim(']') { - f = new(NodeInfo_Attribute) + f = NodeInfo_Attribute{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -1732,8 +1722,8 @@ func (x *NodeInfo) UnmarshalEasyJSON(in *jlexer.Lexer) { } type Netmap struct { - Epoch uint64 `json:"epoch"` - Nodes []*NodeInfo `json:"nodes"` + Epoch uint64 `json:"epoch"` + Nodes []NodeInfo `json:"nodes"` } var ( @@ -1752,7 +1742,7 @@ func (x *Netmap) StableSize() (size int) { } size += proto.UInt64Size(1, x.Epoch) for i := range x.Nodes { - size += proto.NestedStructureSize(2, x.Nodes[i]) + size += proto.NestedStructureSizeUnchecked(2, &x.Nodes[i]) } return size } @@ -1774,9 +1764,7 @@ func (x *Netmap) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint64(1, x.Epoch) } for i := range x.Nodes { - if x.Nodes[i] != nil { - x.Nodes[i].EmitProtobuf(mm.AppendMessage(2)) - } + x.Nodes[i].EmitProtobuf(mm.AppendMessage(2)) } } @@ -1800,8 +1788,8 @@ func (x *Netmap) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Nodes") } - x.Nodes = append(x.Nodes, new(NodeInfo)) - ff := x.Nodes[len(x.Nodes)-1] + x.Nodes = append(x.Nodes, NodeInfo{}) + ff := &x.Nodes[len(x.Nodes)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1818,13 +1806,13 @@ func (x *Netmap) GetEpoch() uint64 { func (x *Netmap) SetEpoch(v uint64) { x.Epoch = v } -func (x *Netmap) GetNodes() []*NodeInfo { +func (x *Netmap) GetNodes() []NodeInfo { if x != nil { return x.Nodes } return nil } -func (x *Netmap) SetNodes(v []*NodeInfo) { +func (x *Netmap) SetNodes(v []NodeInfo) { x.Nodes = v } @@ -1893,11 +1881,11 @@ func (x *Netmap) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "nodes": { - var f *NodeInfo - var list []*NodeInfo + var f NodeInfo + var list []NodeInfo in.Delim('[') for !in.IsDelim(']') { - f = new(NodeInfo) + f = NodeInfo{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -2075,7 +2063,7 @@ func (x *NetworkConfig_Parameter) UnmarshalEasyJSON(in *jlexer.Lexer) { } type NetworkConfig struct { - Parameters []*NetworkConfig_Parameter `json:"parameters"` + Parameters []NetworkConfig_Parameter `json:"parameters"` } var ( @@ -2093,7 +2081,7 @@ func (x *NetworkConfig) StableSize() (size int) { return 0 } for i := range x.Parameters { - size += proto.NestedStructureSize(1, x.Parameters[i]) + size += proto.NestedStructureSizeUnchecked(1, &x.Parameters[i]) } return size } @@ -2112,9 +2100,7 @@ func (x *NetworkConfig) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.Parameters { - if x.Parameters[i] != nil { - x.Parameters[i].EmitProtobuf(mm.AppendMessage(1)) - } + x.Parameters[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -2132,8 +2118,8 @@ func (x *NetworkConfig) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Parameters") } - x.Parameters = append(x.Parameters, new(NetworkConfig_Parameter)) - ff := x.Parameters[len(x.Parameters)-1] + x.Parameters = append(x.Parameters, NetworkConfig_Parameter{}) + ff := &x.Parameters[len(x.Parameters)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -2141,13 +2127,13 @@ func (x *NetworkConfig) UnmarshalProtobuf(src []byte) (err error) { } return nil } -func (x *NetworkConfig) GetParameters() []*NetworkConfig_Parameter { +func (x *NetworkConfig) GetParameters() []NetworkConfig_Parameter { if x != nil { return x.Parameters } return nil } -func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) { +func (x *NetworkConfig) SetParameters(v []NetworkConfig_Parameter) { x.Parameters = v } @@ -2205,11 +2191,11 @@ func (x *NetworkConfig) UnmarshalEasyJSON(in *jlexer.Lexer) { switch key { case "parameters": { - var f *NetworkConfig_Parameter - var list []*NetworkConfig_Parameter + var f NetworkConfig_Parameter + var list []NetworkConfig_Parameter in.Delim('[') for !in.IsDelim(']') { - f = new(NetworkConfig_Parameter) + f = NetworkConfig_Parameter{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/object/convert.go b/object/convert.go index e237883..88e6ab7 100644 --- a/object/convert.go +++ b/object/convert.go @@ -142,28 +142,26 @@ 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 { - if xs[i] != nil { - err = res[i].FromGRPCMessage(xs[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&xs[i]) + if err != nil { + return } } } @@ -683,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 } @@ -706,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 } } @@ -1626,28 +1624,26 @@ 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 { - if fs[i] != nil { - err = res[i].FromGRPCMessage(fs[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&fs[i]) + if err != nil { + return } } } @@ -1827,28 +1823,26 @@ 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 { - if rs[i] != nil { - err = res[i].FromGRPCMessage(rs[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&rs[i]) + if err != nil { + return } } } diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go index 0bd0111..dea1b5b 100644 --- a/object/grpc/service_frostfs.pb.go +++ b/object/grpc/service_frostfs.pb.go @@ -4201,9 +4201,9 @@ func (x *SearchRequest_Body_Filter) UnmarshalEasyJSON(in *jlexer.Lexer) { } type SearchRequest_Body struct { - ContainerId *grpc.ContainerID `json:"containerId"` - Version uint32 `json:"version"` - Filters []*SearchRequest_Body_Filter `json:"filters"` + ContainerId *grpc.ContainerID `json:"containerId"` + Version uint32 `json:"version"` + Filters []SearchRequest_Body_Filter `json:"filters"` } var ( @@ -4223,7 +4223,7 @@ func (x *SearchRequest_Body) StableSize() (size int) { size += proto.NestedStructureSize(1, x.ContainerId) size += proto.UInt32Size(2, x.Version) for i := range x.Filters { - size += proto.NestedStructureSize(3, x.Filters[i]) + size += proto.NestedStructureSizeUnchecked(3, &x.Filters[i]) } return size } @@ -4248,9 +4248,7 @@ func (x *SearchRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint32(2, x.Version) } for i := range x.Filters { - if x.Filters[i] != nil { - x.Filters[i].EmitProtobuf(mm.AppendMessage(3)) - } + x.Filters[i].EmitProtobuf(mm.AppendMessage(3)) } } @@ -4283,8 +4281,8 @@ func (x *SearchRequest_Body) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Filters") } - x.Filters = append(x.Filters, new(SearchRequest_Body_Filter)) - ff := x.Filters[len(x.Filters)-1] + x.Filters = append(x.Filters, SearchRequest_Body_Filter{}) + ff := &x.Filters[len(x.Filters)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -4310,13 +4308,13 @@ func (x *SearchRequest_Body) GetVersion() uint32 { func (x *SearchRequest_Body) SetVersion(v uint32) { x.Version = v } -func (x *SearchRequest_Body) GetFilters() []*SearchRequest_Body_Filter { +func (x *SearchRequest_Body) GetFilters() []SearchRequest_Body_Filter { if x != nil { return x.Filters } return nil } -func (x *SearchRequest_Body) SetFilters(v []*SearchRequest_Body_Filter) { +func (x *SearchRequest_Body) SetFilters(v []SearchRequest_Body_Filter) { x.Filters = v } @@ -4397,11 +4395,11 @@ func (x *SearchRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "filters": { - var f *SearchRequest_Body_Filter - var list []*SearchRequest_Body_Filter + var f SearchRequest_Body_Filter + var list []SearchRequest_Body_Filter in.Delim('[') for !in.IsDelim(']') { - f = new(SearchRequest_Body_Filter) + f = SearchRequest_Body_Filter{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -4640,7 +4638,7 @@ func (x *SearchRequest) UnmarshalEasyJSON(in *jlexer.Lexer) { } type SearchResponse_Body struct { - IdList []*grpc.ObjectID `json:"idList"` + IdList []grpc.ObjectID `json:"idList"` } var ( @@ -4658,7 +4656,7 @@ func (x *SearchResponse_Body) StableSize() (size int) { return 0 } for i := range x.IdList { - size += proto.NestedStructureSize(1, x.IdList[i]) + size += proto.NestedStructureSizeUnchecked(1, &x.IdList[i]) } return size } @@ -4677,9 +4675,7 @@ func (x *SearchResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.IdList { - if x.IdList[i] != nil { - x.IdList[i].EmitProtobuf(mm.AppendMessage(1)) - } + x.IdList[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -4697,8 +4693,8 @@ func (x *SearchResponse_Body) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "IdList") } - x.IdList = append(x.IdList, new(grpc.ObjectID)) - ff := x.IdList[len(x.IdList)-1] + x.IdList = append(x.IdList, grpc.ObjectID{}) + ff := &x.IdList[len(x.IdList)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -4706,13 +4702,13 @@ func (x *SearchResponse_Body) UnmarshalProtobuf(src []byte) (err error) { } return nil } -func (x *SearchResponse_Body) GetIdList() []*grpc.ObjectID { +func (x *SearchResponse_Body) GetIdList() []grpc.ObjectID { if x != nil { return x.IdList } return nil } -func (x *SearchResponse_Body) SetIdList(v []*grpc.ObjectID) { +func (x *SearchResponse_Body) SetIdList(v []grpc.ObjectID) { x.IdList = v } @@ -4770,11 +4766,11 @@ func (x *SearchResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { switch key { case "idList": { - var f *grpc.ObjectID - var list []*grpc.ObjectID + var f grpc.ObjectID + var list []grpc.ObjectID in.Delim('[') for !in.IsDelim(']') { - f = new(grpc.ObjectID) + f = grpc.ObjectID{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -6077,7 +6073,7 @@ func (x *GetRangeResponse) UnmarshalEasyJSON(in *jlexer.Lexer) { type GetRangeHashRequest_Body struct { Address *grpc.Address `json:"address"` - Ranges []*Range `json:"ranges"` + Ranges []Range `json:"ranges"` Salt []byte `json:"salt"` Type grpc.ChecksumType `json:"type"` } @@ -6098,7 +6094,7 @@ func (x *GetRangeHashRequest_Body) StableSize() (size int) { } size += proto.NestedStructureSize(1, x.Address) for i := range x.Ranges { - size += proto.NestedStructureSize(2, x.Ranges[i]) + size += proto.NestedStructureSizeUnchecked(2, &x.Ranges[i]) } size += proto.BytesSize(3, x.Salt) size += proto.EnumSize(4, int32(x.Type)) @@ -6122,9 +6118,7 @@ func (x *GetRangeHashRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) x.Address.EmitProtobuf(mm.AppendMessage(1)) } for i := range x.Ranges { - if x.Ranges[i] != nil { - x.Ranges[i].EmitProtobuf(mm.AppendMessage(2)) - } + x.Ranges[i].EmitProtobuf(mm.AppendMessage(2)) } if len(x.Salt) != 0 { mm.AppendBytes(3, x.Salt) @@ -6157,8 +6151,8 @@ func (x *GetRangeHashRequest_Body) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Ranges") } - x.Ranges = append(x.Ranges, new(Range)) - ff := x.Ranges[len(x.Ranges)-1] + x.Ranges = append(x.Ranges, Range{}) + ff := &x.Ranges[len(x.Ranges)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -6187,13 +6181,13 @@ func (x *GetRangeHashRequest_Body) GetAddress() *grpc.Address { func (x *GetRangeHashRequest_Body) SetAddress(v *grpc.Address) { x.Address = v } -func (x *GetRangeHashRequest_Body) GetRanges() []*Range { +func (x *GetRangeHashRequest_Body) GetRanges() []Range { if x != nil { return x.Ranges } return nil } -func (x *GetRangeHashRequest_Body) SetRanges(v []*Range) { +func (x *GetRangeHashRequest_Body) SetRanges(v []Range) { x.Ranges = v } func (x *GetRangeHashRequest_Body) GetSalt() []byte { @@ -6291,11 +6285,11 @@ func (x *GetRangeHashRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "ranges": { - var f *Range - var list []*Range + var f Range + var list []Range in.Delim('[') for !in.IsDelim(']') { - f = new(Range) + f = Range{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -7855,7 +7849,7 @@ func (x *PatchRequest_Body_Patch) UnmarshalEasyJSON(in *jlexer.Lexer) { type PatchRequest_Body struct { Address *grpc.Address `json:"address"` - NewAttributes []*Header_Attribute `json:"newAttributes"` + NewAttributes []Header_Attribute `json:"newAttributes"` ReplaceAttributes bool `json:"replaceAttributes"` Patch *PatchRequest_Body_Patch `json:"patch"` } @@ -7876,7 +7870,7 @@ func (x *PatchRequest_Body) StableSize() (size int) { } size += proto.NestedStructureSize(1, x.Address) for i := range x.NewAttributes { - size += proto.NestedStructureSize(2, x.NewAttributes[i]) + size += proto.NestedStructureSizeUnchecked(2, &x.NewAttributes[i]) } size += proto.BoolSize(3, x.ReplaceAttributes) size += proto.NestedStructureSize(4, x.Patch) @@ -7900,9 +7894,7 @@ func (x *PatchRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { x.Address.EmitProtobuf(mm.AppendMessage(1)) } for i := range x.NewAttributes { - if x.NewAttributes[i] != nil { - x.NewAttributes[i].EmitProtobuf(mm.AppendMessage(2)) - } + x.NewAttributes[i].EmitProtobuf(mm.AppendMessage(2)) } if x.ReplaceAttributes { mm.AppendBool(3, x.ReplaceAttributes) @@ -7935,8 +7927,8 @@ func (x *PatchRequest_Body) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "NewAttributes") } - x.NewAttributes = append(x.NewAttributes, new(Header_Attribute)) - ff := x.NewAttributes[len(x.NewAttributes)-1] + x.NewAttributes = append(x.NewAttributes, Header_Attribute{}) + ff := &x.NewAttributes[len(x.NewAttributes)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -7968,13 +7960,13 @@ func (x *PatchRequest_Body) GetAddress() *grpc.Address { func (x *PatchRequest_Body) SetAddress(v *grpc.Address) { x.Address = v } -func (x *PatchRequest_Body) GetNewAttributes() []*Header_Attribute { +func (x *PatchRequest_Body) GetNewAttributes() []Header_Attribute { if x != nil { return x.NewAttributes } return nil } -func (x *PatchRequest_Body) SetNewAttributes(v []*Header_Attribute) { +func (x *PatchRequest_Body) SetNewAttributes(v []Header_Attribute) { x.NewAttributes = v } func (x *PatchRequest_Body) GetReplaceAttributes() bool { @@ -8072,11 +8064,11 @@ func (x *PatchRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "newAttributes": { - var f *Header_Attribute - var list []*Header_Attribute + var f Header_Attribute + var list []Header_Attribute in.Delim('[') for !in.IsDelim(']') { - f = new(Header_Attribute) + f = Header_Attribute{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/object/grpc/types_frostfs.pb.go b/object/grpc/types_frostfs.pb.go index 04a3e29..4233417 100644 --- a/object/grpc/types_frostfs.pb.go +++ b/object/grpc/types_frostfs.pb.go @@ -600,12 +600,12 @@ func (x *Header_Attribute) UnmarshalEasyJSON(in *jlexer.Lexer) { } type Header_Split struct { - Parent *grpc.ObjectID `json:"parent"` - Previous *grpc.ObjectID `json:"previous"` - ParentSignature *grpc.Signature `json:"parentSignature"` - ParentHeader *Header `json:"parentHeader"` - Children []*grpc.ObjectID `json:"children"` - SplitId []byte `json:"splitID"` + Parent *grpc.ObjectID `json:"parent"` + Previous *grpc.ObjectID `json:"previous"` + ParentSignature *grpc.Signature `json:"parentSignature"` + ParentHeader *Header `json:"parentHeader"` + Children []grpc.ObjectID `json:"children"` + SplitId []byte `json:"splitID"` } var ( @@ -627,7 +627,7 @@ func (x *Header_Split) StableSize() (size int) { size += proto.NestedStructureSize(3, x.ParentSignature) size += proto.NestedStructureSize(4, x.ParentHeader) for i := range x.Children { - size += proto.NestedStructureSize(5, x.Children[i]) + size += proto.NestedStructureSizeUnchecked(5, &x.Children[i]) } size += proto.BytesSize(6, x.SplitId) return size @@ -659,9 +659,7 @@ func (x *Header_Split) EmitProtobuf(mm *easyproto.MessageMarshaler) { x.ParentHeader.EmitProtobuf(mm.AppendMessage(4)) } for i := range x.Children { - if x.Children[i] != nil { - x.Children[i].EmitProtobuf(mm.AppendMessage(5)) - } + x.Children[i].EmitProtobuf(mm.AppendMessage(5)) } if len(x.SplitId) != 0 { mm.AppendBytes(6, x.SplitId) @@ -718,8 +716,8 @@ func (x *Header_Split) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Children") } - x.Children = append(x.Children, new(grpc.ObjectID)) - ff := x.Children[len(x.Children)-1] + x.Children = append(x.Children, grpc.ObjectID{}) + ff := &x.Children[len(x.Children)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -769,13 +767,13 @@ func (x *Header_Split) GetParentHeader() *Header { func (x *Header_Split) SetParentHeader(v *Header) { x.ParentHeader = v } -func (x *Header_Split) GetChildren() []*grpc.ObjectID { +func (x *Header_Split) GetChildren() []grpc.ObjectID { if x != nil { return x.Children } return nil } -func (x *Header_Split) SetChildren(v []*grpc.ObjectID) { +func (x *Header_Split) SetChildren(v []grpc.ObjectID) { x.Children = v } func (x *Header_Split) GetSplitId() []byte { @@ -895,11 +893,11 @@ func (x *Header_Split) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "children": { - var f *grpc.ObjectID - var list []*grpc.ObjectID + var f grpc.ObjectID + var list []grpc.ObjectID in.Delim('[') for !in.IsDelim(']') { - f = new(grpc.ObjectID) + f = grpc.ObjectID{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -923,14 +921,14 @@ func (x *Header_Split) UnmarshalEasyJSON(in *jlexer.Lexer) { } type Header_EC struct { - Parent *grpc.ObjectID `json:"parent"` - Index uint32 `json:"index"` - Total uint32 `json:"total"` - HeaderLength uint32 `json:"headerLength"` - Header []byte `json:"header"` - ParentSplitId []byte `json:"parentSplitID"` - ParentSplitParentId *grpc.ObjectID `json:"parentSplitParentID"` - ParentAttributes []*Header_Attribute `json:"parentAttributes"` + Parent *grpc.ObjectID `json:"parent"` + Index uint32 `json:"index"` + Total uint32 `json:"total"` + HeaderLength uint32 `json:"headerLength"` + Header []byte `json:"header"` + ParentSplitId []byte `json:"parentSplitID"` + ParentSplitParentId *grpc.ObjectID `json:"parentSplitParentID"` + ParentAttributes []Header_Attribute `json:"parentAttributes"` } var ( @@ -955,7 +953,7 @@ func (x *Header_EC) StableSize() (size int) { size += proto.BytesSize(6, x.ParentSplitId) size += proto.NestedStructureSize(7, x.ParentSplitParentId) for i := range x.ParentAttributes { - size += proto.NestedStructureSize(8, x.ParentAttributes[i]) + size += proto.NestedStructureSizeUnchecked(8, &x.ParentAttributes[i]) } return size } @@ -995,9 +993,7 @@ func (x *Header_EC) EmitProtobuf(mm *easyproto.MessageMarshaler) { x.ParentSplitParentId.EmitProtobuf(mm.AppendMessage(7)) } for i := range x.ParentAttributes { - if x.ParentAttributes[i] != nil { - x.ParentAttributes[i].EmitProtobuf(mm.AppendMessage(8)) - } + x.ParentAttributes[i].EmitProtobuf(mm.AppendMessage(8)) } } @@ -1063,8 +1059,8 @@ func (x *Header_EC) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "ParentAttributes") } - x.ParentAttributes = append(x.ParentAttributes, new(Header_Attribute)) - ff := x.ParentAttributes[len(x.ParentAttributes)-1] + x.ParentAttributes = append(x.ParentAttributes, Header_Attribute{}) + ff := &x.ParentAttributes[len(x.ParentAttributes)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1135,13 +1131,13 @@ func (x *Header_EC) GetParentSplitParentId() *grpc.ObjectID { func (x *Header_EC) SetParentSplitParentId(v *grpc.ObjectID) { x.ParentSplitParentId = v } -func (x *Header_EC) GetParentAttributes() []*Header_Attribute { +func (x *Header_EC) GetParentAttributes() []Header_Attribute { if x != nil { return x.ParentAttributes } return nil } -func (x *Header_EC) SetParentAttributes(v []*Header_Attribute) { +func (x *Header_EC) SetParentAttributes(v []Header_Attribute) { x.ParentAttributes = v } @@ -1278,11 +1274,11 @@ func (x *Header_EC) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "parentAttributes": { - var f *Header_Attribute - var list []*Header_Attribute + var f Header_Attribute + var list []Header_Attribute in.Delim('[') for !in.IsDelim(']') { - f = new(Header_Attribute) + f = Header_Attribute{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -1309,7 +1305,7 @@ type Header struct { ObjectType ObjectType `json:"objectType"` HomomorphicHash *grpc.Checksum `json:"homomorphicHash"` SessionToken *grpc1.SessionToken `json:"sessionToken"` - Attributes []*Header_Attribute `json:"attributes"` + Attributes []Header_Attribute `json:"attributes"` Split *Header_Split `json:"split"` Ec *Header_EC `json:"ec"` } @@ -1338,7 +1334,7 @@ func (x *Header) StableSize() (size int) { size += proto.NestedStructureSize(8, x.HomomorphicHash) size += proto.NestedStructureSize(9, x.SessionToken) for i := range x.Attributes { - size += proto.NestedStructureSize(10, x.Attributes[i]) + size += proto.NestedStructureSizeUnchecked(10, &x.Attributes[i]) } size += proto.NestedStructureSize(11, x.Split) size += proto.NestedStructureSize(12, x.Ec) @@ -1386,9 +1382,7 @@ func (x *Header) EmitProtobuf(mm *easyproto.MessageMarshaler) { x.SessionToken.EmitProtobuf(mm.AppendMessage(9)) } for i := range x.Attributes { - if x.Attributes[i] != nil { - x.Attributes[i].EmitProtobuf(mm.AppendMessage(10)) - } + x.Attributes[i].EmitProtobuf(mm.AppendMessage(10)) } if x.Split != nil { x.Split.EmitProtobuf(mm.AppendMessage(11)) @@ -1484,8 +1478,8 @@ func (x *Header) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Attributes") } - x.Attributes = append(x.Attributes, new(Header_Attribute)) - ff := x.Attributes[len(x.Attributes)-1] + x.Attributes = append(x.Attributes, Header_Attribute{}) + ff := &x.Attributes[len(x.Attributes)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1592,13 +1586,13 @@ func (x *Header) GetSessionToken() *grpc1.SessionToken { func (x *Header) SetSessionToken(v *grpc1.SessionToken) { x.SessionToken = v } -func (x *Header) GetAttributes() []*Header_Attribute { +func (x *Header) GetAttributes() []Header_Attribute { if x != nil { return x.Attributes } return nil } -func (x *Header) SetAttributes(v []*Header_Attribute) { +func (x *Header) SetAttributes(v []Header_Attribute) { x.Attributes = v } func (x *Header) GetSplit() *Header_Split { @@ -1805,11 +1799,11 @@ func (x *Header) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "attributes": { - var f *Header_Attribute - var list []*Header_Attribute + var f Header_Attribute + var list []Header_Attribute in.Delim('[') for !in.IsDelim(']') { - f = new(Header_Attribute) + f = Header_Attribute{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -2469,7 +2463,7 @@ func (x *ECInfo_Chunk) UnmarshalEasyJSON(in *jlexer.Lexer) { } type ECInfo struct { - Chunks []*ECInfo_Chunk `json:"chunks"` + Chunks []ECInfo_Chunk `json:"chunks"` } var ( @@ -2487,7 +2481,7 @@ func (x *ECInfo) StableSize() (size int) { return 0 } for i := range x.Chunks { - size += proto.NestedStructureSize(1, x.Chunks[i]) + size += proto.NestedStructureSizeUnchecked(1, &x.Chunks[i]) } return size } @@ -2506,9 +2500,7 @@ func (x *ECInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) { return } for i := range x.Chunks { - if x.Chunks[i] != nil { - x.Chunks[i].EmitProtobuf(mm.AppendMessage(1)) - } + x.Chunks[i].EmitProtobuf(mm.AppendMessage(1)) } } @@ -2526,8 +2518,8 @@ func (x *ECInfo) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Chunks") } - x.Chunks = append(x.Chunks, new(ECInfo_Chunk)) - ff := x.Chunks[len(x.Chunks)-1] + x.Chunks = append(x.Chunks, ECInfo_Chunk{}) + ff := &x.Chunks[len(x.Chunks)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -2535,13 +2527,13 @@ func (x *ECInfo) UnmarshalProtobuf(src []byte) (err error) { } return nil } -func (x *ECInfo) GetChunks() []*ECInfo_Chunk { +func (x *ECInfo) GetChunks() []ECInfo_Chunk { if x != nil { return x.Chunks } return nil } -func (x *ECInfo) SetChunks(v []*ECInfo_Chunk) { +func (x *ECInfo) SetChunks(v []ECInfo_Chunk) { x.Chunks = v } @@ -2599,11 +2591,11 @@ func (x *ECInfo) UnmarshalEasyJSON(in *jlexer.Lexer) { switch key { case "chunks": { - var f *ECInfo_Chunk - var list []*ECInfo_Chunk + var f ECInfo_Chunk + var list []ECInfo_Chunk in.Delim('[') for !in.IsDelim(']') { - f = new(ECInfo_Chunk) + f = ECInfo_Chunk{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/object/lock.go b/object/lock.go index 62ba4a9..585fd09 100644 --- a/object/lock.go +++ b/object/lock.go @@ -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 } diff --git a/refs/convert.go b/refs/convert.go index 6f06783..da31cdb 100644 --- a/refs/convert.go +++ b/refs/convert.go @@ -52,28 +52,26 @@ 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 { - if idsV2[i] != nil { - err = res[i].FromGRPCMessage(idsV2[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&idsV2[i]) + if err != nil { + return } } } @@ -104,28 +102,26 @@ 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 { - if idsV2[i] != nil { - err = res[i].FromGRPCMessage(idsV2[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&idsV2[i]) + if err != nil { + return } } } diff --git a/session/convert.go b/session/convert.go index b7f334e..d0e83fa 100644 --- a/session/convert.go +++ b/session/convert.go @@ -207,28 +207,26 @@ 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 { - if xs[i] != nil { - err = res[i].FromGRPCMessage(xs[i]) - if err != nil { - return - } + err = res[i].FromGRPCMessage(&xs[i]) + if err != nil { + return } } } diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go index 4f8bf81..41ff5d9 100644 --- a/session/grpc/types_frostfs.pb.go +++ b/session/grpc/types_frostfs.pb.go @@ -72,7 +72,7 @@ func (x *ObjectSessionContext_Verb) FromString(s string) bool { type ObjectSessionContext_Target struct { Container *grpc.ContainerID `json:"container"` - Objects []*grpc.ObjectID `json:"objects"` + Objects []grpc.ObjectID `json:"objects"` } var ( @@ -91,7 +91,7 @@ func (x *ObjectSessionContext_Target) StableSize() (size int) { } size += proto.NestedStructureSize(1, x.Container) for i := range x.Objects { - size += proto.NestedStructureSize(2, x.Objects[i]) + size += proto.NestedStructureSizeUnchecked(2, &x.Objects[i]) } return size } @@ -113,9 +113,7 @@ func (x *ObjectSessionContext_Target) EmitProtobuf(mm *easyproto.MessageMarshale x.Container.EmitProtobuf(mm.AppendMessage(1)) } for i := range x.Objects { - if x.Objects[i] != nil { - x.Objects[i].EmitProtobuf(mm.AppendMessage(2)) - } + x.Objects[i].EmitProtobuf(mm.AppendMessage(2)) } } @@ -142,8 +140,8 @@ func (x *ObjectSessionContext_Target) UnmarshalProtobuf(src []byte) (err error) if !ok { return fmt.Errorf("cannot unmarshal field %s", "Objects") } - x.Objects = append(x.Objects, new(grpc.ObjectID)) - ff := x.Objects[len(x.Objects)-1] + x.Objects = append(x.Objects, grpc.ObjectID{}) + ff := &x.Objects[len(x.Objects)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -160,13 +158,13 @@ func (x *ObjectSessionContext_Target) GetContainer() *grpc.ContainerID { func (x *ObjectSessionContext_Target) SetContainer(v *grpc.ContainerID) { x.Container = v } -func (x *ObjectSessionContext_Target) GetObjects() []*grpc.ObjectID { +func (x *ObjectSessionContext_Target) GetObjects() []grpc.ObjectID { if x != nil { return x.Objects } return nil } -func (x *ObjectSessionContext_Target) SetObjects(v []*grpc.ObjectID) { +func (x *ObjectSessionContext_Target) SetObjects(v []grpc.ObjectID) { x.Objects = v } @@ -236,11 +234,11 @@ func (x *ObjectSessionContext_Target) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "objects": { - var f *grpc.ObjectID - var list []*grpc.ObjectID + var f grpc.ObjectID + var list []grpc.ObjectID in.Delim('[') for !in.IsDelim(']') { - f = new(grpc.ObjectID) + f = grpc.ObjectID{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -1551,7 +1549,7 @@ type RequestMetaHeader struct { Version *grpc.Version `json:"version"` Epoch uint64 `json:"epoch"` Ttl uint32 `json:"ttl"` - XHeaders []*XHeader `json:"xHeaders"` + XHeaders []XHeader `json:"xHeaders"` SessionToken *SessionToken `json:"sessionToken"` BearerToken *grpc1.BearerToken `json:"bearerToken"` Origin *RequestMetaHeader `json:"origin"` @@ -1576,7 +1574,7 @@ func (x *RequestMetaHeader) StableSize() (size int) { size += proto.UInt64Size(2, x.Epoch) size += proto.UInt32Size(3, x.Ttl) for i := range x.XHeaders { - size += proto.NestedStructureSize(4, x.XHeaders[i]) + size += proto.NestedStructureSizeUnchecked(4, &x.XHeaders[i]) } size += proto.NestedStructureSize(5, x.SessionToken) size += proto.NestedStructureSize(6, x.BearerToken) @@ -1608,9 +1606,7 @@ func (x *RequestMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint32(3, x.Ttl) } for i := range x.XHeaders { - if x.XHeaders[i] != nil { - x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) - } + x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) } if x.SessionToken != nil { x.SessionToken.EmitProtobuf(mm.AppendMessage(5)) @@ -1661,8 +1657,8 @@ func (x *RequestMetaHeader) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "XHeaders") } - x.XHeaders = append(x.XHeaders, new(XHeader)) - ff := x.XHeaders[len(x.XHeaders)-1] + x.XHeaders = append(x.XHeaders, XHeader{}) + ff := &x.XHeaders[len(x.XHeaders)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1730,13 +1726,13 @@ func (x *RequestMetaHeader) GetTtl() uint32 { func (x *RequestMetaHeader) SetTtl(v uint32) { x.Ttl = v } -func (x *RequestMetaHeader) GetXHeaders() []*XHeader { +func (x *RequestMetaHeader) GetXHeaders() []XHeader { if x != nil { return x.XHeaders } return nil } -func (x *RequestMetaHeader) SetXHeaders(v []*XHeader) { +func (x *RequestMetaHeader) SetXHeaders(v []XHeader) { x.XHeaders = v } func (x *RequestMetaHeader) GetSessionToken() *SessionToken { @@ -1884,11 +1880,11 @@ func (x *RequestMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "xHeaders": { - var f *XHeader - var list []*XHeader + var f XHeader + var list []XHeader in.Delim('[') for !in.IsDelim(']') { - f = new(XHeader) + f = XHeader{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() @@ -1936,7 +1932,7 @@ type ResponseMetaHeader struct { Version *grpc.Version `json:"version"` Epoch uint64 `json:"epoch"` Ttl uint32 `json:"ttl"` - XHeaders []*XHeader `json:"xHeaders"` + XHeaders []XHeader `json:"xHeaders"` Origin *ResponseMetaHeader `json:"origin"` Status *grpc2.Status `json:"status"` } @@ -1959,7 +1955,7 @@ func (x *ResponseMetaHeader) StableSize() (size int) { size += proto.UInt64Size(2, x.Epoch) size += proto.UInt32Size(3, x.Ttl) for i := range x.XHeaders { - size += proto.NestedStructureSize(4, x.XHeaders[i]) + size += proto.NestedStructureSizeUnchecked(4, &x.XHeaders[i]) } size += proto.NestedStructureSize(5, x.Origin) size += proto.NestedStructureSize(6, x.Status) @@ -1989,9 +1985,7 @@ func (x *ResponseMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint32(3, x.Ttl) } for i := range x.XHeaders { - if x.XHeaders[i] != nil { - x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) - } + x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4)) } if x.Origin != nil { x.Origin.EmitProtobuf(mm.AppendMessage(5)) @@ -2036,8 +2030,8 @@ func (x *ResponseMetaHeader) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "XHeaders") } - x.XHeaders = append(x.XHeaders, new(XHeader)) - ff := x.XHeaders[len(x.XHeaders)-1] + x.XHeaders = append(x.XHeaders, XHeader{}) + ff := &x.XHeaders[len(x.XHeaders)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -2090,13 +2084,13 @@ func (x *ResponseMetaHeader) GetTtl() uint32 { func (x *ResponseMetaHeader) SetTtl(v uint32) { x.Ttl = v } -func (x *ResponseMetaHeader) GetXHeaders() []*XHeader { +func (x *ResponseMetaHeader) GetXHeaders() []XHeader { if x != nil { return x.XHeaders } return nil } -func (x *ResponseMetaHeader) SetXHeaders(v []*XHeader) { +func (x *ResponseMetaHeader) SetXHeaders(v []XHeader) { x.XHeaders = v } func (x *ResponseMetaHeader) GetOrigin() *ResponseMetaHeader { @@ -2216,11 +2210,11 @@ func (x *ResponseMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "xHeaders": { - var f *XHeader - var list []*XHeader + var f XHeader + var list []XHeader in.Delim('[') for !in.IsDelim(']') { - f = new(XHeader) + f = XHeader{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/status/convert.go b/status/convert.go index 0743952..3c5b5bf 100644 --- a/status/convert.go +++ b/status/convert.go @@ -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 := 0; i < ln; i++ { - ds = append(ds, x.details[i].ToGRPCMessage().(*status.Status_Detail)) + ds = append(ds, *x.details[i].ToGRPCMessage().(*status.Status_Detail)) } } @@ -81,10 +81,8 @@ func (x *Status) FromGRPCMessage(m grpc.Message) error { ds = make([]Detail, ln) for i := 0; i < ln; i++ { - if dsV2[i] != nil { - if err := ds[i].FromGRPCMessage(dsV2[i]); err != nil { - return err - } + if err := ds[i].FromGRPCMessage(&dsV2[i]); err != nil { + return err } } } diff --git a/status/grpc/types_frostfs.pb.go b/status/grpc/types_frostfs.pb.go index 5012491..29dfebe 100644 --- a/status/grpc/types_frostfs.pb.go +++ b/status/grpc/types_frostfs.pb.go @@ -429,9 +429,9 @@ func (x *Status_Detail) UnmarshalEasyJSON(in *jlexer.Lexer) { } type Status struct { - Code uint32 `json:"code"` - Message string `json:"message"` - Details []*Status_Detail `json:"details"` + Code uint32 `json:"code"` + Message string `json:"message"` + Details []Status_Detail `json:"details"` } var ( @@ -451,7 +451,7 @@ func (x *Status) StableSize() (size int) { size += proto.UInt32Size(1, x.Code) size += proto.StringSize(2, x.Message) for i := range x.Details { - size += proto.NestedStructureSize(3, x.Details[i]) + size += proto.NestedStructureSizeUnchecked(3, &x.Details[i]) } return size } @@ -476,9 +476,7 @@ func (x *Status) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendString(2, x.Message) } for i := range x.Details { - if x.Details[i] != nil { - x.Details[i].EmitProtobuf(mm.AppendMessage(3)) - } + x.Details[i].EmitProtobuf(mm.AppendMessage(3)) } } @@ -508,8 +506,8 @@ func (x *Status) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Details") } - x.Details = append(x.Details, new(Status_Detail)) - ff := x.Details[len(x.Details)-1] + x.Details = append(x.Details, Status_Detail{}) + ff := &x.Details[len(x.Details)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -535,13 +533,13 @@ func (x *Status) GetMessage() string { func (x *Status) SetMessage(v string) { x.Message = v } -func (x *Status) GetDetails() []*Status_Detail { +func (x *Status) GetDetails() []Status_Detail { if x != nil { return x.Details } return nil } -func (x *Status) SetDetails(v []*Status_Detail) { +func (x *Status) SetDetails(v []Status_Detail) { x.Details = v } @@ -621,11 +619,11 @@ func (x *Status) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "details": { - var f *Status_Detail - var list []*Status_Detail + var f Status_Detail + var list []Status_Detail in.Delim('[') for !in.IsDelim(']') { - f = new(Status_Detail) + f = Status_Detail{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/tombstone/grpc/types_frostfs.pb.go b/tombstone/grpc/types_frostfs.pb.go index 8c2e83c..f7bc48c 100644 --- a/tombstone/grpc/types_frostfs.pb.go +++ b/tombstone/grpc/types_frostfs.pb.go @@ -15,9 +15,9 @@ import ( ) type Tombstone struct { - ExpirationEpoch uint64 `json:"expirationEpoch"` - SplitId []byte `json:"splitID"` - Members []*grpc.ObjectID `json:"members"` + ExpirationEpoch uint64 `json:"expirationEpoch"` + SplitId []byte `json:"splitID"` + Members []grpc.ObjectID `json:"members"` } var ( @@ -37,7 +37,7 @@ func (x *Tombstone) StableSize() (size int) { size += proto.UInt64Size(1, x.ExpirationEpoch) size += proto.BytesSize(2, x.SplitId) for i := range x.Members { - size += proto.NestedStructureSize(3, x.Members[i]) + size += proto.NestedStructureSizeUnchecked(3, &x.Members[i]) } return size } @@ -62,9 +62,7 @@ func (x *Tombstone) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendBytes(2, x.SplitId) } for i := range x.Members { - if x.Members[i] != nil { - x.Members[i].EmitProtobuf(mm.AppendMessage(3)) - } + x.Members[i].EmitProtobuf(mm.AppendMessage(3)) } } @@ -94,8 +92,8 @@ func (x *Tombstone) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "Members") } - x.Members = append(x.Members, new(grpc.ObjectID)) - ff := x.Members[len(x.Members)-1] + 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) } @@ -121,13 +119,13 @@ func (x *Tombstone) GetSplitId() []byte { func (x *Tombstone) SetSplitId(v []byte) { x.SplitId = v } -func (x *Tombstone) GetMembers() []*grpc.ObjectID { +func (x *Tombstone) GetMembers() []grpc.ObjectID { if x != nil { return x.Members } return nil } -func (x *Tombstone) SetMembers(v []*grpc.ObjectID) { +func (x *Tombstone) SetMembers(v []grpc.ObjectID) { x.Members = v } @@ -207,11 +205,11 @@ func (x *Tombstone) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "members": { - var f *grpc.ObjectID - var list []*grpc.ObjectID + var f grpc.ObjectID + var list []grpc.ObjectID in.Delim('[') for !in.IsDelim(']') { - f = new(grpc.ObjectID) + f = grpc.ObjectID{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index a848bb5..1cd7005 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -133,10 +133,10 @@ func randIntSlice[T protoInt](n int, includeZero bool) []T { return r } -func uint32SliceToAux(s []uint32) []*generated.RepPrimitives_Aux { - r := make([]*generated.RepPrimitives_Aux, len(s)) +func uint32SliceToAux(s []uint32) []generated.RepPrimitives_Aux { + r := make([]generated.RepPrimitives_Aux, len(s)) for i := range s { - r[i] = &generated.RepPrimitives_Aux{s[i]} + r[i] = generated.RepPrimitives_Aux{InnerField: s[i]} } return r } diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index f3b958f..97efa51 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -932,14 +932,14 @@ func (x *RepPrimitives_Aux) UnmarshalEasyJSON(in *jlexer.Lexer) { } type RepPrimitives struct { - FieldA [][]byte `json:"fieldA"` - FieldB []string `json:"fieldB"` - FieldC []int32 `json:"fieldC"` - FieldD []uint32 `json:"fieldD"` - FieldE []int64 `json:"fieldE"` - FieldF []uint64 `json:"fieldF"` - FieldFu []uint64 `json:"fieldFu"` - FieldAux []*RepPrimitives_Aux `json:"fieldAux"` + FieldA [][]byte `json:"fieldA"` + FieldB []string `json:"fieldB"` + FieldC []int32 `json:"fieldC"` + FieldD []uint32 `json:"fieldD"` + FieldE []int64 `json:"fieldE"` + FieldF []uint64 `json:"fieldF"` + FieldFu []uint64 `json:"fieldFu"` + FieldAux []RepPrimitives_Aux `json:"fieldAux"` } var ( @@ -971,7 +971,7 @@ func (x *RepPrimitives) StableSize() (size int) { size += protowire.SizeGroup(protowire.Number(7), protowire.SizeVarint(x.FieldFu[i])) } for i := range x.FieldAux { - size += proto.NestedStructureSize(8, x.FieldAux[i]) + size += proto.NestedStructureSizeUnchecked(8, &x.FieldAux[i]) } return size } @@ -1011,9 +1011,7 @@ func (x *RepPrimitives) EmitProtobuf(mm *easyproto.MessageMarshaler) { mm.AppendUint64(7, x.FieldFu[j]) } for i := range x.FieldAux { - if x.FieldAux[i] != nil { - x.FieldAux[i].EmitProtobuf(mm.AppendMessage(8)) - } + x.FieldAux[i].EmitProtobuf(mm.AppendMessage(8)) } } @@ -1073,8 +1071,8 @@ func (x *RepPrimitives) UnmarshalProtobuf(src []byte) (err error) { if !ok { return fmt.Errorf("cannot unmarshal field %s", "FieldAux") } - x.FieldAux = append(x.FieldAux, new(RepPrimitives_Aux)) - ff := x.FieldAux[len(x.FieldAux)-1] + x.FieldAux = append(x.FieldAux, RepPrimitives_Aux{}) + ff := &x.FieldAux[len(x.FieldAux)-1] if err := ff.UnmarshalProtobuf(data); err != nil { return fmt.Errorf("unmarshal: %w", err) } @@ -1145,13 +1143,13 @@ func (x *RepPrimitives) GetFieldFu() []uint64 { func (x *RepPrimitives) SetFieldFu(v []uint64) { x.FieldFu = v } -func (x *RepPrimitives) GetFieldAux() []*RepPrimitives_Aux { +func (x *RepPrimitives) GetFieldAux() []RepPrimitives_Aux { if x != nil { return x.FieldAux } return nil } -func (x *RepPrimitives) SetFieldAux(v []*RepPrimitives_Aux) { +func (x *RepPrimitives) SetFieldAux(v []RepPrimitives_Aux) { x.FieldAux = v } @@ -1384,11 +1382,11 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) { } case "fieldAux": { - var f *RepPrimitives_Aux - var list []*RepPrimitives_Aux + var f RepPrimitives_Aux + var list []RepPrimitives_Aux in.Delim('[') for !in.IsDelim(']') { - f = new(RepPrimitives_Aux) + f = RepPrimitives_Aux{} f.UnmarshalEasyJSON(in) list = append(list, f) in.WantComma() diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go index 4ae24e7..f7cd284 100644 --- a/util/protogen/internalgengo/json.go +++ b/util/protogen/internalgengo/json.go @@ -117,7 +117,7 @@ func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string template = "%s = in.Bytes()" case protoreflect.MessageKind: if f.Desc.IsList() { - g.P("f = new(", fieldType(g, f)[3:], ")") + g.P("f = ", fieldType(g, f)[2:], "{}") } else { g.P("f = new(", fieldType(g, f)[1:], ")") } diff --git a/util/protogen/internalgengo/proto.go b/util/protogen/internalgengo/proto.go index 8894cde..1467541 100644 --- a/util/protogen/internalgengo/proto.go +++ b/util/protogen/internalgengo/proto.go @@ -39,8 +39,8 @@ func emitFieldUnmarshal(g *protogen.GeneratedFile, f *protogen.Field) { g.P("data, ok := fc.MessageData()") g.P(`if !ok { return fmt.Errorf("cannot unmarshal field %s", "`, f.GoName, `") }`) if f.Desc.IsList() { - g.P(name, " = append(", name, ", new(", fieldType(g, f)[3:], "))") - g.P("ff := ", name, "[len(", name, ")-1]") + g.P(name, " = append(", name, ", ", fieldType(g, f)[2:], "{})") + g.P("ff := &", name, "[len(", name, ")-1]") name = "ff" } else if f.Oneof != nil { const tmp = "oneofField" @@ -172,11 +172,12 @@ func emitMarshalRaw(g *protogen.GeneratedFile, f *protogen.Field, name string) { defer g.P("}") name += "[i]" + } else { + g.P("if ", notNil(name), " {") + defer g.P("}") } - g.P("if ", notNil(name), " {") g.P(name, ".EmitProtobuf(mm.AppendMessage(", f.Desc.Number(), "))") - g.P("}") return } diff --git a/util/protogen/internalgengo/proto_field_type.go b/util/protogen/internalgengo/proto_field_type.go index 09f6884..0096751 100644 --- a/util/protogen/internalgengo/proto_field_type.go +++ b/util/protogen/internalgengo/proto_field_type.go @@ -43,7 +43,10 @@ func fieldType(g *protogen.GeneratedFile, field *protogen.Field) structField { case protoreflect.BytesKind: typ = "[]byte" case protoreflect.MessageKind: - typ = structField(g.QualifiedGoIdent(field.Message.GoIdent)).PointerTo() + typ = structField(g.QualifiedGoIdent(field.Message.GoIdent)) + if !field.Desc.IsList() { + typ = typ.PointerTo() + } case protoreflect.GroupKind: panic("unimplemented") } diff --git a/util/protogen/internalgengo/proto_stable_compat.go b/util/protogen/internalgengo/proto_stable_compat.go index c27b9d8..3c4670c 100644 --- a/util/protogen/internalgengo/proto_stable_compat.go +++ b/util/protogen/internalgengo/proto_stable_compat.go @@ -72,7 +72,7 @@ func emitFieldSize(g *protogen.GeneratedFile, f *protogen.Field) { case f.Desc.IsList() && (f.Desc.Kind() == protoreflect.MessageKind || f.Desc.Kind() == protoreflect.Uint64Kind && !f.Desc.IsPacked()): g.P("for i := range ", name, "{") if f.Desc.Kind() == protoreflect.MessageKind { - g.P("size += ", protoPackage.Ident("NestedStructureSize"), "(", f.Desc.Number(), ", ", name, "[i])") + g.P("size += ", protoPackage.Ident("NestedStructureSizeUnchecked"), "(", f.Desc.Number(), ", &", name, "[i])") } else { if f.Desc.Kind() != protoreflect.Uint64Kind { panic("only uint64 unpacked primitive is supported") From 9c5e32a183576069b889f7e5d09af966c8623612 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 26 Aug 2024 14:13:20 +0300 Subject: [PATCH 147/169] [#106] test: Generate correct data for tests Some tests are using invalid data that do not meet the requirements of the FrostFS protocol, e.g. - Container/Object IDs aren't 32 bytes long - Signature key and sign have invalid length - Split IDs aren't valid UUIDv4 and etc. Signed-off-by: Aleksey Savchuk --- container/test/generate.go | 7 ++++++- object/test/generate.go | 21 +++++++++++++++++---- refs/test/generate.go | 37 ++++++++++++++++++++++++++++--------- session/test/generate.go | 11 +++++++++-- tombstone/test/generate.go | 7 ++++++- 5 files changed, 66 insertions(+), 17 deletions(-) diff --git a/container/test/generate.go b/container/test/generate.go index b94347b..23ad3a1 100644 --- a/container/test/generate.go +++ b/container/test/generate.go @@ -1,6 +1,8 @@ package containertest import ( + "crypto/rand" + acltest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/test" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" netmaptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/test" @@ -36,8 +38,11 @@ func GenerateContainer(empty bool) *container.Container { m := new(container.Container) if !empty { + nonce := make([]byte, 16) + _, _ = rand.Read(nonce) + m.SetBasicACL(12) - m.SetNonce([]byte{1, 2, 3}) + m.SetNonce(nonce) m.SetOwnerID(refstest.GenerateOwnerID(false)) m.SetAttributes(GenerateAttributes(false)) m.SetPlacementPolicy(netmaptest.GeneratePlacementPolicy(false)) diff --git a/object/test/generate.go b/object/test/generate.go index 87ad64e..b4d3de5 100644 --- a/object/test/generate.go +++ b/object/test/generate.go @@ -1,6 +1,7 @@ package objecttest import ( + crand "crypto/rand" "math/rand" "time" @@ -59,7 +60,10 @@ func generateSplitHeader(empty, withPar bool) *object.SplitHeader { m := new(object.SplitHeader) if !empty { - m.SetSplitID([]byte{1, 3, 5}) + id := make([]byte, 16) + _, _ = crand.Read(id) + + m.SetSplitID(id) m.SetParent(refstest.GenerateObjectID(false)) m.SetPrevious(refstest.GenerateObjectID(false)) m.SetChildren(refstest.GenerateObjectIDs(false)) @@ -91,7 +95,10 @@ func GenerateECHeader(empty bool) *object.ECHeader { if !empty { ech.Parent = refstest.GenerateObjectID(empty) - ech.ParentSplitID = []byte{1, 2, 3} + + ech.ParentSplitID = make([]byte, 16) + _, _ = crand.Read(ech.ParentSplitID) + ech.ParentSplitParentID = refstest.GenerateObjectID(empty) ech.ParentAttributes = GenerateAttributes(empty) ech.Index = 0 @@ -150,7 +157,10 @@ func GenerateSplitInfo(empty bool) *object.SplitInfo { m := new(object.SplitInfo) if !empty { - m.SetSplitID([]byte("splitID")) + id := make([]byte, 16) + _, _ = crand.Read(id) + + m.SetSplitID(id) m.SetLastPart(refstest.GenerateObjectID(false)) m.SetLink(refstest.GenerateObjectID(false)) } @@ -627,7 +637,10 @@ func GenerateGetRangeHashResponseBody(empty bool) *object.GetRangeHashResponseBo if !empty { m.SetType(678) - m.SetHashList([][]byte{{1}, {2}}) + m.SetHashList([][]byte{ + refstest.GenerateChecksum(false).GetSum(), + refstest.GenerateChecksum(false).GetSum(), + }) } return m diff --git a/refs/test/generate.go b/refs/test/generate.go index 6217a96..49619ef 100644 --- a/refs/test/generate.go +++ b/refs/test/generate.go @@ -1,7 +1,8 @@ package refstest import ( - "math/rand" + crand "crypto/rand" + "crypto/sha256" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" ) @@ -21,7 +22,10 @@ func GenerateOwnerID(empty bool) *refs.OwnerID { m := new(refs.OwnerID) if !empty { - m.SetValue([]byte{1, 2, 3}) + id := make([]byte, 25) + _, _ = crand.Read(id) + + m.SetValue(id) } return m @@ -42,7 +46,10 @@ func GenerateObjectID(empty bool) *refs.ObjectID { m := new(refs.ObjectID) if !empty { - m.SetValue([]byte{1, 2, 3}) + id := make([]byte, sha256.Size) + _, _ = crand.Read(id) + + m.SetValue(id) } return m @@ -65,7 +72,10 @@ func GenerateContainerID(empty bool) *refs.ContainerID { m := new(refs.ContainerID) if !empty { - m.SetValue([]byte{1, 2, 3}) + id := make([]byte, sha256.Size) + _, _ = crand.Read(id) + + m.SetValue(id) } return m @@ -88,9 +98,15 @@ func GenerateSignature(empty bool) *refs.Signature { m := new(refs.Signature) if !empty { - m.SetKey([]byte{1}) - m.SetSign([]byte{2}) - m.SetScheme(refs.SignatureScheme(rand.Int31() % 3)) + key := make([]byte, 33) + _, _ = crand.Read(key) + + sign := make([]byte, 65) + _, _ = crand.Read(sign) + + m.SetScheme(refs.ECDSA_SHA512) + m.SetKey(key) + m.SetSign(sign) } return m @@ -100,8 +116,11 @@ func GenerateChecksum(empty bool) *refs.Checksum { m := new(refs.Checksum) if !empty { - m.SetType(1) - m.SetSum([]byte{1, 2, 3}) + cs := make([]byte, sha256.Size) + _, _ = crand.Read(cs) + + m.SetType(refs.SHA256) + m.SetSum(cs) } return m diff --git a/session/test/generate.go b/session/test/generate.go index 561ec01..58084be 100644 --- a/session/test/generate.go +++ b/session/test/generate.go @@ -1,6 +1,7 @@ package sessiontest import ( + crand "crypto/rand" "math/rand" "time" @@ -38,7 +39,10 @@ func GenerateCreateResponseBody(empty bool) *session.CreateResponseBody { m := new(session.CreateResponseBody) if !empty { - m.SetID([]byte{1, 2, 3}) + id := make([]byte, 16) + _, _ = crand.Read(id) + + m.SetID(id) m.SetSessionKey([]byte{4, 5, 6}) } @@ -164,7 +168,10 @@ func GenerateSessionTokenBody(empty bool) *session.TokenBody { m := new(session.TokenBody) if !empty { - m.SetID([]byte{1}) + id := make([]byte, 16) + _, _ = crand.Read(id) + + m.SetID(id) m.SetSessionKey([]byte{2}) m.SetOwnerID(refstest.GenerateOwnerID(false)) m.SetLifetime(GenerateTokenLifetime(false)) diff --git a/tombstone/test/generate.go b/tombstone/test/generate.go index 3caf528..1fab9eb 100644 --- a/tombstone/test/generate.go +++ b/tombstone/test/generate.go @@ -1,6 +1,8 @@ package tombstonetest import ( + "crypto/rand" + refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone" ) @@ -9,8 +11,11 @@ func GenerateTombstone(empty bool) *tombstone.Tombstone { m := new(tombstone.Tombstone) if !empty { + id := make([]byte, 16) + _, _ = rand.Read(id) + m.SetExpirationEpoch(89) - m.SetSplitID([]byte{3, 2, 1}) + m.SetSplitID(id) m.SetMembers(refstest.GenerateObjectIDs(false)) } From c11f50efeccbc68d9c12e9688e739a4f3bc4f301 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 2 Sep 2024 13:39:07 +0300 Subject: [PATCH 148/169] [#112] container: Remove GetExtendedACL Signed-off-by: Aleksey Savchuk --- container/convert.go | 174 ------ container/grpc/service_frostfs.pb.go | 779 ------------------------- container/grpc/service_frostfs_fuzz.go | 38 -- container/grpc/service_frostfs_test.go | 20 - container/grpc/service_grpc.pb.go | 71 +-- container/marshal.go | 68 --- container/message_test.go | 4 - container/test/generate.go | 50 -- container/types.go | 103 ---- rpc/container.go | 16 - signature/body.go | 4 - 11 files changed, 4 insertions(+), 1323 deletions(-) diff --git a/container/convert.go b/container/convert.go index b487f40..ebd4bcc 100644 --- a/container/convert.go +++ b/container/convert.go @@ -1,8 +1,6 @@ package container import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - aclGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" netmapGRPC "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" @@ -764,175 +762,3 @@ func (r *ListResponse) FromGRPCMessage(m grpc.Message) error { return r.ResponseHeaders.FromMessage(v) } - -func (r *GetExtendedACLRequestBody) ToGRPCMessage() grpc.Message { - var m *container.GetExtendedACLRequest_Body - - if r != nil { - m = new(container.GetExtendedACLRequest_Body) - - m.SetContainerId(r.cid.ToGRPCMessage().(*refsGRPC.ContainerID)) - } - - return m -} - -func (r *GetExtendedACLRequestBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.GetExtendedACLRequest_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - cid := v.GetContainerId() - if cid == nil { - r.cid = nil - } else { - if r.cid == nil { - r.cid = new(refs.ContainerID) - } - - err = r.cid.FromGRPCMessage(cid) - } - - return err -} - -func (r *GetExtendedACLRequest) ToGRPCMessage() grpc.Message { - var m *container.GetExtendedACLRequest - - if r != nil { - m = new(container.GetExtendedACLRequest) - - m.SetBody(r.body.ToGRPCMessage().(*container.GetExtendedACLRequest_Body)) - r.RequestHeaders.ToMessage(m) - } - - return m -} - -func (r *GetExtendedACLRequest) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.GetExtendedACLRequest) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - body := v.GetBody() - if body == nil { - r.body = nil - } else { - if r.body == nil { - r.body = new(GetExtendedACLRequestBody) - } - - err = r.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - return r.RequestHeaders.FromMessage(v) -} - -func (r *GetExtendedACLResponseBody) ToGRPCMessage() grpc.Message { - var m *container.GetExtendedACLResponse_Body - - if r != nil { - m = new(container.GetExtendedACLResponse_Body) - - m.SetEacl(r.eacl.ToGRPCMessage().(*aclGRPC.EACLTable)) - m.SetSignature(toSignatureRFC6979(r.sig)) - m.SetSessionToken(r.token.ToGRPCMessage().(*sessionGRPC.SessionToken)) - } - - return m -} - -func (r *GetExtendedACLResponseBody) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.GetExtendedACLResponse_Body) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - eacl := v.GetEacl() - if eacl == nil { - r.eacl = nil - } else { - if r.eacl == nil { - r.eacl = new(acl.Table) - } - - err = r.eacl.FromGRPCMessage(eacl) - if err != nil { - return err - } - } - - sig := v.GetSignature() - if sig == nil { - r.sig = nil - } else { - if r.sig == nil { - r.sig = new(refs.Signature) - } - - r.sig.SetKey(sig.GetKey()) - r.sig.SetSign(sig.GetSign()) - } - - token := v.GetSessionToken() - if token == nil { - r.token = nil - } else { - if r.token == nil { - r.token = new(session.Token) - } - - err = r.token.FromGRPCMessage(token) - } - - return err -} - -func (r *GetExtendedACLResponse) ToGRPCMessage() grpc.Message { - var m *container.GetExtendedACLResponse - - if r != nil { - m = new(container.GetExtendedACLResponse) - - m.SetBody(r.body.ToGRPCMessage().(*container.GetExtendedACLResponse_Body)) - r.ResponseHeaders.ToMessage(m) - } - - return m -} - -func (r *GetExtendedACLResponse) FromGRPCMessage(m grpc.Message) error { - v, ok := m.(*container.GetExtendedACLResponse) - if !ok { - return message.NewUnexpectedMessageType(m, v) - } - - var err error - - body := v.GetBody() - if body == nil { - r.body = nil - } else { - if r.body == nil { - r.body = new(GetExtendedACLResponseBody) - } - - err = r.body.FromGRPCMessage(body) - if err != nil { - return err - } - } - - return r.ResponseHeaders.FromMessage(v) -} diff --git a/container/grpc/service_frostfs.pb.go b/container/grpc/service_frostfs.pb.go index f38b0de..ffdc730 100644 --- a/container/grpc/service_frostfs.pb.go +++ b/container/grpc/service_frostfs.pb.go @@ -5,7 +5,6 @@ package container import ( json "encoding/json" fmt "fmt" - grpc2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc" grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc" grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc" pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool" @@ -2966,781 +2965,3 @@ func (x *ListResponse) UnmarshalEasyJSON(in *jlexer.Lexer) { in.Consumed() } } - -type GetExtendedACLRequest_Body struct { - ContainerId *grpc.ContainerID `json:"containerId"` -} - -var ( - _ encoding.ProtoMarshaler = (*GetExtendedACLRequest_Body)(nil) - _ encoding.ProtoUnmarshaler = (*GetExtendedACLRequest_Body)(nil) - _ json.Marshaler = (*GetExtendedACLRequest_Body)(nil) - _ json.Unmarshaler = (*GetExtendedACLRequest_Body)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *GetExtendedACLRequest_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.ContainerId) - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *GetExtendedACLRequest_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 *GetExtendedACLRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.ContainerId != nil { - x.ContainerId.EmitProtobuf(mm.AppendMessage(1)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *GetExtendedACLRequest_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", "GetExtendedACLRequest_Body") - } - switch fc.FieldNum { - case 1: // ContainerId - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "ContainerId") - } - x.ContainerId = new(grpc.ContainerID) - if err := x.ContainerId.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - } - } - return nil -} -func (x *GetExtendedACLRequest_Body) GetContainerId() *grpc.ContainerID { - if x != nil { - return x.ContainerId - } - return nil -} -func (x *GetExtendedACLRequest_Body) SetContainerId(v *grpc.ContainerID) { - x.ContainerId = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *GetExtendedACLRequest_Body) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *GetExtendedACLRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - out.RawByte('{') - { - const prefix string = ",\"containerId\":" - out.RawString(prefix[1:]) - x.ContainerId.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *GetExtendedACLRequest_Body) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *GetExtendedACLRequest_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 "containerId": - { - var f *grpc.ContainerID - f = new(grpc.ContainerID) - f.UnmarshalEasyJSON(in) - x.ContainerId = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type GetExtendedACLRequest struct { - Body *GetExtendedACLRequest_Body `json:"body"` - MetaHeader *grpc1.RequestMetaHeader `json:"metaHeader"` - VerifyHeader *grpc1.RequestVerificationHeader `json:"verifyHeader"` -} - -var ( - _ encoding.ProtoMarshaler = (*GetExtendedACLRequest)(nil) - _ encoding.ProtoUnmarshaler = (*GetExtendedACLRequest)(nil) - _ json.Marshaler = (*GetExtendedACLRequest)(nil) - _ json.Unmarshaler = (*GetExtendedACLRequest)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *GetExtendedACLRequest) 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 *GetExtendedACLRequest) 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 *GetExtendedACLRequest) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().MarshalProtobuf(buf), nil -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *GetExtendedACLRequest) 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 *GetExtendedACLRequest) 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 *GetExtendedACLRequest) 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", "GetExtendedACLRequest") - } - switch fc.FieldNum { - case 1: // Body - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Body") - } - x.Body = new(GetExtendedACLRequest_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 *GetExtendedACLRequest) GetBody() *GetExtendedACLRequest_Body { - if x != nil { - return x.Body - } - return nil -} -func (x *GetExtendedACLRequest) SetBody(v *GetExtendedACLRequest_Body) { - x.Body = v -} -func (x *GetExtendedACLRequest) GetMetaHeader() *grpc1.RequestMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} -func (x *GetExtendedACLRequest) SetMetaHeader(v *grpc1.RequestMetaHeader) { - x.MetaHeader = v -} -func (x *GetExtendedACLRequest) GetVerifyHeader() *grpc1.RequestVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} -func (x *GetExtendedACLRequest) SetVerifyHeader(v *grpc1.RequestVerificationHeader) { - x.VerifyHeader = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *GetExtendedACLRequest) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *GetExtendedACLRequest) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - out.RawByte('{') - { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) - } - { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *GetExtendedACLRequest) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *GetExtendedACLRequest) 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 *GetExtendedACLRequest_Body - f = new(GetExtendedACLRequest_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 GetExtendedACLResponse_Body struct { - Eacl *grpc2.EACLTable `json:"eacl"` - Signature *grpc.SignatureRFC6979 `json:"signature"` - SessionToken *grpc1.SessionToken `json:"sessionToken"` -} - -var ( - _ encoding.ProtoMarshaler = (*GetExtendedACLResponse_Body)(nil) - _ encoding.ProtoUnmarshaler = (*GetExtendedACLResponse_Body)(nil) - _ json.Marshaler = (*GetExtendedACLResponse_Body)(nil) - _ json.Unmarshaler = (*GetExtendedACLResponse_Body)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *GetExtendedACLResponse_Body) StableSize() (size int) { - if x == nil { - return 0 - } - size += proto.NestedStructureSize(1, x.Eacl) - size += proto.NestedStructureSize(2, x.Signature) - size += proto.NestedStructureSize(3, x.SessionToken) - return size -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *GetExtendedACLResponse_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 *GetExtendedACLResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) { - if x == nil { - return - } - if x.Eacl != nil { - x.Eacl.EmitProtobuf(mm.AppendMessage(1)) - } - if x.Signature != nil { - x.Signature.EmitProtobuf(mm.AppendMessage(2)) - } - if x.SessionToken != nil { - x.SessionToken.EmitProtobuf(mm.AppendMessage(3)) - } -} - -// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface. -func (x *GetExtendedACLResponse_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", "GetExtendedACLResponse_Body") - } - switch fc.FieldNum { - case 1: // Eacl - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Eacl") - } - x.Eacl = new(grpc2.EACLTable) - if err := x.Eacl.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 2: // Signature - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Signature") - } - x.Signature = new(grpc.SignatureRFC6979) - if err := x.Signature.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - case 3: // SessionToken - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "SessionToken") - } - x.SessionToken = new(grpc1.SessionToken) - if err := x.SessionToken.UnmarshalProtobuf(data); err != nil { - return fmt.Errorf("unmarshal: %w", err) - } - } - } - return nil -} -func (x *GetExtendedACLResponse_Body) GetEacl() *grpc2.EACLTable { - if x != nil { - return x.Eacl - } - return nil -} -func (x *GetExtendedACLResponse_Body) SetEacl(v *grpc2.EACLTable) { - x.Eacl = v -} -func (x *GetExtendedACLResponse_Body) GetSignature() *grpc.SignatureRFC6979 { - if x != nil { - return x.Signature - } - return nil -} -func (x *GetExtendedACLResponse_Body) SetSignature(v *grpc.SignatureRFC6979) { - x.Signature = v -} -func (x *GetExtendedACLResponse_Body) GetSessionToken() *grpc1.SessionToken { - if x != nil { - return x.SessionToken - } - return nil -} -func (x *GetExtendedACLResponse_Body) SetSessionToken(v *grpc1.SessionToken) { - x.SessionToken = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *GetExtendedACLResponse_Body) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *GetExtendedACLResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - out.RawByte('{') - { - const prefix string = ",\"eacl\":" - out.RawString(prefix[1:]) - x.Eacl.MarshalEasyJSON(out) - } - { - const prefix string = ",\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) - } - { - const prefix string = ",\"sessionToken\":" - out.RawString(prefix) - x.SessionToken.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *GetExtendedACLResponse_Body) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *GetExtendedACLResponse_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 "eacl": - { - var f *grpc2.EACLTable - f = new(grpc2.EACLTable) - f.UnmarshalEasyJSON(in) - x.Eacl = f - } - case "signature": - { - var f *grpc.SignatureRFC6979 - f = new(grpc.SignatureRFC6979) - f.UnmarshalEasyJSON(in) - x.Signature = f - } - case "sessionToken": - { - var f *grpc1.SessionToken - f = new(grpc1.SessionToken) - f.UnmarshalEasyJSON(in) - x.SessionToken = f - } - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} - -type GetExtendedACLResponse struct { - Body *GetExtendedACLResponse_Body `json:"body"` - MetaHeader *grpc1.ResponseMetaHeader `json:"metaHeader"` - VerifyHeader *grpc1.ResponseVerificationHeader `json:"verifyHeader"` -} - -var ( - _ encoding.ProtoMarshaler = (*GetExtendedACLResponse)(nil) - _ encoding.ProtoUnmarshaler = (*GetExtendedACLResponse)(nil) - _ json.Marshaler = (*GetExtendedACLResponse)(nil) - _ json.Unmarshaler = (*GetExtendedACLResponse)(nil) -) - -// StableSize returns the size of x in protobuf format. -// -// Structures with the same field values have the same binary size. -func (x *GetExtendedACLResponse) 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 *GetExtendedACLResponse) 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 *GetExtendedACLResponse) ReadSignedData(buf []byte) ([]byte, error) { - return x.GetBody().MarshalProtobuf(buf), nil -} - -// MarshalProtobuf implements the encoding.ProtoMarshaler interface. -func (x *GetExtendedACLResponse) 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 *GetExtendedACLResponse) 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 *GetExtendedACLResponse) 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", "GetExtendedACLResponse") - } - switch fc.FieldNum { - case 1: // Body - data, ok := fc.MessageData() - if !ok { - return fmt.Errorf("cannot unmarshal field %s", "Body") - } - x.Body = new(GetExtendedACLResponse_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 *GetExtendedACLResponse) GetBody() *GetExtendedACLResponse_Body { - if x != nil { - return x.Body - } - return nil -} -func (x *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponse_Body) { - x.Body = v -} -func (x *GetExtendedACLResponse) GetMetaHeader() *grpc1.ResponseMetaHeader { - if x != nil { - return x.MetaHeader - } - return nil -} -func (x *GetExtendedACLResponse) SetMetaHeader(v *grpc1.ResponseMetaHeader) { - x.MetaHeader = v -} -func (x *GetExtendedACLResponse) GetVerifyHeader() *grpc1.ResponseVerificationHeader { - if x != nil { - return x.VerifyHeader - } - return nil -} -func (x *GetExtendedACLResponse) SetVerifyHeader(v *grpc1.ResponseVerificationHeader) { - x.VerifyHeader = v -} - -// MarshalJSON implements the json.Marshaler interface. -func (x *GetExtendedACLResponse) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - x.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} -func (x *GetExtendedACLResponse) MarshalEasyJSON(out *jwriter.Writer) { - if x == nil { - out.RawString("null") - return - } - out.RawByte('{') - { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) - } - { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) - } - { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (x *GetExtendedACLResponse) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - x.UnmarshalEasyJSON(&r) - return r.Error() -} -func (x *GetExtendedACLResponse) 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 *GetExtendedACLResponse_Body - f = new(GetExtendedACLResponse_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() - } -} diff --git a/container/grpc/service_frostfs_fuzz.go b/container/grpc/service_frostfs_fuzz.go index 496a2d6..7e6d6e6 100644 --- a/container/grpc/service_frostfs_fuzz.go +++ b/container/grpc/service_frostfs_fuzz.go @@ -157,41 +157,3 @@ func DoFuzzJSONListResponse(data []byte) int { } return 1 } -func DoFuzzProtoGetExtendedACLRequest(data []byte) int { - msg := new(GetExtendedACLRequest) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONGetExtendedACLRequest(data []byte) int { - msg := new(GetExtendedACLRequest) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} -func DoFuzzProtoGetExtendedACLResponse(data []byte) int { - msg := new(GetExtendedACLResponse) - if err := msg.UnmarshalProtobuf(data); err != nil { - return 0 - } - _ = msg.MarshalProtobuf(nil) - return 1 -} -func DoFuzzJSONGetExtendedACLResponse(data []byte) int { - msg := new(GetExtendedACLResponse) - if err := msg.UnmarshalJSON(data); err != nil { - return 0 - } - _, err := msg.MarshalJSON() - if err != nil { - panic(err) - } - return 1 -} diff --git a/container/grpc/service_frostfs_test.go b/container/grpc/service_frostfs_test.go index 05eb48a..804b89c 100644 --- a/container/grpc/service_frostfs_test.go +++ b/container/grpc/service_frostfs_test.go @@ -89,23 +89,3 @@ func FuzzJSONListResponse(f *testing.F) { DoFuzzJSONListResponse(data) }) } -func FuzzProtoGetExtendedACLRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoGetExtendedACLRequest(data) - }) -} -func FuzzJSONGetExtendedACLRequest(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONGetExtendedACLRequest(data) - }) -} -func FuzzProtoGetExtendedACLResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzProtoGetExtendedACLResponse(data) - }) -} -func FuzzJSONGetExtendedACLResponse(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - DoFuzzJSONGetExtendedACLResponse(data) - }) -} diff --git a/container/grpc/service_grpc.pb.go b/container/grpc/service_grpc.pb.go index 939a978..abb0fef 100644 --- a/container/grpc/service_grpc.pb.go +++ b/container/grpc/service_grpc.pb.go @@ -19,11 +19,10 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - ContainerService_Put_FullMethodName = "/neo.fs.v2.container.ContainerService/Put" - ContainerService_Delete_FullMethodName = "/neo.fs.v2.container.ContainerService/Delete" - ContainerService_Get_FullMethodName = "/neo.fs.v2.container.ContainerService/Get" - ContainerService_List_FullMethodName = "/neo.fs.v2.container.ContainerService/List" - ContainerService_GetExtendedACL_FullMethodName = "/neo.fs.v2.container.ContainerService/GetExtendedACL" + ContainerService_Put_FullMethodName = "/neo.fs.v2.container.ContainerService/Put" + ContainerService_Delete_FullMethodName = "/neo.fs.v2.container.ContainerService/Delete" + ContainerService_Get_FullMethodName = "/neo.fs.v2.container.ContainerService/Get" + ContainerService_List_FullMethodName = "/neo.fs.v2.container.ContainerService/List" ) // ContainerServiceClient is the client API for ContainerService service. @@ -74,20 +73,6 @@ type ContainerServiceClient interface { // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // container list access denied. List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) - // Returns Extended ACL table and signature from `Container` smart contract - // storage. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container eACL is denied. - GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) } type containerServiceClient struct { @@ -134,15 +119,6 @@ func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts return out, nil } -func (c *containerServiceClient) GetExtendedACL(ctx context.Context, in *GetExtendedACLRequest, opts ...grpc.CallOption) (*GetExtendedACLResponse, error) { - out := new(GetExtendedACLResponse) - err := c.cc.Invoke(ctx, ContainerService_GetExtendedACL_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // ContainerServiceServer is the server API for ContainerService service. // All implementations should embed UnimplementedContainerServiceServer // for forward compatibility @@ -191,20 +167,6 @@ type ContainerServiceServer interface { // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // container list access denied. List(context.Context, *ListRequest) (*ListResponse, error) - // Returns Extended ACL table and signature from `Container` smart contract - // storage. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container eACL is denied. - GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) } // UnimplementedContainerServiceServer should be embedded to have forward compatible implementations. @@ -223,9 +185,6 @@ 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) GetExtendedACL(context.Context, *GetExtendedACLRequest) (*GetExtendedACLResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExtendedACL not implemented") -} // 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 @@ -310,24 +269,6 @@ func _ContainerService_List_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _ContainerService_GetExtendedACL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExtendedACLRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainerServiceServer).GetExtendedACL(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ContainerService_GetExtendedACL_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainerServiceServer).GetExtendedACL(ctx, req.(*GetExtendedACLRequest)) - } - return interceptor(ctx, in, info, handler) -} - // ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -351,10 +292,6 @@ var ContainerService_ServiceDesc = grpc.ServiceDesc{ MethodName: "List", Handler: _ContainerService_List_Handler, }, - { - MethodName: "GetExtendedACL", - Handler: _ContainerService_GetExtendedACL_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "container/grpc/service.proto", diff --git a/container/marshal.go b/container/marshal.go index ff17150..7c9b8ef 100644 --- a/container/marshal.go +++ b/container/marshal.go @@ -34,12 +34,6 @@ const ( listReqBodyOwnerField = 1 listRespBodyIDsField = 1 - - getEACLReqBodyIDField = 1 - - getEACLRespBodyTableField = 1 - getEACLRespBodySignatureField = 2 - getEACLRespBodyTokenField = 3 ) func (a *Attribute) StableMarshal(buf []byte) []byte { @@ -349,65 +343,3 @@ func (r *ListResponseBody) StableSize() (size int) { func (r *ListResponseBody) Unmarshal(data []byte) error { return message.Unmarshal(r, data, new(container.ListResponse_Body)) } - -func (r *GetExtendedACLRequestBody) StableMarshal(buf []byte) []byte { - if r == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, r.StableSize()) - } - - protoutil.NestedStructureMarshal(getEACLReqBodyIDField, buf, r.cid) - - return buf -} - -func (r *GetExtendedACLRequestBody) StableSize() (size int) { - if r == nil { - return 0 - } - - size += protoutil.NestedStructureSize(getEACLReqBodyIDField, r.cid) - - return size -} - -func (r *GetExtendedACLRequestBody) Unmarshal(data []byte) error { - return message.Unmarshal(r, data, new(container.GetExtendedACLRequest_Body)) -} - -func (r *GetExtendedACLResponseBody) StableMarshal(buf []byte) []byte { - if r == nil { - return []byte{} - } - - if buf == nil { - buf = make([]byte, r.StableSize()) - } - - var offset int - - offset += protoutil.NestedStructureMarshal(getEACLRespBodyTableField, buf[offset:], r.eacl) - offset += protoutil.NestedStructureMarshal(getEACLRespBodySignatureField, buf[offset:], r.sig) - protoutil.NestedStructureMarshal(getEACLRespBodyTokenField, buf[offset:], r.token) - - return buf -} - -func (r *GetExtendedACLResponseBody) StableSize() (size int) { - if r == nil { - return 0 - } - - size += protoutil.NestedStructureSize(getEACLRespBodyTableField, r.eacl) - size += protoutil.NestedStructureSize(getEACLRespBodySignatureField, r.sig) - size += protoutil.NestedStructureSize(getEACLRespBodyTokenField, r.token) - - return size -} - -func (r *GetExtendedACLResponseBody) Unmarshal(data []byte) error { - return message.Unmarshal(r, data, new(container.GetExtendedACLResponse_Body)) -} diff --git a/container/message_test.go b/container/message_test.go index 6558e25..da99331 100644 --- a/container/message_test.go +++ b/container/message_test.go @@ -32,9 +32,5 @@ func TestMessageConvert(t *testing.T) { func(empty bool) message.Message { return containertest.GenerateGetRequest(empty) }, func(empty bool) message.Message { return containertest.GenerateGetResponseBody(empty) }, func(empty bool) message.Message { return containertest.GenerateGetResponse(empty) }, - func(empty bool) message.Message { return containertest.GenerateGetExtendedACLRequestBody(empty) }, - func(empty bool) message.Message { return containertest.GenerateGetExtendedACLRequest(empty) }, - func(empty bool) message.Message { return containertest.GenerateGetExtendedACLResponseBody(empty) }, - func(empty bool) message.Message { return containertest.GenerateGetExtendedACLResponse(empty) }, ) } diff --git a/container/test/generate.go b/container/test/generate.go index 23ad3a1..fb5c9e6 100644 --- a/container/test/generate.go +++ b/container/test/generate.go @@ -3,7 +3,6 @@ package containertest import ( "crypto/rand" - acltest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/test" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" netmaptest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/test" refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test" @@ -239,52 +238,3 @@ func GenerateListResponse(empty bool) *container.ListResponse { return m } - -func GenerateGetExtendedACLRequestBody(empty bool) *container.GetExtendedACLRequestBody { - m := new(container.GetExtendedACLRequestBody) - - if !empty { - m.SetContainerID(refstest.GenerateContainerID(false)) - } - - return m -} - -func GenerateGetExtendedACLRequest(empty bool) *container.GetExtendedACLRequest { - m := new(container.GetExtendedACLRequest) - - if !empty { - m.SetBody(GenerateGetExtendedACLRequestBody(false)) - } - - m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) - m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) - - return m -} - -func GenerateGetExtendedACLResponseBody(empty bool) *container.GetExtendedACLResponseBody { - m := new(container.GetExtendedACLResponseBody) - - if !empty { - m.SetEACL(acltest.GenerateTable(false)) - } - - m.SetSignature(refstest.GenerateSignature(empty)) - m.SetSessionToken(sessiontest.GenerateSessionToken(empty)) - - return m -} - -func GenerateGetExtendedACLResponse(empty bool) *container.GetExtendedACLResponse { - m := new(container.GetExtendedACLResponse) - - if !empty { - m.SetBody(GenerateGetExtendedACLResponseBody(false)) - } - - m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) - m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) - - return m -} diff --git a/container/types.go b/container/types.go index 3a9e915..6adc57b 100644 --- a/container/types.go +++ b/container/types.go @@ -1,7 +1,6 @@ package container import ( - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" @@ -110,30 +109,6 @@ type ListResponse struct { session.ResponseHeaders } -type GetExtendedACLRequestBody struct { - cid *refs.ContainerID -} - -type GetExtendedACLRequest struct { - body *GetExtendedACLRequestBody - - session.RequestHeaders -} - -type GetExtendedACLResponseBody struct { - eacl *acl.Table - - sig *refs.Signature - - token *session.Token -} - -type GetExtendedACLResponse struct { - body *GetExtendedACLResponseBody - - session.ResponseHeaders -} - func (a *Attribute) GetKey() string { if a != nil { return a.key @@ -469,81 +444,3 @@ func (r *ListResponse) GetBody() *ListResponseBody { func (r *ListResponse) SetBody(v *ListResponseBody) { r.body = v } - -func (r *GetExtendedACLRequestBody) GetContainerID() *refs.ContainerID { - if r != nil { - return r.cid - } - - return nil -} - -func (r *GetExtendedACLRequestBody) SetContainerID(v *refs.ContainerID) { - r.cid = v -} - -func (r *GetExtendedACLRequest) GetBody() *GetExtendedACLRequestBody { - if r != nil { - return r.body - } - - return nil -} - -func (r *GetExtendedACLRequest) SetBody(v *GetExtendedACLRequestBody) { - r.body = v -} - -func (r *GetExtendedACLResponseBody) GetEACL() *acl.Table { - if r != nil { - return r.eacl - } - - return nil -} - -func (r *GetExtendedACLResponseBody) SetEACL(v *acl.Table) { - r.eacl = v -} - -func (r *GetExtendedACLResponseBody) GetSignature() *refs.Signature { - if r != nil { - return r.sig - } - - return nil -} - -func (r *GetExtendedACLResponseBody) SetSignature(v *refs.Signature) { - // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) - v.SetScheme(0) - r.sig = v -} - -// GetSessionToken returns token of the session within which requested -// eACL table was set. -func (r *GetExtendedACLResponseBody) GetSessionToken() *session.Token { - if r != nil { - return r.token - } - - return nil -} - -// SetSessionToken sets token of the session within which requested -// eACL table was set. -func (r *GetExtendedACLResponseBody) SetSessionToken(v *session.Token) { - r.token = v -} - -func (r *GetExtendedACLResponse) GetBody() *GetExtendedACLResponseBody { - if r != nil { - return r.body - } - - return nil -} - -func (r *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponseBody) { - r.body = v -} diff --git a/rpc/container.go b/rpc/container.go index 39213f6..b1d4a68 100644 --- a/rpc/container.go +++ b/rpc/container.go @@ -80,19 +80,3 @@ func ListContainers( return resp, nil } - -// GetEACL executes ContainerService.GetExtendedACL RPC. -func GetEACL( - cli *client.Client, - req *container.GetExtendedACLRequest, - opts ...client.CallOption, -) (*container.GetExtendedACLResponse, error) { - resp := new(container.GetExtendedACLResponse) - - err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceContainer, rpcContainerGetEACL), req, resp, opts...) - if err != nil { - return nil, err - } - - return resp, nil -} diff --git a/signature/body.go b/signature/body.go index 4b43b84..b1a5904 100644 --- a/signature/body.go +++ b/signature/body.go @@ -46,10 +46,6 @@ func serviceMessageBody(req any) stableMarshaler { return v.GetBody() case *container.ListResponse: return v.GetBody() - case *container.GetExtendedACLRequest: - return v.GetBody() - case *container.GetExtendedACLResponse: - return v.GetBody() /* Object */ case *object.PutRequest: From 7d71556eee2d8a1b3efc3e3e0083a5edb1dda798 Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 4 Sep 2024 12:45:32 +0300 Subject: [PATCH 149/169] [#113] pre-commit: Update golangci-lint to v1.60.3 Signed-off-by: Ekaterina Lebedeva --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a64cbaa..d20db47 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,6 +37,6 @@ repos: language: system - repo: https://github.com/golangci/golangci-lint - rev: v1.56.2 + rev: v1.60.3 hooks: - id: golangci-lint From bd588fa2e5d1c2d398f1f602692b867dcca154a1 Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 4 Sep 2024 15:44:59 +0300 Subject: [PATCH 150/169] [#113] go.mod: Use range over int Since Go 1.22 a `for` statement with a `range` clause is able to iterate through integer values from zero to an upper limit. gopatch script: @@ var i, e expression @@ -for i := 0; i <= e - 1; i++ { +for i := range e { ... } @@ var i, e expression @@ -for i := 0; i <= e; i++ { +for i := range e + 1 { ... } @@ var i, e expression @@ -for i := 0; i < e; i++ { +for i := range e { ... } Signed-off-by: Ekaterina Lebedeva --- acl/bench_test.go | 4 ++-- netmap/convert.go | 4 ++-- object/bench_test.go | 4 ++-- refs/bench_test.go | 6 +++--- signature/sign_test.go | 4 ++-- status/convert.go | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/acl/bench_test.go b/acl/bench_test.go index 8d6352b..85dbf7d 100644 --- a/acl/bench_test.go +++ b/acl/bench_test.go @@ -32,7 +32,7 @@ func BenchmarkTable_ToGRPCMessage(b *testing.B) { b.Run("to grpc message", func(b *testing.B) { b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { raw := tb.ToGRPCMessage() if len(tb.GetRecords()) != len(raw.(*aclGrpc.EACLTable).Records) { b.FailNow() @@ -41,7 +41,7 @@ func BenchmarkTable_ToGRPCMessage(b *testing.B) { }) b.Run("from grpc message", func(b *testing.B) { b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { tb := new(acl.Table) if tb.FromGRPCMessage(raw) != nil { b.FailNow() diff --git a/netmap/convert.go b/netmap/convert.go index 659b798..bae309f 100644 --- a/netmap/convert.go +++ b/netmap/convert.go @@ -525,7 +525,7 @@ func (x *NetworkConfig) ToGRPCMessage() grpc.Message { if ln := len(x.ps); ln > 0 { ps = make([]netmap.NetworkConfig_Parameter, 0, ln) - for i := 0; i < ln; i++ { + for i := range ln { ps = append(ps, *x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter)) } } @@ -552,7 +552,7 @@ func (x *NetworkConfig) FromGRPCMessage(m grpc.Message) error { ps = make([]NetworkParameter, ln) - for i := 0; i < ln; i++ { + for i := range ln { if err := ps[i].FromGRPCMessage(&psV2[i]); err != nil { return err } diff --git a/object/bench_test.go b/object/bench_test.go index 90fab73..b29b1d1 100644 --- a/object/bench_test.go +++ b/object/bench_test.go @@ -26,7 +26,7 @@ func BenchmarkAttributesMarshal(b *testing.B) { b.Run("marshal", func(b *testing.B) { b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { res := AttributesToGRPC(attrs) if len(res) != len(raw) { b.FailNow() @@ -35,7 +35,7 @@ func BenchmarkAttributesMarshal(b *testing.B) { }) b.Run("unmarshal", func(b *testing.B) { b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { res, err := AttributesFromGRPC(raw) if err != nil || len(res) != len(raw) { b.FailNow() diff --git a/refs/bench_test.go b/refs/bench_test.go index b24e674..40784c6 100644 --- a/refs/bench_test.go +++ b/refs/bench_test.go @@ -24,7 +24,7 @@ func benchmarkObjectIDSlice(b *testing.B, size int) { b.Run("to grpc message", func(b *testing.B) { b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { raw := ObjectIDListToGRPCMessage(ids) if len(raw) != len(ids) { b.FailNow() @@ -33,7 +33,7 @@ func benchmarkObjectIDSlice(b *testing.B, size int) { }) b.Run("from grpc message", func(b *testing.B) { b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { ids, err := ObjectIDListFromGRPCMessage(raw) if err != nil || len(raw) != len(ids) { b.FailNow() @@ -42,7 +42,7 @@ func benchmarkObjectIDSlice(b *testing.B, size int) { }) b.Run("marshal", func(b *testing.B) { b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { buf := make([]byte, ObjectIDNestedListSize(1, ids)) n := ObjectIDNestedListMarshal(1, buf, ids) if n != len(buf) { diff --git a/signature/sign_test.go b/signature/sign_test.go index c013525..b606c27 100644 --- a/signature/sign_test.go +++ b/signature/sign_test.go @@ -77,7 +77,7 @@ func BenchmarkSignRequest(b *testing.B) { b.ResetTimer() b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { b.StopTimer() dec := new(accounting.Decimal) dec.SetValue(100) @@ -103,7 +103,7 @@ func BenchmarkVerifyRequest(b *testing.B) { b.ResetTimer() b.ReportAllocs() - for i := 0; i < b.N; i++ { + for range b.N { b.StopTimer() dec := new(accounting.Decimal) dec.SetValue(100) diff --git a/status/convert.go b/status/convert.go index 3c5b5bf..6b34084 100644 --- a/status/convert.go +++ b/status/convert.go @@ -53,7 +53,7 @@ func (x *Status) ToGRPCMessage() grpc.Message { if ln := len(x.details); ln > 0 { ds = make([]status.Status_Detail, 0, ln) - for i := 0; i < ln; i++ { + for i := range ln { ds = append(ds, *x.details[i].ToGRPCMessage().(*status.Status_Detail)) } } @@ -80,7 +80,7 @@ func (x *Status) FromGRPCMessage(m grpc.Message) error { ds = make([]Detail, ln) - for i := 0; i < ln; i++ { + for i := range ln { if err := ds[i].FromGRPCMessage(&dsV2[i]); err != nil { return err } From 9c0007fb1d787b42d00e40ead6fb67f1c12128b4 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Fri, 6 Sep 2024 11:39:23 +0300 Subject: [PATCH 151/169] [#115] apemanager: Fix type getters * Add type instance check for nil to avoid panic by accessing fields. Signed-off-by: Airat Arifullin --- acl/types.go | 8 +++++++ ape/types.go | 8 +++++++ apemanager/types.go | 52 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) diff --git a/acl/types.go b/acl/types.go index b42528b..960d8c9 100644 --- a/acl/types.go +++ b/acl/types.go @@ -330,10 +330,18 @@ func (bt *BearerTokenBody) SetEACL(v *Table) { } func (t *APEOverride) GetTarget() *ape.ChainTarget { + if t == nil { + return nil + } + return t.target } func (t *APEOverride) GetChains() []*ape.Chain { + if t == nil { + return nil + } + return t.chains } diff --git a/ape/types.go b/ape/types.go index 935a5ea..467a441 100644 --- a/ape/types.go +++ b/ape/types.go @@ -53,6 +53,10 @@ func (c *Chain) SetKind(kind chainKind) { } func (c *Chain) GetKind() chainKind { + if c == nil { + return nil + } + return c.kind } @@ -67,5 +71,9 @@ func (c *ChainRaw) SetRaw(raw []byte) { } func (c *ChainRaw) GetRaw() []byte { + if c == nil { + return nil + } + return c.Raw } diff --git a/apemanager/types.go b/apemanager/types.go index 21edf85..b6c3912 100644 --- a/apemanager/types.go +++ b/apemanager/types.go @@ -16,6 +16,10 @@ func (r *AddChainRequest) SetBody(body *AddChainRequestBody) { } func (r *AddChainRequest) GetBody() *AddChainRequestBody { + if r == nil { + return nil + } + return r.body } @@ -30,6 +34,10 @@ func (rb *AddChainRequestBody) SetTarget(target *ape.ChainTarget) { } func (rb *AddChainRequestBody) GetTarget() *ape.ChainTarget { + if rb == nil { + return nil + } + return rb.target } @@ -38,6 +46,10 @@ func (rb *AddChainRequestBody) SetChain(chain *ape.Chain) { } func (rb *AddChainRequestBody) GetChain() *ape.Chain { + if rb == nil { + return nil + } + return rb.chain } @@ -52,6 +64,10 @@ func (r *AddChainResponse) SetBody(body *AddChainResponseBody) { } func (r *AddChainResponse) GetBody() *AddChainResponseBody { + if r == nil { + return nil + } + return r.body } @@ -64,6 +80,10 @@ func (rb *AddChainResponseBody) SetChainID(chainID []byte) { } func (rb *AddChainResponseBody) GetChainID() []byte { + if rb == nil { + return nil + } + return rb.chainID } @@ -78,6 +98,10 @@ func (r *RemoveChainRequest) SetBody(body *RemoveChainRequestBody) { } func (r *RemoveChainRequest) GetBody() *RemoveChainRequestBody { + if r == nil { + return nil + } + return r.body } @@ -92,6 +116,10 @@ func (rb *RemoveChainRequestBody) SetTarget(target *ape.ChainTarget) { } func (rb *RemoveChainRequestBody) GetTarget() *ape.ChainTarget { + if rb == nil { + return nil + } + return rb.target } @@ -100,6 +128,10 @@ func (rb *RemoveChainRequestBody) SetChainID(chainID []byte) { } func (rb *RemoveChainRequestBody) GetChainID() []byte { + if rb == nil { + return nil + } + return rb.chainID } @@ -116,6 +148,10 @@ func (r *RemoveChainResponse) SetBody(body *RemoveChainResponseBody) { } func (r *RemoveChainResponse) GetBody() *RemoveChainResponseBody { + if r == nil { + return nil + } + return r.body } @@ -130,6 +166,10 @@ func (r *ListChainsRequest) SetBody(body *ListChainsRequestBody) { } func (r *ListChainsRequest) GetBody() *ListChainsRequestBody { + if r == nil { + return nil + } + return r.body } @@ -142,6 +182,10 @@ func (rb *ListChainsRequestBody) SetTarget(target *ape.ChainTarget) { } func (rb *ListChainsRequestBody) GetTarget() *ape.ChainTarget { + if rb == nil { + return nil + } + return rb.target } @@ -156,6 +200,10 @@ func (r *ListChainsResponse) SetBody(body *ListChainsResponseBody) { } func (r *ListChainsResponse) GetBody() *ListChainsResponseBody { + if r == nil { + return nil + } + return r.body } @@ -170,5 +218,9 @@ func (r *ListChainsResponseBody) SetChains(chains []*ape.Chain) { } func (r *ListChainsResponseBody) GetChains() []*ape.Chain { + if r == nil { + return nil + } + return r.chains } From 0484647aaecdc04485f12d80a8ff31123b89fe23 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Fri, 6 Sep 2024 12:13:18 +0300 Subject: [PATCH 152/169] [#115] netmap: Fix type getters * Add type instance check for nil to avoid panic by accessing fields. Signed-off-by: Airat Arifullin --- netmap/types.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netmap/types.go b/netmap/types.go index 1fcdc6e..7821385 100644 --- a/netmap/types.go +++ b/netmap/types.go @@ -335,6 +335,10 @@ func (p *PlacementPolicy) SetContainerBackupFactor(backupFactor uint32) { } func (p *PlacementPolicy) GetReplicas() []Replica { + if p == nil { + return nil + } + return p.replicas } From c49c482ba6601d8c14334e48db70f462f549fe77 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Wed, 11 Sep 2024 13:05:54 +0300 Subject: [PATCH 153/169] [#116] Update obsolete URLs Signed-off-by: Vitaliy Potyarkin --- CHANGELOG.md | 2 +- CONTRIBUTING.md | 10 +++++----- README.md | 14 ++++++-------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77bf5a2..5baefc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,4 +47,4 @@ Initial public release. This project is a fork of [NeoFS](https://github.com/nspcc-dev/neofs-api-go) from version v2.14.0. To see CHANGELOG for older versions, refer to https://github.com/nspcc-dev/neofs-api-go/blob/master/CHANGELOG.md. -[Unreleased]: https://github.com/TrueCloudLab/compare/v2.15.0...master +[Unreleased]: https://git.frostfs.info/TrueCloudLab/frostfs-api-go/compare/v2.16.0...master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index baa7725..dd360b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,8 +3,8 @@ First, thank you for contributing! We love and encourage pull requests from everyone. Please follow the guidelines: -- Check the open [issues](https://github.com/TrueCloudLab/frostfs-api-go/issues) and - [pull requests](https://github.com/TrueCloudLab/frostfs-api-go/pulls) for existing +- Check the open [issues](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/issues) and + [pull requests](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/pulls) for existing discussions. - Open an issue first, to discuss a new feature or enhancement. @@ -26,18 +26,18 @@ send a pull request. We encourage pull requests to discuss code changes. Here are the steps in details: ### Set up your GitHub Repository -Fork [FrostFS node upstream](https://github.com/TrueCloudLab/frostfs-api-go/fork) source +Fork [FrostFS node upstream](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/fork) source repository to your own personal repository. Copy the URL of your fork (you will need it for the `git clone` command below). ```sh -$ git clone https://github.com/TrueCloudLab/frostfs-api-go +$ git clone https://git.frostfs.info/TrueCloudLab/frostfs-api-go ``` ### Set up git remote as ``upstream`` ```sh $ cd frostfs-api-go -$ git remote add upstream https://github.com/TrueCloudLab/frostfs-api-go +$ git remote add upstream https://git.frostfs.info/TrueCloudLab/frostfs-api-go $ git fetch upstream $ git merge upstream/master ... diff --git a/README.md b/README.md index 73f06e3..a6e7b6f 100644 --- a/README.md +++ b/README.md @@ -6,22 +6,20 @@

--- -![Tests](https://github.com/TrueCloudLab/frostfs-api-go/workflows/frostfs-api-go%20tests/badge.svg) -[![codecov](https://codecov.io/gh/TrueCloudLab/frostfs-api-go/branch/master/graph/badge.svg)](https://codecov.io/gh/TrueCloudLab/frostfs-api-go) -[![Report](https://goreportcard.com/badge/github.com/TrueCloudLab/frostfs-api-go)](https://goreportcard.com/report/github.com/TrueCloudLab/frostfs-api-go) -[![GitHub release](https://img.shields.io/github/release/TrueCloudLab/frostfs-api-go.svg)](https://github.com/TrueCloudLab/frostfs-api-go) -![GitHub license](https://img.shields.io/github/license/TrueCloudLab/frostfs-api-go.svg?style=popout) +![Tests](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/badges/workflows/tests.yml/badge.svg) +[![Report](https://goreportcard.com/badge/git.frostfs.info/TrueCloudLab/frostfs-api-go)](https://goreportcard.com/report/git.frostfs.info/TrueCloudLab/frostfs-api-go) +[![Release](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/badges/release.svg)](https://git.frostfs.info/TrueCloudLab/frostfs-api-go) # Overview -Go implementation of recent [FrostFS API](https://github.com/TrueCloudLab/frostfs-api) -versions. For a more high-level SDK see [FrostFS SDK](https://github.com/TrueCloudLab/frostfs-sdk-go). +Go implementation of recent [FrostFS API](https://git.frostfs.info/TrueCloudLab/frostfs-api) +versions. For a more high-level SDK see [FrostFS SDK](https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go). ## Frostfs-Api compatibility |frostfs-api-go version|supported frostfs-api versions| |:------------------:|:--------------------------:| -|v2.14.x|[v2.14.0](https://github.com/TrueCloudLab/frostfs-api/releases/tag/v2.14.0)| +|v2.14.x|[v2.14.0](https://git.frostfs.info/TrueCloudLab/frostfs-api/releases/tag/v2.14.0)| ## Contributing From c9782cf3ef716d676a1e849e28a9b497cab82502 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 13 Sep 2024 17:18:19 +0300 Subject: [PATCH 154/169] [#117] go.mod: Upgrade grpc to v1.66.2 Signed-off-by: Dmitrii Stepanov --- go.mod | 14 +++++++------- go.sum | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index a241dd5..9672cb4 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,9 @@ require ( github.com/VictoriaMetrics/easyproto v0.1.4 github.com/mailru/easyjson v0.7.7 github.com/stretchr/testify v1.8.3 - golang.org/x/sync v0.6.0 - google.golang.org/grpc v1.63.2 - google.golang.org/protobuf v1.33.0 + golang.org/x/sync v0.7.0 + google.golang.org/grpc v1.66.2 + google.golang.org/protobuf v1.34.1 ) require ( @@ -19,10 +19,10 @@ require ( github.com/kr/pretty v0.1.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 83963fe..4bae273 100644 --- a/go.sum +++ b/go.sum @@ -26,20 +26,20 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= +google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 13fa0da3741e6f79fe2b4bef2c6a0778a389699b Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 13 Sep 2024 17:18:53 +0300 Subject: [PATCH 155/169] [#117] rpc: Allow to specify custom gRPC dialer After grpc upgrade there is no DialContext call. So connection is not actually established after created. Signed-off-by: Dmitrii Stepanov --- rpc/client/call_options.go | 13 ++++++++++++- rpc/client/connect.go | 20 +++++++++++++------- rpc/client/init.go | 2 +- rpc/client/options.go | 1 - 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/rpc/client/call_options.go b/rpc/client/call_options.go index 8134e46..4fe8791 100644 --- a/rpc/client/call_options.go +++ b/rpc/client/call_options.go @@ -2,13 +2,16 @@ package client import ( "context" + + "google.golang.org/grpc" ) // CallOption is a messaging session option within Protobuf RPC. type CallOption func(*callParameters) type callParameters struct { - ctx context.Context // nolint:containedctx + ctx context.Context // nolint:containedctx + dialer func(context.Context, grpc.ClientConnInterface) error } func defaultCallParameters() *callParameters { @@ -27,3 +30,11 @@ func WithContext(ctx context.Context) CallOption { prm.ctx = ctx } } + +// WithDialer returns option to specify grpc dialer. If passed, it will be +// called after the connection is successfully created. +func WithDialer(dialer func(context.Context, grpc.ClientConnInterface) error) CallOption { + return func(prm *callParameters) { + prm.dialer = dialer + } +} diff --git a/rpc/client/connect.go b/rpc/client/connect.go index 29f4189..e22e0a6 100644 --- a/rpc/client/connect.go +++ b/rpc/client/connect.go @@ -12,7 +12,7 @@ import ( var errInvalidEndpoint = errors.New("invalid endpoint options") -func (c *Client) openGRPCConn(ctx context.Context) error { +func (c *Client) openGRPCConn(ctx context.Context, dialer func(ctx context.Context, cc grpcstd.ClientConnInterface) error) error { if c.conn != nil { return nil } @@ -21,15 +21,21 @@ func (c *Client) openGRPCConn(ctx context.Context) error { return errInvalidEndpoint } - dialCtx, cancel := context.WithTimeout(ctx, c.dialTimeout) var err error - c.conn, err = grpcstd.DialContext(dialCtx, c.addr, c.grpcDialOpts...) - - cancel() - + c.conn, err = grpcstd.NewClient(c.addr, c.grpcDialOpts...) if err != nil { - return fmt.Errorf("gRPC dial: %w", err) + return fmt.Errorf("gRPC new client: %w", err) + } + + if dialer != nil { + ctx, cancel := context.WithTimeout(ctx, c.dialTimeout) + defer cancel() + + if err := dialer(ctx, c.conn); err != nil { + _ = c.conn.Close() + return fmt.Errorf("gRPC dial: %w", err) + } } return nil diff --git a/rpc/client/init.go b/rpc/client/init.go index 60ccda9..be8d066 100644 --- a/rpc/client/init.go +++ b/rpc/client/init.go @@ -46,7 +46,7 @@ func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageRe opt(prm) } - if err := c.openGRPCConn(prm.ctx); err != nil { + if err := c.openGRPCConn(prm.ctx, prm.dialer); err != nil { return nil, err } diff --git a/rpc/client/options.go b/rpc/client/options.go index 22358a3..5711cd4 100644 --- a/rpc/client/options.go +++ b/rpc/client/options.go @@ -37,7 +37,6 @@ func (c *cfg) initDefault() { c.dialTimeout = defaultDialTimeout c.rwTimeout = defaultRWTimeout c.grpcDialOpts = []grpc.DialOption{ - grpc.WithBlock(), grpc.WithTransportCredentials(insecure.NewCredentials()), } } From c3dbbc5eab70dd429e191e081294c13d4b51fa3b Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Tue, 24 Sep 2024 14:34:21 +0300 Subject: [PATCH 156/169] [#118] status: Support INVALID_ARGUMENT status Signed-off-by: Aleksey Savchuk --- status/status.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/status/status.go b/status/status.go index c1b5272..53d361e 100644 --- a/status/status.go +++ b/status/status.go @@ -63,6 +63,8 @@ const ( SignatureVerificationFail // NodeUnderMaintenance is a local Code value for NODE_UNDER_MAINTENANCE status. NodeUnderMaintenance + // InvalidArgument is a local Code value for INVALID_ARGUMENT status. + InvalidArgument ) const ( From 287e98ad670b29d849576e9f3204a6b42e91ea0c Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 1 Oct 2024 09:38:57 +0300 Subject: [PATCH 157/169] [#120] proto/test: Add protojson compatibility test It is failing, thus is skipped. But implement it now to make it easier to see it failing. Signed-off-by: Evgenii Stratonikov --- util/proto/marshal_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index 1cd7005..98422fc 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -76,6 +76,13 @@ func TestStableMarshalSingle(t *testing.T) { var actual test.Primitives require.NoError(t, protojson.Unmarshal(r, &actual)) + t.Run("protojson compatibility", func(t *testing.T) { + t.Skip() + data, err := protojson.Marshal(&actual) + require.NoError(t, err) + require.JSONEq(t, string(data), string(r)) + }) + var actualFrostfs generated.Primitives require.NoError(t, actualFrostfs.UnmarshalJSON(r)) require.Equal(t, tc.input, &actualFrostfs) From f812b1ae5bd602000da17feeb0f8d5afead4a531 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 1 Oct 2024 13:52:57 +0300 Subject: [PATCH 158/169] [#120] Regenerate proto files Signed-off-by: Evgenii Stratonikov --- accounting/grpc/service_grpc.pb.go | 4 +-- netmap/grpc/service_grpc.pb.go | 8 +++--- object/grpc/service_grpc.pb.go | 44 ++++++++++++++++++------------ 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/accounting/grpc/service_grpc.pb.go b/accounting/grpc/service_grpc.pb.go index 63207fe..87eb56b 100644 --- a/accounting/grpc/service_grpc.pb.go +++ b/accounting/grpc/service_grpc.pb.go @@ -26,7 +26,7 @@ const ( // // 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. type AccountingServiceClient interface { - // Returns the amount of funds in GAS token for the requested NeoFS account. + // Returns the amount of funds in GAS token for the requested FrostFS account. // // Statuses: // - **OK** (0, SECTION_SUCCESS): @@ -56,7 +56,7 @@ func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceReques // All implementations should embed UnimplementedAccountingServiceServer // for forward compatibility type AccountingServiceServer interface { - // Returns the amount of funds in GAS token for the requested NeoFS account. + // Returns the amount of funds in GAS token for the requested FrostFS account. // // Statuses: // - **OK** (0, SECTION_SUCCESS): diff --git a/netmap/grpc/service_grpc.pb.go b/netmap/grpc/service_grpc.pb.go index 7881cd6..9ad7fef 100644 --- a/netmap/grpc/service_grpc.pb.go +++ b/netmap/grpc/service_grpc.pb.go @@ -40,14 +40,14 @@ type NetmapServiceClient interface { // information about the server has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error) - // Read recent information about the NeoFS network. + // Read recent information about the FrostFS network. // // Statuses: // - **OK** (0, SECTION_SUCCESS): // information about the current network state has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) - // Returns network map snapshot of the current NeoFS epoch. + // Returns network map snapshot of the current FrostFS epoch. // // Statuses: // - **OK** (0, SECTION_SUCCESS): @@ -107,14 +107,14 @@ type NetmapServiceServer interface { // information about the server has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error) - // Read recent information about the NeoFS network. + // Read recent information about the FrostFS network. // // Statuses: // - **OK** (0, SECTION_SUCCESS): // information about the current network state has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). NetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error) - // Returns network map snapshot of the current NeoFS epoch. + // Returns network map snapshot of the current FrostFS epoch. // // Statuses: // - **OK** (0, SECTION_SUCCESS): diff --git a/object/grpc/service_grpc.pb.go b/object/grpc/service_grpc.pb.go index 687df99..abc1c71 100644 --- a/object/grpc/service_grpc.pb.go +++ b/object/grpc/service_grpc.pb.go @@ -170,7 +170,7 @@ type ObjectServiceClient interface { // provided session token has expired. Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object - // Header's filed values. Please see the corresponding NeoFS Technical + // Header's filed values. Please see the corresponding FrostFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: @@ -301,16 +301,20 @@ type ObjectServiceClient interface { // provided session token has expired. PutSingle(ctx context.Context, in *PutSingleRequest, opts ...grpc.CallOption) (*PutSingleResponse, error) // Patch the object. Request uses gRPC stream. First message must set - // the address of the object that is going to get patched. If the object's attributes - // are patched, then these attrubutes must be set only within the first stream message. + // the address of the object that is going to get patched. If the object's + // attributes are patched, then these attrubutes must be set only within the + // first stream message. // - // If the patch request is performed by NOT the object's owner but if the actor has the permission - // to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner - // loses the object's ownership after the patch request is successfully done. + // If the patch request is performed by NOT the object's owner but if the + // actor has the permission to perform the patch, then `OwnerID` of the object + // is changed. In this case the object's owner loses the object's ownership + // after the patch request is successfully done. // - // As objects are content-addressable the patching causes new object ID generation for the patched object. - // This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases: - // 1. The chunk of the applying patch contains the same value as the object's payload within the same range; + // As objects are content-addressable the patching causes new object ID + // generation for the patched object. This object id is set witihn + // `PatchResponse`. But the object id may remain unchanged in such cases: + // 1. The chunk of the applying patch contains the same value as the object's + // payload within the same range; // 2. The patch that reverts the changes applied by preceding patch; // 3. The application of the same patches for the object a few times. // @@ -694,7 +698,7 @@ type ObjectServiceServer interface { // provided session token has expired. Head(context.Context, *HeadRequest) (*HeadResponse, error) // Search objects in container. Search query allows to match by Object - // Header's filed values. Please see the corresponding NeoFS Technical + // Header's filed values. Please see the corresponding FrostFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: @@ -825,16 +829,20 @@ type ObjectServiceServer interface { // provided session token has expired. PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error) // Patch the object. Request uses gRPC stream. First message must set - // the address of the object that is going to get patched. If the object's attributes - // are patched, then these attrubutes must be set only within the first stream message. + // the address of the object that is going to get patched. If the object's + // attributes are patched, then these attrubutes must be set only within the + // first stream message. // - // If the patch request is performed by NOT the object's owner but if the actor has the permission - // to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner - // loses the object's ownership after the patch request is successfully done. + // If the patch request is performed by NOT the object's owner but if the + // actor has the permission to perform the patch, then `OwnerID` of the object + // is changed. In this case the object's owner loses the object's ownership + // after the patch request is successfully done. // - // As objects are content-addressable the patching causes new object ID generation for the patched object. - // This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases: - // 1. The chunk of the applying patch contains the same value as the object's payload within the same range; + // As objects are content-addressable the patching causes new object ID + // generation for the patched object. This object id is set witihn + // `PatchResponse`. But the object id may remain unchanged in such cases: + // 1. The chunk of the applying patch contains the same value as the object's + // payload within the same range; // 2. The patch that reverts the changes applied by preceding patch; // 3. The application of the same patches for the object a few times. // From 805da79319a4b84b5d2a8a0c6f2234ff37f55acd Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 1 Oct 2024 09:42:40 +0300 Subject: [PATCH 159/169] [#120] protogen: Marshal enum as string Be compatible with protojson. Signed-off-by: Evgenii Stratonikov --- acl/grpc/types_frostfs.pb.go | 35 +++++++++++++++++++---- ape/grpc/types_frostfs.pb.go | 7 ++++- netmap/grpc/types_frostfs.pb.go | 21 ++++++++++++-- object/grpc/service_frostfs.pb.go | 21 ++++++++++++-- object/grpc/types_frostfs.pb.go | 14 +++++++-- refs/grpc/types_frostfs.pb.go | 14 +++++++-- session/grpc/types_frostfs.pb.go | 14 +++++++-- util/proto/test/custom/test_frostfs.pb.go | 7 ++++- util/protogen/internalgengo/json.go | 8 +++++- 9 files changed, 121 insertions(+), 20 deletions(-) diff --git a/acl/grpc/types_frostfs.pb.go b/acl/grpc/types_frostfs.pb.go index 2b116bd..b055167 100644 --- a/acl/grpc/types_frostfs.pb.go +++ b/acl/grpc/types_frostfs.pb.go @@ -356,12 +356,22 @@ func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"headerType\":" out.RawString(prefix[1:]) - out.Int32(int32(x.HeaderType)) + v := int32(x.HeaderType) + if vv, ok := HeaderType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"matchType\":" out.RawString(prefix) - out.Int32(int32(x.MatchType)) + v := int32(x.MatchType) + if vv, ok := MatchType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"key\":" @@ -570,7 +580,12 @@ func (x *EACLRecord_Target) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"role\":" out.RawString(prefix[1:]) - out.Int32(int32(x.Role)) + v := int32(x.Role) + if vv, ok := Role_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"keys\":" @@ -812,12 +827,22 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"operation\":" out.RawString(prefix[1:]) - out.Int32(int32(x.Operation)) + v := int32(x.Operation) + if vv, ok := Operation_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"action\":" out.RawString(prefix) - out.Int32(int32(x.Action)) + v := int32(x.Action) + if vv, ok := Action_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"filters\":" diff --git a/ape/grpc/types_frostfs.pb.go b/ape/grpc/types_frostfs.pb.go index 216415b..e19d9f6 100644 --- a/ape/grpc/types_frostfs.pb.go +++ b/ape/grpc/types_frostfs.pb.go @@ -159,7 +159,12 @@ func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"type\":" out.RawString(prefix[1:]) - out.Int32(int32(x.Type)) + v := int32(x.Type) + if vv, ok := TargetType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"name\":" diff --git a/netmap/grpc/types_frostfs.pb.go b/netmap/grpc/types_frostfs.pb.go index e7597ea..43af103 100644 --- a/netmap/grpc/types_frostfs.pb.go +++ b/netmap/grpc/types_frostfs.pb.go @@ -288,7 +288,12 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"op\":" out.RawString(prefix) - out.Int32(int32(x.Op)) + v := int32(x.Op) + if vv, ok := Operation_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"value\":" @@ -572,7 +577,12 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"clause\":" out.RawString(prefix) - out.Int32(int32(x.Clause)) + v := int32(x.Clause) + if vv, ok := Clause_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"attribute\":" @@ -1627,7 +1637,12 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"state\":" out.RawString(prefix) - out.Int32(int32(x.State)) + v := int32(x.State) + if vv, ok := NodeInfo_State_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } out.RawByte('}') } diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go index dea1b5b..188d032 100644 --- a/object/grpc/service_frostfs.pb.go +++ b/object/grpc/service_frostfs.pb.go @@ -4117,7 +4117,12 @@ func (x *SearchRequest_Body_Filter) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"matchType\":" out.RawString(prefix[1:]) - out.Int32(int32(x.MatchType)) + v := int32(x.MatchType) + if vv, ok := MatchType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"key\":" @@ -6246,7 +6251,12 @@ func (x *GetRangeHashRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"type\":" out.RawString(prefix) - out.Int32(int32(x.Type)) + v := int32(x.Type) + if vv, ok := grpc.ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } out.RawByte('}') } @@ -6659,7 +6669,12 @@ func (x *GetRangeHashResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"type\":" out.RawString(prefix[1:]) - out.Int32(int32(x.Type)) + v := int32(x.Type) + if vv, ok := grpc.ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"hashList\":" diff --git a/object/grpc/types_frostfs.pb.go b/object/grpc/types_frostfs.pb.go index 4233417..9fc2769 100644 --- a/object/grpc/types_frostfs.pb.go +++ b/object/grpc/types_frostfs.pb.go @@ -323,7 +323,12 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"objectType\":" out.RawString(prefix) - out.Int32(int32(x.ObjectType)) + v := int32(x.ObjectType) + if vv, ok := ObjectType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"payloadLength\":" @@ -1659,7 +1664,12 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"objectType\":" out.RawString(prefix) - out.Int32(int32(x.ObjectType)) + v := int32(x.ObjectType) + if vv, ok := ObjectType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"homomorphicHash\":" diff --git a/refs/grpc/types_frostfs.pb.go b/refs/grpc/types_frostfs.pb.go index 35febe9..5f35eba 100644 --- a/refs/grpc/types_frostfs.pb.go +++ b/refs/grpc/types_frostfs.pb.go @@ -933,7 +933,12 @@ func (x *Signature) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"scheme\":" out.RawString(prefix) - out.Int32(int32(x.Scheme)) + v := int32(x.Scheme) + if vv, ok := SignatureScheme_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } out.RawByte('}') } @@ -1270,7 +1275,12 @@ func (x *Checksum) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"type\":" out.RawString(prefix[1:]) - out.Int32(int32(x.Type)) + v := int32(x.Type) + if vv, ok := ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"sum\":" diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go index 41ff5d9..c92ab28 100644 --- a/session/grpc/types_frostfs.pb.go +++ b/session/grpc/types_frostfs.pb.go @@ -362,7 +362,12 @@ func (x *ObjectSessionContext) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"verb\":" out.RawString(prefix[1:]) - out.Int32(int32(x.Verb)) + v := int32(x.Verb) + if vv, ok := ObjectSessionContext_Verb_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"target\":" @@ -600,7 +605,12 @@ func (x *ContainerSessionContext) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"verb\":" out.RawString(prefix[1:]) - out.Int32(int32(x.Verb)) + v := int32(x.Verb) + if vv, ok := ContainerSessionContext_Verb_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } { const prefix string = ",\"wildcard\":" diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index 97efa51..005d6d1 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -614,7 +614,12 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) { { const prefix string = ",\"fieldH\":" out.RawString(prefix) - out.Int32(int32(x.FieldH)) + v := int32(x.FieldH) + if vv, ok := Primitives_SomeEnum_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } switch xx := x.FieldM.(type) { case *Primitives_FieldMa: diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go index f7cd284..95a06d5 100644 --- a/util/protogen/internalgengo/json.go +++ b/util/protogen/internalgengo/json.go @@ -195,7 +195,13 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin case protoreflect.BoolKind: template = "out.Bool(%s)" case protoreflect.EnumKind: - template = "out.Int32(int32(%s))" + enumType := fieldType(g, f).String() + template = `v := int32(%s) + if vv, ok := ` + enumType + `_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + }` case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: template = "out.Int32(%s)" case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: From eeb754c327dec8e9007bb9154ab215f91240d5ec Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 1 Oct 2024 09:53:38 +0300 Subject: [PATCH 160/169] [#120] protogen: Omit empty fields from JSON output Signed-off-by: Evgenii Stratonikov --- accounting/grpc/service_frostfs.pb.go | 108 +- accounting/grpc/types_frostfs.pb.go | 27 +- acl/grpc/types_frostfs.pb.go | 433 ++++-- ape/grpc/types_frostfs.pb.go | 49 +- apemanager/grpc/service_frostfs.pb.go | 344 ++++- container/grpc/service_frostfs.pb.go | 478 +++++-- container/grpc/types_frostfs.pb.go | 130 +- lock/grpc/types_frostfs.pb.go | 22 +- netmap/grpc/service_frostfs.pb.go | 295 +++- netmap/grpc/types_frostfs.pb.go | 603 +++++--- object/grpc/service_frostfs.pb.go | 1592 ++++++++++++++++----- object/grpc/types_frostfs.pb.go | 749 +++++++--- refs/grpc/types_frostfs.pb.go | 206 ++- session/grpc/service_frostfs.pb.go | 134 +- session/grpc/types_frostfs.pb.go | 621 ++++++-- status/grpc/types_frostfs.pb.go | 83 +- tombstone/grpc/types_frostfs.pb.go | 56 +- util/proto/test/custom/test_frostfs.pb.go | 388 +++-- util/protogen/internalgengo/json.go | 31 +- 19 files changed, 4717 insertions(+), 1632 deletions(-) diff --git a/accounting/grpc/service_frostfs.pb.go b/accounting/grpc/service_frostfs.pb.go index b70fd27..4f11303 100644 --- a/accounting/grpc/service_frostfs.pb.go +++ b/accounting/grpc/service_frostfs.pb.go @@ -98,11 +98,19 @@ func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"ownerId\":" - out.RawString(prefix[1:]) - x.OwnerId.MarshalEasyJSON(out) + if x.OwnerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerId\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -295,21 +303,43 @@ func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -452,11 +482,19 @@ func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"balance\":" - out.RawString(prefix[1:]) - x.Balance.MarshalEasyJSON(out) + if x.Balance != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"balance\":" + out.RawString(prefix) + x.Balance.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -649,21 +687,43 @@ func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } diff --git a/accounting/grpc/types_frostfs.pb.go b/accounting/grpc/types_frostfs.pb.go index 182705e..0ae770b 100644 --- a/accounting/grpc/types_frostfs.pb.go +++ b/accounting/grpc/types_frostfs.pb.go @@ -113,16 +113,31 @@ func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"value\":" - out.RawString(prefix[1:]) - out.Int64(x.Value) + if x.Value != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.Int64(x.Value) + } } { - const prefix string = ",\"precision\":" - out.RawString(prefix) - out.Uint32(x.Precision) + if x.Precision != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"precision\":" + out.RawString(prefix) + out.Uint32(x.Precision) + } } out.RawByte('}') } diff --git a/acl/grpc/types_frostfs.pb.go b/acl/grpc/types_frostfs.pb.go index b055167..57e1682 100644 --- a/acl/grpc/types_frostfs.pb.go +++ b/acl/grpc/types_frostfs.pb.go @@ -352,36 +352,65 @@ func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"headerType\":" - out.RawString(prefix[1:]) - v := int32(x.HeaderType) - if vv, ok := HeaderType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.HeaderType != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"headerType\":" + out.RawString(prefix) + v := int32(x.HeaderType) + if vv, ok := HeaderType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } { - const prefix string = ",\"matchType\":" - out.RawString(prefix) - v := int32(x.MatchType) - if vv, ok := MatchType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.MatchType != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"matchType\":" + out.RawString(prefix) + v := int32(x.MatchType) + if vv, ok := MatchType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } { - const prefix string = ",\"key\":" - out.RawString(prefix) - out.String(x.Key) + if len(x.Key) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } } { - const prefix string = ",\"value\":" - out.RawString(prefix) - out.String(x.Value) + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } } out.RawByte('}') } @@ -576,28 +605,43 @@ func (x *EACLRecord_Target) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"role\":" - out.RawString(prefix[1:]) - v := int32(x.Role) - if vv, ok := Role_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.Role != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"role\":" + out.RawString(prefix) + v := int32(x.Role) + if vv, ok := Role_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } { - const prefix string = ",\"keys\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Keys { - if i != 0 { + if len(x.Keys) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.Base64Bytes(x.Keys[i]) + const prefix string = "\"keys\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Keys { + if i != 0 { + out.RawByte(',') + } + out.Base64Bytes(x.Keys[i]) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -823,50 +867,79 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"operation\":" - out.RawString(prefix[1:]) - v := int32(x.Operation) - if vv, ok := Operation_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } - } - { - const prefix string = ",\"action\":" - out.RawString(prefix) - v := int32(x.Action) - if vv, ok := Action_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } - } - { - const prefix string = ",\"filters\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Filters { - if i != 0 { + if x.Operation != 0 { + if !first { out.RawByte(',') + } else { + first = false + } + const prefix string = "\"operation\":" + out.RawString(prefix) + v := int32(x.Operation) + if vv, ok := Operation_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } - x.Filters[i].MarshalEasyJSON(out) } - out.RawByte(']') } { - const prefix string = ",\"targets\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Targets { - if i != 0 { + if x.Action != 0 { + if !first { out.RawByte(',') + } else { + first = false + } + const prefix string = "\"action\":" + out.RawString(prefix) + v := int32(x.Action) + if vv, ok := Action_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } - x.Targets[i].MarshalEasyJSON(out) } - out.RawByte(']') + } + { + if len(x.Filters) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + } + { + if len(x.Targets) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"targets\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Targets { + if i != 0 { + out.RawByte(',') + } + x.Targets[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } } out.RawByte('}') } @@ -1109,28 +1182,50 @@ func (x *EACLTable) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"version\":" - out.RawString(prefix[1:]) - x.Version.MarshalEasyJSON(out) - } - { - const prefix string = ",\"containerID\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) - } - { - const prefix string = ",\"records\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Records { - if i != 0 { + if x.Version != nil { + if !first { out.RawByte(',') + } else { + first = false } - x.Records[i].MarshalEasyJSON(out) + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } + } + { + if x.ContainerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } + } + { + if len(x.Records) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"records\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Records { + if i != 0 { + out.RawByte(',') + } + x.Records[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -1317,21 +1412,43 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"exp\":" - out.RawString(prefix[1:]) - out.Uint64(x.Exp) + if x.Exp != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"exp\":" + out.RawString(prefix) + out.Uint64(x.Exp) + } } { - const prefix string = ",\"nbf\":" - out.RawString(prefix) - out.Uint64(x.Nbf) + if x.Nbf != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"nbf\":" + out.RawString(prefix) + out.Uint64(x.Nbf) + } } { - const prefix string = ",\"iat\":" - out.RawString(prefix) - out.Uint64(x.Iat) + if x.Iat != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"iat\":" + out.RawString(prefix) + out.Uint64(x.Iat) + } } out.RawByte('}') } @@ -1497,23 +1614,38 @@ func (x *BearerToken_Body_APEOverride) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"target\":" - out.RawString(prefix[1:]) - x.Target.MarshalEasyJSON(out) + if x.Target != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) + } } { - const prefix string = ",\"chains\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Chains { - if i != 0 { + if len(x.Chains) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Chains[i].MarshalEasyJSON(out) + const prefix string = "\"chains\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Chains { + if i != 0 { + out.RawByte(',') + } + x.Chains[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -1745,31 +1877,67 @@ func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"eaclTable\":" - out.RawString(prefix[1:]) - x.EaclTable.MarshalEasyJSON(out) + if x.EaclTable != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"eaclTable\":" + out.RawString(prefix) + x.EaclTable.MarshalEasyJSON(out) + } } { - const prefix string = ",\"ownerID\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) + if x.OwnerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } } { - const prefix string = ",\"lifetime\":" - out.RawString(prefix) - x.Lifetime.MarshalEasyJSON(out) + if x.Lifetime != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"lifetime\":" + out.RawString(prefix) + x.Lifetime.MarshalEasyJSON(out) + } } { - const prefix string = ",\"allowImpersonate\":" - out.RawString(prefix) - out.Bool(x.AllowImpersonate) + if x.AllowImpersonate { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"allowImpersonate\":" + out.RawString(prefix) + out.Bool(x.AllowImpersonate) + } } { - const prefix string = ",\"apeOverride\":" - out.RawString(prefix) - x.ApeOverride.MarshalEasyJSON(out) + if x.ApeOverride != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"apeOverride\":" + out.RawString(prefix) + x.ApeOverride.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1948,16 +2116,31 @@ func (x *BearerToken) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if x.Signature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } } out.RawByte('}') } diff --git a/ape/grpc/types_frostfs.pb.go b/ape/grpc/types_frostfs.pb.go index e19d9f6..7967e13 100644 --- a/ape/grpc/types_frostfs.pb.go +++ b/ape/grpc/types_frostfs.pb.go @@ -155,21 +155,36 @@ func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"type\":" - out.RawString(prefix[1:]) - v := int32(x.Type) - if vv, ok := TargetType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.Type != 0 { + 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) + } } } { - const prefix string = ",\"name\":" - out.RawString(prefix) - out.String(x.Name) + if len(x.Name) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"name\":" + out.RawString(prefix) + out.String(x.Name) + } } out.RawByte('}') } @@ -338,13 +353,21 @@ func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') switch xx := x.Kind.(type) { case *Chain_Raw: { - const prefix string = ",\"raw\":" - out.RawString(prefix[1:]) - out.Base64Bytes(xx.Raw) + if len(xx.Raw) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"raw\":" + out.RawString(prefix) + out.Base64Bytes(xx.Raw) + } } } out.RawByte('}') diff --git a/apemanager/grpc/service_frostfs.pb.go b/apemanager/grpc/service_frostfs.pb.go index 99abeb2..2a30850 100644 --- a/apemanager/grpc/service_frostfs.pb.go +++ b/apemanager/grpc/service_frostfs.pb.go @@ -121,16 +121,31 @@ func (x *AddChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"target\":" - out.RawString(prefix[1:]) - x.Target.MarshalEasyJSON(out) + if x.Target != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) + } } { - const prefix string = ",\"chain\":" - out.RawString(prefix) - x.Chain.MarshalEasyJSON(out) + if x.Chain != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chain\":" + out.RawString(prefix) + x.Chain.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -330,21 +345,43 @@ func (x *AddChainRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -484,11 +521,19 @@ func (x *AddChainResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"chainId\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.ChainId) + if len(x.ChainId) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chainId\":" + out.RawString(prefix) + out.Base64Bytes(x.ChainId) + } } out.RawByte('}') } @@ -680,21 +725,43 @@ func (x *AddChainResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -857,16 +924,31 @@ func (x *RemoveChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"target\":" - out.RawString(prefix[1:]) - x.Target.MarshalEasyJSON(out) + if x.Target != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) + } } { - const prefix string = ",\"chainId\":" - out.RawString(prefix) - out.Base64Bytes(x.ChainId) + if len(x.ChainId) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chainId\":" + out.RawString(prefix) + out.Base64Bytes(x.ChainId) + } } out.RawByte('}') } @@ -1065,21 +1147,43 @@ func (x *RemoveChainRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1381,21 +1485,43 @@ func (x *RemoveChainResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1538,11 +1664,19 @@ func (x *ListChainsRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"target\":" - out.RawString(prefix[1:]) - x.Target.MarshalEasyJSON(out) + if x.Target != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1735,21 +1869,43 @@ func (x *ListChainsRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1895,18 +2051,26 @@ func (x *ListChainsResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"chains\":" - out.RawString(prefix[1:]) - out.RawByte('[') - for i := range x.Chains { - if i != 0 { + if len(x.Chains) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Chains[i].MarshalEasyJSON(out) + const prefix string = "\"chains\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Chains { + if i != 0 { + out.RawByte(',') + } + x.Chains[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -2106,21 +2270,43 @@ func (x *ListChainsResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } diff --git a/container/grpc/service_frostfs.pb.go b/container/grpc/service_frostfs.pb.go index ffdc730..4ccb595 100644 --- a/container/grpc/service_frostfs.pb.go +++ b/container/grpc/service_frostfs.pb.go @@ -121,16 +121,31 @@ func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"container\":" - out.RawString(prefix[1:]) - x.Container.MarshalEasyJSON(out) + if x.Container != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"container\":" + out.RawString(prefix) + x.Container.MarshalEasyJSON(out) + } } { - const prefix string = ",\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if x.Signature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -330,21 +345,43 @@ func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -487,11 +524,19 @@ func (x *PutResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"containerId\":" - out.RawString(prefix[1:]) - x.ContainerId.MarshalEasyJSON(out) + if x.ContainerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerId\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -684,21 +729,43 @@ func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -864,16 +931,31 @@ func (x *DeleteRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"containerId\":" - out.RawString(prefix[1:]) - x.ContainerId.MarshalEasyJSON(out) + if x.ContainerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerId\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } } { - const prefix string = ",\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if x.Signature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1073,21 +1155,43 @@ func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1389,21 +1493,43 @@ func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1546,11 +1672,19 @@ func (x *GetRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"containerId\":" - out.RawString(prefix[1:]) - x.ContainerId.MarshalEasyJSON(out) + if x.ContainerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerId\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1743,21 +1877,43 @@ func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1946,21 +2102,43 @@ func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"container\":" - out.RawString(prefix[1:]) - x.Container.MarshalEasyJSON(out) + if x.Container != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"container\":" + out.RawString(prefix) + x.Container.MarshalEasyJSON(out) + } } { - const prefix string = ",\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if x.Signature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } } { - const prefix string = ",\"sessionToken\":" - out.RawString(prefix) - x.SessionToken.MarshalEasyJSON(out) + if x.SessionToken != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2167,21 +2345,43 @@ func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2324,11 +2524,19 @@ func (x *ListRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"ownerId\":" - out.RawString(prefix[1:]) - x.OwnerId.MarshalEasyJSON(out) + if x.OwnerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerId\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2521,21 +2729,43 @@ func (x *ListRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2681,18 +2911,26 @@ func (x *ListResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"containerIds\":" - out.RawString(prefix[1:]) - out.RawByte('[') - for i := range x.ContainerIds { - if i != 0 { + if len(x.ContainerIds) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.ContainerIds[i].MarshalEasyJSON(out) + const prefix string = "\"containerIds\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.ContainerIds { + if i != 0 { + out.RawByte(',') + } + x.ContainerIds[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -2892,21 +3130,43 @@ func (x *ListResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } diff --git a/container/grpc/types_frostfs.pb.go b/container/grpc/types_frostfs.pb.go index 3010eb0..9db07ed 100644 --- a/container/grpc/types_frostfs.pb.go +++ b/container/grpc/types_frostfs.pb.go @@ -115,16 +115,31 @@ func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"key\":" - out.RawString(prefix[1:]) - out.String(x.Key) + if len(x.Key) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } } { - const prefix string = ",\"value\":" - out.RawString(prefix) - out.String(x.Value) + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } } out.RawByte('}') } @@ -370,43 +385,86 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"version\":" - out.RawString(prefix[1:]) - x.Version.MarshalEasyJSON(out) - } - { - const prefix string = ",\"ownerID\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) - } - { - const prefix string = ",\"nonce\":" - out.RawString(prefix) - out.Base64Bytes(x.Nonce) - } - { - const prefix string = ",\"basicACL\":" - out.RawString(prefix) - out.Uint32(x.BasicAcl) - } - { - const prefix string = ",\"attributes\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Attributes { - if i != 0 { + if x.Version != nil { + if !first { out.RawByte(',') + } else { + first = false } - x.Attributes[i].MarshalEasyJSON(out) + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) } - out.RawByte(']') } { - const prefix string = ",\"placementPolicy\":" - out.RawString(prefix) - x.PlacementPolicy.MarshalEasyJSON(out) + if x.OwnerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + } + { + if len(x.Nonce) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"nonce\":" + out.RawString(prefix) + out.Base64Bytes(x.Nonce) + } + } + { + if x.BasicAcl != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"basicACL\":" + out.RawString(prefix) + out.Uint32(x.BasicAcl) + } + } + { + if len(x.Attributes) != 0 { + 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 x.PlacementPolicy != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"placementPolicy\":" + out.RawString(prefix) + x.PlacementPolicy.MarshalEasyJSON(out) + } } out.RawByte('}') } diff --git a/lock/grpc/types_frostfs.pb.go b/lock/grpc/types_frostfs.pb.go index 58be895..33f22c5 100644 --- a/lock/grpc/types_frostfs.pb.go +++ b/lock/grpc/types_frostfs.pb.go @@ -100,18 +100,26 @@ func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"members\":" - out.RawString(prefix[1:]) - out.RawByte('[') - for i := range x.Members { - if i != 0 { + if len(x.Members) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Members[i].MarshalEasyJSON(out) + 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(']') } out.RawByte('}') } diff --git a/netmap/grpc/service_frostfs.pb.go b/netmap/grpc/service_frostfs.pb.go index 3d62855..4d53031 100644 --- a/netmap/grpc/service_frostfs.pb.go +++ b/netmap/grpc/service_frostfs.pb.go @@ -257,21 +257,43 @@ func (x *LocalNodeInfoRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -437,16 +459,31 @@ func (x *LocalNodeInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"version\":" - out.RawString(prefix[1:]) - x.Version.MarshalEasyJSON(out) + if x.Version != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } } { - const prefix string = ",\"nodeInfo\":" - out.RawString(prefix) - x.NodeInfo.MarshalEasyJSON(out) + if x.NodeInfo != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"nodeInfo\":" + out.RawString(prefix) + x.NodeInfo.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -646,21 +683,43 @@ func (x *LocalNodeInfoResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -962,21 +1021,43 @@ func (x *NetworkInfoRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1119,11 +1200,19 @@ func (x *NetworkInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"networkInfo\":" - out.RawString(prefix[1:]) - x.NetworkInfo.MarshalEasyJSON(out) + if x.NetworkInfo != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"networkInfo\":" + out.RawString(prefix) + x.NetworkInfo.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1316,21 +1405,43 @@ func (x *NetworkInfoResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1632,21 +1743,43 @@ func (x *NetmapSnapshotRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1789,11 +1922,19 @@ func (x *NetmapSnapshotResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"netmap\":" - out.RawString(prefix[1:]) - x.Netmap.MarshalEasyJSON(out) + if x.Netmap != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"netmap\":" + out.RawString(prefix) + x.Netmap.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1986,21 +2127,43 @@ func (x *NetmapSnapshotResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } diff --git a/netmap/grpc/types_frostfs.pb.go b/netmap/grpc/types_frostfs.pb.go index 43af103..d082910 100644 --- a/netmap/grpc/types_frostfs.pb.go +++ b/netmap/grpc/types_frostfs.pb.go @@ -274,43 +274,79 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"name\":" - out.RawString(prefix[1:]) - out.String(x.Name) - } - { - const prefix string = ",\"key\":" - out.RawString(prefix) - out.String(x.Key) - } - { - const prefix string = ",\"op\":" - out.RawString(prefix) - v := int32(x.Op) - if vv, ok := Operation_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } - } - { - const prefix string = ",\"value\":" - out.RawString(prefix) - out.String(x.Value) - } - { - const prefix string = ",\"filters\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Filters { - if i != 0 { + if len(x.Name) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Filters[i].MarshalEasyJSON(out) + const prefix string = "\"name\":" + out.RawString(prefix) + out.String(x.Name) + } + } + { + if len(x.Key) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + } + { + if x.Op != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"op\":" + out.RawString(prefix) + v := int32(x.Op) + if vv, ok := Operation_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } + } + } + { + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + } + { + if len(x.Filters) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -563,36 +599,72 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"name\":" - out.RawString(prefix[1:]) - out.String(x.Name) - } - { - const prefix string = ",\"count\":" - out.RawString(prefix) - out.Uint32(x.Count) - } - { - const prefix string = ",\"clause\":" - out.RawString(prefix) - v := int32(x.Clause) - if vv, ok := Clause_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if len(x.Name) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"name\":" + out.RawString(prefix) + out.String(x.Name) } } { - const prefix string = ",\"attribute\":" - out.RawString(prefix) - out.String(x.Attribute) + if x.Count != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"count\":" + out.RawString(prefix) + out.Uint32(x.Count) + } } { - const prefix string = ",\"filter\":" - out.RawString(prefix) - out.String(x.Filter) + if x.Clause != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"clause\":" + out.RawString(prefix) + v := int32(x.Clause) + if vv, ok := Clause_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } + } + } + { + if len(x.Attribute) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"attribute\":" + out.RawString(prefix) + out.String(x.Attribute) + } + } + { + if len(x.Filter) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"filter\":" + out.RawString(prefix) + out.String(x.Filter) + } } out.RawByte('}') } @@ -817,26 +889,55 @@ func (x *Replica) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"count\":" - out.RawString(prefix[1:]) - out.Uint32(x.Count) + if x.Count != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"count\":" + out.RawString(prefix) + out.Uint32(x.Count) + } } { - const prefix string = ",\"selector\":" - out.RawString(prefix) - out.String(x.Selector) + if len(x.Selector) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"selector\":" + out.RawString(prefix) + out.String(x.Selector) + } } { - const prefix string = ",\"ecDataCount\":" - out.RawString(prefix) - out.Uint32(x.EcDataCount) + if x.EcDataCount != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ecDataCount\":" + out.RawString(prefix) + out.Uint32(x.EcDataCount) + } } { - const prefix string = ",\"ecParityCount\":" - out.RawString(prefix) - out.Uint32(x.EcParityCount) + if x.EcParityCount != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ecParityCount\":" + out.RawString(prefix) + out.Uint32(x.EcParityCount) + } } out.RawByte('}') } @@ -1077,52 +1178,88 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"replicas\":" - out.RawString(prefix[1:]) - out.RawByte('[') - for i := range x.Replicas { - if i != 0 { + if len(x.Replicas) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Replicas[i].MarshalEasyJSON(out) + const prefix string = "\"replicas\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Replicas { + if i != 0 { + out.RawByte(',') + } + x.Replicas[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } { - const prefix string = ",\"containerBackupFactor\":" - out.RawString(prefix) - out.Uint32(x.ContainerBackupFactor) - } - { - const prefix string = ",\"selectors\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Selectors { - if i != 0 { + if x.ContainerBackupFactor != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Selectors[i].MarshalEasyJSON(out) + const prefix string = "\"containerBackupFactor\":" + out.RawString(prefix) + out.Uint32(x.ContainerBackupFactor) } - out.RawByte(']') } { - const prefix string = ",\"filters\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Filters { - if i != 0 { + if len(x.Selectors) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Filters[i].MarshalEasyJSON(out) + const prefix string = "\"selectors\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Selectors { + if i != 0 { + out.RawByte(',') + } + x.Selectors[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } { - const prefix string = ",\"unique\":" - out.RawString(prefix) - out.Bool(x.Unique) + if len(x.Filters) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + } + { + if x.Unique { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"unique\":" + out.RawString(prefix) + out.Bool(x.Unique) + } } out.RawByte('}') } @@ -1373,28 +1510,50 @@ func (x *NodeInfo_Attribute) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"key\":" - out.RawString(prefix[1:]) - out.String(x.Key) - } - { - const prefix string = ",\"value\":" - out.RawString(prefix) - out.String(x.Value) - } - { - const prefix string = ",\"parents\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Parents { - if i != 0 { + if len(x.Key) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.String(x.Parents[i]) + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } + } + { + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } + } + { + if len(x.Parents) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"parents\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Parents { + if i != 0 { + out.RawByte(',') + } + out.String(x.Parents[i]) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -1604,44 +1763,73 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"publicKey\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.PublicKey) - } - { - const prefix string = ",\"addresses\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Addresses { - if i != 0 { + if len(x.PublicKey) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.String(x.Addresses[i]) + const prefix string = "\"publicKey\":" + out.RawString(prefix) + out.Base64Bytes(x.PublicKey) } - out.RawByte(']') } { - const prefix string = ",\"attributes\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Attributes { - if i != 0 { + if len(x.Addresses) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Attributes[i].MarshalEasyJSON(out) + const prefix string = "\"addresses\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Addresses { + if i != 0 { + out.RawByte(',') + } + out.String(x.Addresses[i]) + } + out.RawByte(']') } - out.RawByte(']') } { - const prefix string = ",\"state\":" - out.RawString(prefix) - v := int32(x.State) - if vv, ok := NodeInfo_State_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if len(x.Attributes) != 0 { + 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 x.State != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"state\":" + out.RawString(prefix) + v := int32(x.State) + if vv, ok := NodeInfo_State_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } out.RawByte('}') @@ -1842,23 +2030,38 @@ func (x *Netmap) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"epoch\":" - out.RawString(prefix[1:]) - out.Uint64(x.Epoch) + if x.Epoch != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"epoch\":" + out.RawString(prefix) + out.Uint64(x.Epoch) + } } { - const prefix string = ",\"nodes\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Nodes { - if i != 0 { + if len(x.Nodes) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Nodes[i].MarshalEasyJSON(out) + const prefix string = "\"nodes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Nodes { + if i != 0 { + out.RawByte(',') + } + x.Nodes[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -2017,16 +2220,31 @@ func (x *NetworkConfig_Parameter) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"key\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.Key) + if len(x.Key) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.Base64Bytes(x.Key) + } } { - const prefix string = ",\"value\":" - out.RawString(prefix) - out.Base64Bytes(x.Value) + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.Base64Bytes(x.Value) + } } out.RawByte('}') } @@ -2163,18 +2381,26 @@ func (x *NetworkConfig) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"parameters\":" - out.RawString(prefix[1:]) - out.RawByte('[') - for i := range x.Parameters { - if i != 0 { + if len(x.Parameters) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Parameters[i].MarshalEasyJSON(out) + const prefix string = "\"parameters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Parameters { + if i != 0 { + out.RawByte(',') + } + x.Parameters[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -2370,26 +2596,55 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"currentEpoch\":" - out.RawString(prefix[1:]) - out.Uint64(x.CurrentEpoch) + if x.CurrentEpoch != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"currentEpoch\":" + out.RawString(prefix) + out.Uint64(x.CurrentEpoch) + } } { - const prefix string = ",\"magicNumber\":" - out.RawString(prefix) - out.Uint64(x.MagicNumber) + if x.MagicNumber != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"magicNumber\":" + out.RawString(prefix) + out.Uint64(x.MagicNumber) + } } { - const prefix string = ",\"msPerBlock\":" - out.RawString(prefix) - out.Int64(x.MsPerBlock) + if x.MsPerBlock != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"msPerBlock\":" + out.RawString(prefix) + out.Int64(x.MsPerBlock) + } } { - const prefix string = ",\"networkConfig\":" - out.RawString(prefix) - x.NetworkConfig.MarshalEasyJSON(out) + if x.NetworkConfig != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"networkConfig\":" + out.RawString(prefix) + x.NetworkConfig.MarshalEasyJSON(out) + } } out.RawByte('}') } diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go index 188d032..2434bd3 100644 --- a/object/grpc/service_frostfs.pb.go +++ b/object/grpc/service_frostfs.pb.go @@ -119,16 +119,31 @@ func (x *GetRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"address\":" - out.RawString(prefix[1:]) - x.Address.MarshalEasyJSON(out) + if x.Address != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) + } } { - const prefix string = ",\"raw\":" - out.RawString(prefix) - out.Bool(x.Raw) + if x.Raw { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"raw\":" + out.RawString(prefix) + out.Bool(x.Raw) + } } out.RawByte('}') } @@ -327,21 +342,43 @@ func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -530,21 +567,43 @@ func (x *GetResponse_Body_Init) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"objectId\":" - out.RawString(prefix[1:]) - x.ObjectId.MarshalEasyJSON(out) + if x.ObjectId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"objectId\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) + } } { - const prefix string = ",\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if x.Signature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } } { - const prefix string = ",\"header\":" - out.RawString(prefix) - x.Header.MarshalEasyJSON(out) + if x.Header != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -787,31 +846,60 @@ func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') switch xx := x.ObjectPart.(type) { case *GetResponse_Body_Init_: { - const prefix string = ",\"init\":" - out.RawString(prefix[1:]) - xx.Init.MarshalEasyJSON(out) + if xx.Init != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"init\":" + out.RawString(prefix) + xx.Init.MarshalEasyJSON(out) + } } case *GetResponse_Body_Chunk: { - const prefix string = ",\"chunk\":" - out.RawString(prefix[1:]) - out.Base64Bytes(xx.Chunk) + if len(xx.Chunk) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chunk\":" + out.RawString(prefix) + out.Base64Bytes(xx.Chunk) + } } case *GetResponse_Body_SplitInfo: { - const prefix string = ",\"splitInfo\":" - out.RawString(prefix[1:]) - xx.SplitInfo.MarshalEasyJSON(out) + if xx.SplitInfo != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitInfo\":" + out.RawString(prefix) + xx.SplitInfo.MarshalEasyJSON(out) + } } case *GetResponse_Body_EcInfo: { - const prefix string = ",\"ecInfo\":" - out.RawString(prefix[1:]) - xx.EcInfo.MarshalEasyJSON(out) + if xx.EcInfo != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ecInfo\":" + out.RawString(prefix) + xx.EcInfo.MarshalEasyJSON(out) + } } } out.RawByte('}') @@ -1061,21 +1149,43 @@ func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1286,33 +1396,62 @@ func (x *PutRequest_Body_Init) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"objectId\":" - out.RawString(prefix[1:]) - x.ObjectId.MarshalEasyJSON(out) - } - { - const prefix string = ",\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) - } - { - const prefix string = ",\"header\":" - out.RawString(prefix) - x.Header.MarshalEasyJSON(out) - } - { - const prefix string = ",\"copiesNumber\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.CopiesNumber { - if i != 0 { + if x.ObjectId != nil { + if !first { out.RawByte(',') + } else { + first = false } - out.Uint32(x.CopiesNumber[i]) + const prefix string = "\"objectId\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) + } + } + { + if x.Signature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } + } + { + if x.Header != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) + } + } + { + if len(x.CopiesNumber) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"copiesNumber\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.CopiesNumber { + if i != 0 { + out.RawByte(',') + } + out.Uint32(x.CopiesNumber[i]) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -1514,19 +1653,34 @@ func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') switch xx := x.ObjectPart.(type) { case *PutRequest_Body_Init_: { - const prefix string = ",\"init\":" - out.RawString(prefix[1:]) - xx.Init.MarshalEasyJSON(out) + if xx.Init != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"init\":" + out.RawString(prefix) + xx.Init.MarshalEasyJSON(out) + } } case *PutRequest_Body_Chunk: { - const prefix string = ",\"chunk\":" - out.RawString(prefix[1:]) - out.Base64Bytes(xx.Chunk) + if len(xx.Chunk) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chunk\":" + out.RawString(prefix) + out.Base64Bytes(xx.Chunk) + } } } out.RawByte('}') @@ -1746,21 +1900,43 @@ func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1903,11 +2079,19 @@ func (x *PutResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"objectId\":" - out.RawString(prefix[1:]) - x.ObjectId.MarshalEasyJSON(out) + if x.ObjectId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"objectId\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2100,21 +2284,43 @@ func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2257,11 +2463,19 @@ func (x *DeleteRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"address\":" - out.RawString(prefix[1:]) - x.Address.MarshalEasyJSON(out) + if x.Address != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2454,21 +2668,43 @@ func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2611,11 +2847,19 @@ func (x *DeleteResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"tombstone\":" - out.RawString(prefix[1:]) - x.Tombstone.MarshalEasyJSON(out) + if x.Tombstone != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"tombstone\":" + out.RawString(prefix) + x.Tombstone.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2808,21 +3052,43 @@ func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -3005,21 +3271,43 @@ func (x *HeadRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"address\":" - out.RawString(prefix[1:]) - x.Address.MarshalEasyJSON(out) + if x.Address != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) + } } { - const prefix string = ",\"mainOnly\":" - out.RawString(prefix) - out.Bool(x.MainOnly) + if x.MainOnly { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"mainOnly\":" + out.RawString(prefix) + out.Bool(x.MainOnly) + } } { - const prefix string = ",\"raw\":" - out.RawString(prefix) - out.Bool(x.Raw) + if x.Raw { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"raw\":" + out.RawString(prefix) + out.Bool(x.Raw) + } } out.RawByte('}') } @@ -3224,21 +3512,43 @@ func (x *HeadRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -3404,16 +3714,31 @@ func (x *HeaderWithSignature) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"header\":" - out.RawString(prefix[1:]) - x.Header.MarshalEasyJSON(out) + if x.Header != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) + } } { - const prefix string = ",\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if x.Signature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -3644,31 +3969,60 @@ func (x *HeadResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') switch xx := x.Head.(type) { case *HeadResponse_Body_Header: { - const prefix string = ",\"header\":" - out.RawString(prefix[1:]) - xx.Header.MarshalEasyJSON(out) + if xx.Header != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"header\":" + out.RawString(prefix) + xx.Header.MarshalEasyJSON(out) + } } case *HeadResponse_Body_ShortHeader: { - const prefix string = ",\"shortHeader\":" - out.RawString(prefix[1:]) - xx.ShortHeader.MarshalEasyJSON(out) + if xx.ShortHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"shortHeader\":" + out.RawString(prefix) + xx.ShortHeader.MarshalEasyJSON(out) + } } case *HeadResponse_Body_SplitInfo: { - const prefix string = ",\"splitInfo\":" - out.RawString(prefix[1:]) - xx.SplitInfo.MarshalEasyJSON(out) + if xx.SplitInfo != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitInfo\":" + out.RawString(prefix) + xx.SplitInfo.MarshalEasyJSON(out) + } } case *HeadResponse_Body_EcInfo: { - const prefix string = ",\"ecInfo\":" - out.RawString(prefix[1:]) - xx.EcInfo.MarshalEasyJSON(out) + if xx.EcInfo != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ecInfo\":" + out.RawString(prefix) + xx.EcInfo.MarshalEasyJSON(out) + } } } out.RawByte('}') @@ -3919,21 +4273,43 @@ func (x *HeadResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -4113,26 +4489,48 @@ func (x *SearchRequest_Body_Filter) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"matchType\":" - out.RawString(prefix[1:]) - v := int32(x.MatchType) - if vv, ok := MatchType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.MatchType != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"matchType\":" + out.RawString(prefix) + v := int32(x.MatchType) + if vv, ok := MatchType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } { - const prefix string = ",\"key\":" - out.RawString(prefix) - out.String(x.Key) + if len(x.Key) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } } { - const prefix string = ",\"value\":" - out.RawString(prefix) - out.String(x.Value) + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } } out.RawByte('}') } @@ -4334,28 +4732,50 @@ func (x *SearchRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"containerId\":" - out.RawString(prefix[1:]) - x.ContainerId.MarshalEasyJSON(out) - } - { - const prefix string = ",\"version\":" - out.RawString(prefix) - out.Uint32(x.Version) - } - { - const prefix string = ",\"filters\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Filters { - if i != 0 { + if x.ContainerId != nil { + if !first { out.RawByte(',') + } else { + first = false } - x.Filters[i].MarshalEasyJSON(out) + const prefix string = "\"containerId\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } + } + { + if x.Version != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"version\":" + out.RawString(prefix) + out.Uint32(x.Version) + } + } + { + if len(x.Filters) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -4568,21 +4988,43 @@ func (x *SearchRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -4728,18 +5170,26 @@ func (x *SearchResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"idList\":" - out.RawString(prefix[1:]) - out.RawByte('[') - for i := range x.IdList { - if i != 0 { + if len(x.IdList) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.IdList[i].MarshalEasyJSON(out) + const prefix string = "\"idList\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.IdList { + if i != 0 { + out.RawByte(',') + } + x.IdList[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -4939,21 +5389,43 @@ func (x *SearchResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -5113,16 +5585,31 @@ func (x *Range) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"offset\":" - out.RawString(prefix[1:]) - out.Uint64(x.Offset) + if x.Offset != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"offset\":" + out.RawString(prefix) + out.Uint64(x.Offset) + } } { - const prefix string = ",\"length\":" - out.RawString(prefix) - out.Uint64(x.Length) + if x.Length != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"length\":" + out.RawString(prefix) + out.Uint64(x.Length) + } } out.RawByte('}') } @@ -5299,21 +5786,43 @@ func (x *GetRangeRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"address\":" - out.RawString(prefix[1:]) - x.Address.MarshalEasyJSON(out) + if x.Address != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) + } } { - const prefix string = ",\"range\":" - out.RawString(prefix) - x.Range.MarshalEasyJSON(out) + if x.Range != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"range\":" + out.RawString(prefix) + x.Range.MarshalEasyJSON(out) + } } { - const prefix string = ",\"raw\":" - out.RawString(prefix) - out.Bool(x.Raw) + if x.Raw { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"raw\":" + out.RawString(prefix) + out.Bool(x.Raw) + } } out.RawByte('}') } @@ -5519,21 +6028,43 @@ func (x *GetRangeRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -5749,25 +6280,47 @@ func (x *GetRangeResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') switch xx := x.RangePart.(type) { case *GetRangeResponse_Body_Chunk: { - const prefix string = ",\"chunk\":" - out.RawString(prefix[1:]) - out.Base64Bytes(xx.Chunk) + if len(xx.Chunk) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chunk\":" + out.RawString(prefix) + out.Base64Bytes(xx.Chunk) + } } case *GetRangeResponse_Body_SplitInfo: { - const prefix string = ",\"splitInfo\":" - out.RawString(prefix[1:]) - xx.SplitInfo.MarshalEasyJSON(out) + if xx.SplitInfo != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitInfo\":" + out.RawString(prefix) + xx.SplitInfo.MarshalEasyJSON(out) + } } case *GetRangeResponse_Body_EcInfo: { - const prefix string = ",\"ecInfo\":" - out.RawString(prefix[1:]) - xx.EcInfo.MarshalEasyJSON(out) + if xx.EcInfo != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ecInfo\":" + out.RawString(prefix) + xx.EcInfo.MarshalEasyJSON(out) + } } } out.RawByte('}') @@ -6002,21 +6555,43 @@ func (x *GetRangeResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -6225,37 +6800,66 @@ func (x *GetRangeHashRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"address\":" - out.RawString(prefix[1:]) - x.Address.MarshalEasyJSON(out) - } - { - const prefix string = ",\"ranges\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Ranges { - if i != 0 { + if x.Address != nil { + if !first { out.RawByte(',') + } else { + first = false } - x.Ranges[i].MarshalEasyJSON(out) + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) } - out.RawByte(']') } { - const prefix string = ",\"salt\":" - out.RawString(prefix) - out.Base64Bytes(x.Salt) + if len(x.Ranges) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ranges\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Ranges { + if i != 0 { + out.RawByte(',') + } + x.Ranges[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } } { - const prefix string = ",\"type\":" - out.RawString(prefix) - v := int32(x.Type) - if vv, ok := grpc.ChecksumType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if len(x.Salt) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"salt\":" + out.RawString(prefix) + out.Base64Bytes(x.Salt) + } + } + { + if x.Type != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := grpc.ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } out.RawByte('}') @@ -6491,21 +7095,43 @@ func (x *GetRangeHashRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -6665,28 +7291,43 @@ func (x *GetRangeHashResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"type\":" - out.RawString(prefix[1:]) - v := int32(x.Type) - if vv, ok := grpc.ChecksumType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.Type != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := grpc.ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } { - const prefix string = ",\"hashList\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.HashList { - if i != 0 { + if len(x.HashList) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.Base64Bytes(x.HashList[i]) + const prefix string = "\"hashList\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.HashList { + if i != 0 { + out.RawByte(',') + } + out.Base64Bytes(x.HashList[i]) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -6907,21 +7548,43 @@ func (x *GetRangeHashResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -7086,23 +7749,38 @@ func (x *PutSingleRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"object\":" - out.RawString(prefix[1:]) - x.Object.MarshalEasyJSON(out) + if x.Object != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"object\":" + out.RawString(prefix) + x.Object.MarshalEasyJSON(out) + } } { - const prefix string = ",\"copiesNumber\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.CopiesNumber { - if i != 0 { + if len(x.CopiesNumber) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.Uint32(x.CopiesNumber[i]) + const prefix string = "\"copiesNumber\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.CopiesNumber { + if i != 0 { + out.RawByte(',') + } + out.Uint32(x.CopiesNumber[i]) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -7308,21 +7986,43 @@ func (x *PutSingleRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -7624,21 +8324,43 @@ func (x *PutSingleResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -7801,16 +8523,31 @@ func (x *PatchRequest_Body_Patch) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"sourceRange\":" - out.RawString(prefix[1:]) - x.SourceRange.MarshalEasyJSON(out) + if x.SourceRange != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"sourceRange\":" + out.RawString(prefix) + x.SourceRange.MarshalEasyJSON(out) + } } { - const prefix string = ",\"chunk\":" - out.RawString(prefix) - out.Base64Bytes(x.Chunk) + if len(x.Chunk) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chunk\":" + out.RawString(prefix) + out.Base64Bytes(x.Chunk) + } } out.RawByte('}') } @@ -8014,33 +8751,62 @@ func (x *PatchRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"address\":" - out.RawString(prefix[1:]) - x.Address.MarshalEasyJSON(out) - } - { - const prefix string = ",\"newAttributes\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.NewAttributes { - if i != 0 { + if x.Address != nil { + if !first { out.RawByte(',') + } else { + first = false } - x.NewAttributes[i].MarshalEasyJSON(out) + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) } - out.RawByte(']') } { - const prefix string = ",\"replaceAttributes\":" - out.RawString(prefix) - out.Bool(x.ReplaceAttributes) + if len(x.NewAttributes) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"newAttributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.NewAttributes { + if i != 0 { + out.RawByte(',') + } + x.NewAttributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } } { - const prefix string = ",\"patch\":" - out.RawString(prefix) - x.Patch.MarshalEasyJSON(out) + if x.ReplaceAttributes { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"replaceAttributes\":" + out.RawString(prefix) + out.Bool(x.ReplaceAttributes) + } + } + { + if x.Patch != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"patch\":" + out.RawString(prefix) + x.Patch.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -8260,21 +9026,43 @@ func (x *PatchRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -8417,11 +9205,19 @@ func (x *PatchResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"objectId\":" - out.RawString(prefix[1:]) - x.ObjectId.MarshalEasyJSON(out) + if x.ObjectId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"objectId\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -8614,21 +9410,43 @@ func (x *PatchResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } diff --git a/object/grpc/types_frostfs.pb.go b/object/grpc/types_frostfs.pb.go index 9fc2769..5b1eb2c 100644 --- a/object/grpc/types_frostfs.pb.go +++ b/object/grpc/types_frostfs.pb.go @@ -304,46 +304,96 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"version\":" - out.RawString(prefix[1:]) - x.Version.MarshalEasyJSON(out) - } - { - const prefix string = ",\"creationEpoch\":" - out.RawString(prefix) - out.Uint64(x.CreationEpoch) - } - { - const prefix string = ",\"ownerID\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) - } - { - const prefix string = ",\"objectType\":" - out.RawString(prefix) - v := int32(x.ObjectType) - if vv, ok := ObjectType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.Version != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) } } { - const prefix string = ",\"payloadLength\":" - out.RawString(prefix) - out.Uint64(x.PayloadLength) + if x.CreationEpoch != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"creationEpoch\":" + out.RawString(prefix) + out.Uint64(x.CreationEpoch) + } } { - const prefix string = ",\"payloadHash\":" - out.RawString(prefix) - x.PayloadHash.MarshalEasyJSON(out) + if x.OwnerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } } { - const prefix string = ",\"homomorphicHash\":" - out.RawString(prefix) - x.HomomorphicHash.MarshalEasyJSON(out) + if x.ObjectType != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"objectType\":" + out.RawString(prefix) + v := int32(x.ObjectType) + if vv, ok := ObjectType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } + } + } + { + if x.PayloadLength != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"payloadLength\":" + out.RawString(prefix) + out.Uint64(x.PayloadLength) + } + } + { + if x.PayloadHash != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"payloadHash\":" + out.RawString(prefix) + x.PayloadHash.MarshalEasyJSON(out) + } + } + { + if x.HomomorphicHash != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"homomorphicHash\":" + out.RawString(prefix) + x.HomomorphicHash.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -544,16 +594,31 @@ func (x *Header_Attribute) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"key\":" - out.RawString(prefix[1:]) - out.String(x.Key) + if len(x.Key) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } } { - const prefix string = ",\"value\":" - out.RawString(prefix) - out.String(x.Value) + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } } out.RawByte('}') } @@ -802,43 +867,86 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"parent\":" - out.RawString(prefix[1:]) - x.Parent.MarshalEasyJSON(out) - } - { - const prefix string = ",\"previous\":" - out.RawString(prefix) - x.Previous.MarshalEasyJSON(out) - } - { - const prefix string = ",\"parentSignature\":" - out.RawString(prefix) - x.ParentSignature.MarshalEasyJSON(out) - } - { - const prefix string = ",\"parentHeader\":" - out.RawString(prefix) - x.ParentHeader.MarshalEasyJSON(out) - } - { - const prefix string = ",\"children\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Children { - if i != 0 { + if x.Parent != nil { + if !first { out.RawByte(',') + } else { + first = false } - x.Children[i].MarshalEasyJSON(out) + const prefix string = "\"parent\":" + out.RawString(prefix) + x.Parent.MarshalEasyJSON(out) } - out.RawByte(']') } { - const prefix string = ",\"splitID\":" - out.RawString(prefix) - out.Base64Bytes(x.SplitId) + if x.Previous != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"previous\":" + out.RawString(prefix) + x.Previous.MarshalEasyJSON(out) + } + } + { + if x.ParentSignature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"parentSignature\":" + out.RawString(prefix) + x.ParentSignature.MarshalEasyJSON(out) + } + } + { + if x.ParentHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"parentHeader\":" + out.RawString(prefix) + x.ParentHeader.MarshalEasyJSON(out) + } + } + { + if len(x.Children) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"children\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Children { + if i != 0 { + out.RawByte(',') + } + x.Children[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + } + { + if len(x.SplitId) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitID\":" + out.RawString(prefix) + out.Base64Bytes(x.SplitId) + } } out.RawByte('}') } @@ -1157,53 +1265,110 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"parent\":" - out.RawString(prefix[1:]) - x.Parent.MarshalEasyJSON(out) - } - { - const prefix string = ",\"index\":" - out.RawString(prefix) - out.Uint32(x.Index) - } - { - const prefix string = ",\"total\":" - out.RawString(prefix) - out.Uint32(x.Total) - } - { - const prefix string = ",\"headerLength\":" - out.RawString(prefix) - out.Uint32(x.HeaderLength) - } - { - const prefix string = ",\"header\":" - out.RawString(prefix) - out.Base64Bytes(x.Header) - } - { - const prefix string = ",\"parentSplitID\":" - out.RawString(prefix) - out.Base64Bytes(x.ParentSplitId) - } - { - const prefix string = ",\"parentSplitParentID\":" - out.RawString(prefix) - x.ParentSplitParentId.MarshalEasyJSON(out) - } - { - const prefix string = ",\"parentAttributes\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.ParentAttributes { - if i != 0 { + if x.Parent != nil { + if !first { out.RawByte(',') + } else { + first = false } - x.ParentAttributes[i].MarshalEasyJSON(out) + const prefix string = "\"parent\":" + out.RawString(prefix) + x.Parent.MarshalEasyJSON(out) + } + } + { + if x.Index != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"index\":" + out.RawString(prefix) + out.Uint32(x.Index) + } + } + { + if x.Total != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"total\":" + out.RawString(prefix) + out.Uint32(x.Total) + } + } + { + if x.HeaderLength != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"headerLength\":" + out.RawString(prefix) + out.Uint32(x.HeaderLength) + } + } + { + if len(x.Header) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"header\":" + out.RawString(prefix) + out.Base64Bytes(x.Header) + } + } + { + if len(x.ParentSplitId) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"parentSplitID\":" + out.RawString(prefix) + out.Base64Bytes(x.ParentSplitId) + } + } + { + if x.ParentSplitParentId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"parentSplitParentID\":" + out.RawString(prefix) + x.ParentSplitParentId.MarshalEasyJSON(out) + } + } + { + if len(x.ParentAttributes) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"parentAttributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.ParentAttributes { + if i != 0 { + out.RawByte(',') + } + x.ParentAttributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -1630,78 +1795,163 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"version\":" - out.RawString(prefix[1:]) - x.Version.MarshalEasyJSON(out) - } - { - const prefix string = ",\"containerID\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) - } - { - const prefix string = ",\"ownerID\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) - } - { - const prefix string = ",\"creationEpoch\":" - out.RawString(prefix) - out.Uint64(x.CreationEpoch) - } - { - const prefix string = ",\"payloadLength\":" - out.RawString(prefix) - out.Uint64(x.PayloadLength) - } - { - const prefix string = ",\"payloadHash\":" - out.RawString(prefix) - x.PayloadHash.MarshalEasyJSON(out) - } - { - const prefix string = ",\"objectType\":" - out.RawString(prefix) - v := int32(x.ObjectType) - if vv, ok := ObjectType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } - } - { - const prefix string = ",\"homomorphicHash\":" - out.RawString(prefix) - x.HomomorphicHash.MarshalEasyJSON(out) - } - { - const prefix string = ",\"sessionToken\":" - out.RawString(prefix) - x.SessionToken.MarshalEasyJSON(out) - } - { - const prefix string = ",\"attributes\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Attributes { - if i != 0 { + if x.Version != nil { + if !first { out.RawByte(',') + } else { + first = false } - x.Attributes[i].MarshalEasyJSON(out) + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) } - out.RawByte(']') } { - const prefix string = ",\"split\":" - out.RawString(prefix) - x.Split.MarshalEasyJSON(out) + if x.ContainerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } } { - const prefix string = ",\"ec\":" - out.RawString(prefix) - x.Ec.MarshalEasyJSON(out) + if x.OwnerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } + } + { + if x.CreationEpoch != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"creationEpoch\":" + out.RawString(prefix) + out.Uint64(x.CreationEpoch) + } + } + { + if x.PayloadLength != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"payloadLength\":" + out.RawString(prefix) + out.Uint64(x.PayloadLength) + } + } + { + if x.PayloadHash != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"payloadHash\":" + out.RawString(prefix) + x.PayloadHash.MarshalEasyJSON(out) + } + } + { + if x.ObjectType != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"objectType\":" + out.RawString(prefix) + v := int32(x.ObjectType) + if vv, ok := ObjectType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } + } + } + { + if x.HomomorphicHash != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"homomorphicHash\":" + out.RawString(prefix) + x.HomomorphicHash.MarshalEasyJSON(out) + } + } + { + if x.SessionToken != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) + } + } + { + if len(x.Attributes) != 0 { + 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 x.Split != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"split\":" + out.RawString(prefix) + x.Split.MarshalEasyJSON(out) + } + } + { + if x.Ec != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ec\":" + out.RawString(prefix) + x.Ec.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1993,26 +2243,55 @@ func (x *Object) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"objectID\":" - out.RawString(prefix[1:]) - x.ObjectId.MarshalEasyJSON(out) + if x.ObjectId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"objectID\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) + } } { - const prefix string = ",\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if x.Signature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } } { - const prefix string = ",\"header\":" - out.RawString(prefix) - x.Header.MarshalEasyJSON(out) + if x.Header != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) + } } { - const prefix string = ",\"payload\":" - out.RawString(prefix) - out.Base64Bytes(x.Payload) + if len(x.Payload) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"payload\":" + out.RawString(prefix) + out.Base64Bytes(x.Payload) + } } out.RawByte('}') } @@ -2204,21 +2483,43 @@ func (x *SplitInfo) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"splitId\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.SplitId) + if len(x.SplitId) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitId\":" + out.RawString(prefix) + out.Base64Bytes(x.SplitId) + } } { - const prefix string = ",\"lastPart\":" - out.RawString(prefix) - x.LastPart.MarshalEasyJSON(out) + if x.LastPart != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"lastPart\":" + out.RawString(prefix) + x.LastPart.MarshalEasyJSON(out) + } } { - const prefix string = ",\"link\":" - out.RawString(prefix) - x.Link.MarshalEasyJSON(out) + if x.Link != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"link\":" + out.RawString(prefix) + x.Link.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2400,21 +2701,43 @@ func (x *ECInfo_Chunk) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"id\":" - out.RawString(prefix[1:]) - x.Id.MarshalEasyJSON(out) + if x.Id != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"id\":" + out.RawString(prefix) + x.Id.MarshalEasyJSON(out) + } } { - const prefix string = ",\"index\":" - out.RawString(prefix) - out.Uint32(x.Index) + if x.Index != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"index\":" + out.RawString(prefix) + out.Uint32(x.Index) + } } { - const prefix string = ",\"total\":" - out.RawString(prefix) - out.Uint32(x.Total) + if x.Total != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"total\":" + out.RawString(prefix) + out.Uint32(x.Total) + } } out.RawByte('}') } @@ -2558,18 +2881,26 @@ func (x *ECInfo) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"chunks\":" - out.RawString(prefix[1:]) - out.RawByte('[') - for i := range x.Chunks { - if i != 0 { + if len(x.Chunks) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Chunks[i].MarshalEasyJSON(out) + const prefix string = "\"chunks\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Chunks { + if i != 0 { + out.RawByte(',') + } + x.Chunks[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } diff --git a/refs/grpc/types_frostfs.pb.go b/refs/grpc/types_frostfs.pb.go index 5f35eba..869620f 100644 --- a/refs/grpc/types_frostfs.pb.go +++ b/refs/grpc/types_frostfs.pb.go @@ -190,16 +190,31 @@ func (x *Address) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"containerID\":" - out.RawString(prefix[1:]) - x.ContainerId.MarshalEasyJSON(out) + if x.ContainerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } } { - const prefix string = ",\"objectID\":" - out.RawString(prefix) - x.ObjectId.MarshalEasyJSON(out) + if x.ObjectId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"objectID\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -332,11 +347,19 @@ func (x *ObjectID) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"value\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.Value) + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.Base64Bytes(x.Value) + } } out.RawByte('}') } @@ -461,11 +484,19 @@ func (x *ContainerID) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"value\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.Value) + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.Base64Bytes(x.Value) + } } out.RawByte('}') } @@ -590,11 +621,19 @@ func (x *OwnerID) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"value\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.Value) + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.Base64Bytes(x.Value) + } } out.RawByte('}') } @@ -739,16 +778,31 @@ func (x *Version) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"major\":" - out.RawString(prefix[1:]) - out.Uint32(x.Major) + if x.Major != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"major\":" + out.RawString(prefix) + out.Uint32(x.Major) + } } { - const prefix string = ",\"minor\":" - out.RawString(prefix) - out.Uint32(x.Minor) + if x.Minor != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"minor\":" + out.RawString(prefix) + out.Uint32(x.Minor) + } } out.RawByte('}') } @@ -919,25 +973,47 @@ func (x *Signature) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"key\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.Key) + if len(x.Key) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.Base64Bytes(x.Key) + } } { - const prefix string = ",\"signature\":" - out.RawString(prefix) - out.Base64Bytes(x.Sign) + if len(x.Sign) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + out.Base64Bytes(x.Sign) + } } { - const prefix string = ",\"scheme\":" - out.RawString(prefix) - v := int32(x.Scheme) - if vv, ok := SignatureScheme_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.Scheme != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"scheme\":" + out.RawString(prefix) + v := int32(x.Scheme) + if vv, ok := SignatureScheme_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } out.RawByte('}') @@ -1111,16 +1187,31 @@ func (x *SignatureRFC6979) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"key\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.Key) + if len(x.Key) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.Base64Bytes(x.Key) + } } { - const prefix string = ",\"signature\":" - out.RawString(prefix) - out.Base64Bytes(x.Sign) + if len(x.Sign) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + out.Base64Bytes(x.Sign) + } } out.RawByte('}') } @@ -1271,21 +1362,36 @@ func (x *Checksum) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"type\":" - out.RawString(prefix[1:]) - v := int32(x.Type) - if vv, ok := ChecksumType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.Type != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } { - const prefix string = ",\"sum\":" - out.RawString(prefix) - out.Base64Bytes(x.Sum) + if len(x.Sum) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"sum\":" + out.RawString(prefix) + out.Base64Bytes(x.Sum) + } } out.RawByte('}') } diff --git a/session/grpc/service_frostfs.pb.go b/session/grpc/service_frostfs.pb.go index aa42ee8..a3f0111 100644 --- a/session/grpc/service_frostfs.pb.go +++ b/session/grpc/service_frostfs.pb.go @@ -117,16 +117,31 @@ func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"ownerId\":" - out.RawString(prefix[1:]) - x.OwnerId.MarshalEasyJSON(out) + if x.OwnerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerId\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } } { - const prefix string = ",\"expiration\":" - out.RawString(prefix) - out.Uint64(x.Expiration) + if x.Expiration != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"expiration\":" + out.RawString(prefix) + out.Uint64(x.Expiration) + } } out.RawByte('}') } @@ -325,21 +340,43 @@ func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -499,16 +536,31 @@ func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"id\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.Id) + if len(x.Id) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"id\":" + out.RawString(prefix) + out.Base64Bytes(x.Id) + } } { - const prefix string = ",\"sessionKey\":" - out.RawString(prefix) - out.Base64Bytes(x.SessionKey) + if len(x.SessionKey) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"sessionKey\":" + out.RawString(prefix) + out.Base64Bytes(x.SessionKey) + } } out.RawByte('}') } @@ -706,21 +758,43 @@ func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaHeader\":" - out.RawString(prefix) - x.MetaHeader.MarshalEasyJSON(out) + if x.MetaHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) + } } { - const prefix string = ",\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if x.VerifyHeader != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) + } } out.RawByte('}') } diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go index c92ab28..58807fe 100644 --- a/session/grpc/types_frostfs.pb.go +++ b/session/grpc/types_frostfs.pb.go @@ -179,23 +179,38 @@ func (x *ObjectSessionContext_Target) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"container\":" - out.RawString(prefix[1:]) - x.Container.MarshalEasyJSON(out) + if x.Container != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"container\":" + out.RawString(prefix) + x.Container.MarshalEasyJSON(out) + } } { - const prefix string = ",\"objects\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Objects { - if i != 0 { + if len(x.Objects) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Objects[i].MarshalEasyJSON(out) + const prefix string = "\"objects\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Objects { + if i != 0 { + out.RawByte(',') + } + x.Objects[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } @@ -358,21 +373,36 @@ func (x *ObjectSessionContext) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"verb\":" - out.RawString(prefix[1:]) - v := int32(x.Verb) - if vv, ok := ObjectSessionContext_Verb_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.Verb != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verb\":" + out.RawString(prefix) + v := int32(x.Verb) + if vv, ok := ObjectSessionContext_Verb_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } { - const prefix string = ",\"target\":" - out.RawString(prefix) - x.Target.MarshalEasyJSON(out) + if x.Target != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -601,26 +631,48 @@ func (x *ContainerSessionContext) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"verb\":" - out.RawString(prefix[1:]) - v := int32(x.Verb) - if vv, ok := ContainerSessionContext_Verb_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.Verb != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verb\":" + out.RawString(prefix) + v := int32(x.Verb) + if vv, ok := ContainerSessionContext_Verb_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } { - const prefix string = ",\"wildcard\":" - out.RawString(prefix) - out.Bool(x.Wildcard) + if x.Wildcard { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"wildcard\":" + out.RawString(prefix) + out.Bool(x.Wildcard) + } } { - const prefix string = ",\"containerID\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) + if x.ContainerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -814,21 +866,43 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"exp\":" - out.RawString(prefix[1:]) - out.Uint64(x.Exp) + if x.Exp != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"exp\":" + out.RawString(prefix) + out.Uint64(x.Exp) + } } { - const prefix string = ",\"nbf\":" - out.RawString(prefix) - out.Uint64(x.Nbf) + if x.Nbf != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"nbf\":" + out.RawString(prefix) + out.Uint64(x.Nbf) + } } { - const prefix string = ",\"iat\":" - out.RawString(prefix) - out.Uint64(x.Iat) + if x.Iat != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"iat\":" + out.RawString(prefix) + out.Uint64(x.Iat) + } } out.RawByte('}') } @@ -1095,39 +1169,82 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"id\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.Id) + if len(x.Id) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"id\":" + out.RawString(prefix) + out.Base64Bytes(x.Id) + } } { - const prefix string = ",\"ownerID\":" - out.RawString(prefix) - x.OwnerId.MarshalEasyJSON(out) + if x.OwnerId != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) + } } { - const prefix string = ",\"lifetime\":" - out.RawString(prefix) - x.Lifetime.MarshalEasyJSON(out) + if x.Lifetime != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"lifetime\":" + out.RawString(prefix) + x.Lifetime.MarshalEasyJSON(out) + } } { - const prefix string = ",\"sessionKey\":" - out.RawString(prefix) - out.Base64Bytes(x.SessionKey) + if len(x.SessionKey) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"sessionKey\":" + out.RawString(prefix) + out.Base64Bytes(x.SessionKey) + } } switch xx := x.Context.(type) { case *SessionToken_Body_Object: { - const prefix string = ",\"object\":" - out.RawString(prefix) - xx.Object.MarshalEasyJSON(out) + if xx.Object != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"object\":" + out.RawString(prefix) + xx.Object.MarshalEasyJSON(out) + } } case *SessionToken_Body_Container: { - const prefix string = ",\"container\":" - out.RawString(prefix) - xx.Container.MarshalEasyJSON(out) + if xx.Container != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"container\":" + out.RawString(prefix) + xx.Container.MarshalEasyJSON(out) + } } } out.RawByte('}') @@ -1333,16 +1450,31 @@ func (x *SessionToken) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"body\":" - out.RawString(prefix[1:]) - x.Body.MarshalEasyJSON(out) + if x.Body != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) + } } { - const prefix string = ",\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if x.Signature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -1495,16 +1627,31 @@ func (x *XHeader) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"key\":" - out.RawString(prefix[1:]) - out.String(x.Key) + if len(x.Key) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + out.String(x.Key) + } } { - const prefix string = ",\"value\":" - out.RawString(prefix) - out.String(x.Value) + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) + } } out.RawByte('}') } @@ -1793,53 +1940,110 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"version\":" - out.RawString(prefix[1:]) - x.Version.MarshalEasyJSON(out) - } - { - const prefix string = ",\"epoch\":" - out.RawString(prefix) - out.Uint64(x.Epoch) - } - { - const prefix string = ",\"ttl\":" - out.RawString(prefix) - out.Uint32(x.Ttl) - } - { - const prefix string = ",\"xHeaders\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.XHeaders { - if i != 0 { + if x.Version != nil { + if !first { out.RawByte(',') + } else { + first = false } - x.XHeaders[i].MarshalEasyJSON(out) + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) } - out.RawByte(']') } { - const prefix string = ",\"sessionToken\":" - out.RawString(prefix) - x.SessionToken.MarshalEasyJSON(out) + if x.Epoch != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"epoch\":" + out.RawString(prefix) + out.Uint64(x.Epoch) + } } { - const prefix string = ",\"bearerToken\":" - out.RawString(prefix) - x.BearerToken.MarshalEasyJSON(out) + if x.Ttl != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ttl\":" + out.RawString(prefix) + out.Uint32(x.Ttl) + } } { - const prefix string = ",\"origin\":" - out.RawString(prefix) - x.Origin.MarshalEasyJSON(out) + if len(x.XHeaders) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"xHeaders\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.XHeaders { + if i != 0 { + out.RawByte(',') + } + x.XHeaders[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } } { - const prefix string = ",\"magicNumber\":" - out.RawString(prefix) - out.Uint64(x.MagicNumber) + if x.SessionToken != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) + } + } + { + if x.BearerToken != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"bearerToken\":" + out.RawString(prefix) + x.BearerToken.MarshalEasyJSON(out) + } + } + { + if x.Origin != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) + } + } + { + if x.MagicNumber != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"magicNumber\":" + out.RawString(prefix) + out.Uint64(x.MagicNumber) + } } out.RawByte('}') } @@ -2133,43 +2337,86 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"version\":" - out.RawString(prefix[1:]) - x.Version.MarshalEasyJSON(out) - } - { - const prefix string = ",\"epoch\":" - out.RawString(prefix) - out.Uint64(x.Epoch) - } - { - const prefix string = ",\"ttl\":" - out.RawString(prefix) - out.Uint32(x.Ttl) - } - { - const prefix string = ",\"xHeaders\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.XHeaders { - if i != 0 { + if x.Version != nil { + if !first { out.RawByte(',') + } else { + first = false } - x.XHeaders[i].MarshalEasyJSON(out) + const prefix string = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) } - out.RawByte(']') } { - const prefix string = ",\"origin\":" - out.RawString(prefix) - x.Origin.MarshalEasyJSON(out) + if x.Epoch != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"epoch\":" + out.RawString(prefix) + out.Uint64(x.Epoch) + } } { - const prefix string = ",\"status\":" - out.RawString(prefix) - x.Status.MarshalEasyJSON(out) + if x.Ttl != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"ttl\":" + out.RawString(prefix) + out.Uint32(x.Ttl) + } + } + { + if len(x.XHeaders) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"xHeaders\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.XHeaders { + if i != 0 { + out.RawByte(',') + } + x.XHeaders[i].MarshalEasyJSON(out) + } + out.RawByte(']') + } + } + { + if x.Origin != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) + } + } + { + if x.Status != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"status\":" + out.RawString(prefix) + x.Status.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2407,26 +2654,55 @@ func (x *RequestVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"bodySignature\":" - out.RawString(prefix[1:]) - x.BodySignature.MarshalEasyJSON(out) + if x.BodySignature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"bodySignature\":" + out.RawString(prefix) + x.BodySignature.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaSignature\":" - out.RawString(prefix) - x.MetaSignature.MarshalEasyJSON(out) + if x.MetaSignature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaSignature\":" + out.RawString(prefix) + x.MetaSignature.MarshalEasyJSON(out) + } } { - const prefix string = ",\"originSignature\":" - out.RawString(prefix) - x.OriginSignature.MarshalEasyJSON(out) + if x.OriginSignature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"originSignature\":" + out.RawString(prefix) + x.OriginSignature.MarshalEasyJSON(out) + } } { - const prefix string = ",\"origin\":" - out.RawString(prefix) - x.Origin.MarshalEasyJSON(out) + if x.Origin != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) + } } out.RawByte('}') } @@ -2645,26 +2921,55 @@ func (x *ResponseVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"bodySignature\":" - out.RawString(prefix[1:]) - x.BodySignature.MarshalEasyJSON(out) + if x.BodySignature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"bodySignature\":" + out.RawString(prefix) + x.BodySignature.MarshalEasyJSON(out) + } } { - const prefix string = ",\"metaSignature\":" - out.RawString(prefix) - x.MetaSignature.MarshalEasyJSON(out) + if x.MetaSignature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"metaSignature\":" + out.RawString(prefix) + x.MetaSignature.MarshalEasyJSON(out) + } } { - const prefix string = ",\"originSignature\":" - out.RawString(prefix) - x.OriginSignature.MarshalEasyJSON(out) + if x.OriginSignature != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"originSignature\":" + out.RawString(prefix) + x.OriginSignature.MarshalEasyJSON(out) + } } { - const prefix string = ",\"origin\":" - out.RawString(prefix) - x.Origin.MarshalEasyJSON(out) + if x.Origin != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) + } } out.RawByte('}') } diff --git a/status/grpc/types_frostfs.pb.go b/status/grpc/types_frostfs.pb.go index 29dfebe..7581dbe 100644 --- a/status/grpc/types_frostfs.pb.go +++ b/status/grpc/types_frostfs.pb.go @@ -368,16 +368,31 @@ func (x *Status_Detail) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"id\":" - out.RawString(prefix[1:]) - out.Uint32(x.Id) + if x.Id != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"id\":" + out.RawString(prefix) + out.Uint32(x.Id) + } } { - const prefix string = ",\"value\":" - out.RawString(prefix) - out.Base64Bytes(x.Value) + if len(x.Value) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + out.Base64Bytes(x.Value) + } } out.RawByte('}') } @@ -554,28 +569,50 @@ func (x *Status) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"code\":" - out.RawString(prefix[1:]) - out.Uint32(x.Code) - } - { - const prefix string = ",\"message\":" - out.RawString(prefix) - out.String(x.Message) - } - { - const prefix string = ",\"details\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Details { - if i != 0 { + if x.Code != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Details[i].MarshalEasyJSON(out) + const prefix string = "\"code\":" + out.RawString(prefix) + out.Uint32(x.Code) + } + } + { + if len(x.Message) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"message\":" + out.RawString(prefix) + out.String(x.Message) + } + } + { + if len(x.Details) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"details\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Details { + if i != 0 { + out.RawByte(',') + } + x.Details[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } diff --git a/tombstone/grpc/types_frostfs.pb.go b/tombstone/grpc/types_frostfs.pb.go index f7bc48c..79afdfc 100644 --- a/tombstone/grpc/types_frostfs.pb.go +++ b/tombstone/grpc/types_frostfs.pb.go @@ -140,28 +140,50 @@ func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"expirationEpoch\":" - out.RawString(prefix[1:]) - out.Uint64(x.ExpirationEpoch) - } - { - const prefix string = ",\"splitID\":" - out.RawString(prefix) - out.Base64Bytes(x.SplitId) - } - { - const prefix string = ",\"members\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Members { - if i != 0 { + if x.ExpirationEpoch != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.Members[i].MarshalEasyJSON(out) + const prefix string = "\"expirationEpoch\":" + out.RawString(prefix) + out.Uint64(x.ExpirationEpoch) + } + } + { + if len(x.SplitId) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitID\":" + out.RawString(prefix) + out.Base64Bytes(x.SplitId) + } + } + { + if len(x.Members) != 0 { + 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(']') } out.RawByte('}') } diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index 005d6d1..03f3ece 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -130,11 +130,19 @@ func (x *Primitives_Aux) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"innerField\":" - out.RawString(prefix[1:]) - out.Uint32(x.InnerField) + if x.InnerField != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"innerField\":" + out.RawString(prefix) + out.Uint32(x.InnerField) + } } out.RawByte('}') } @@ -560,85 +568,184 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"fieldA\":" - out.RawString(prefix[1:]) - out.Base64Bytes(x.FieldA) + if len(x.FieldA) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldA\":" + out.RawString(prefix) + out.Base64Bytes(x.FieldA) + } } { - const prefix string = ",\"fieldB\":" - out.RawString(prefix) - out.String(x.FieldB) + if len(x.FieldB) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldB\":" + out.RawString(prefix) + out.String(x.FieldB) + } } { - const prefix string = ",\"fieldC\":" - out.RawString(prefix) - out.Bool(x.FieldC) + if x.FieldC { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldC\":" + out.RawString(prefix) + out.Bool(x.FieldC) + } } { - const prefix string = ",\"fieldD\":" - out.RawString(prefix) - out.Int32(x.FieldD) + if x.FieldD != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldD\":" + out.RawString(prefix) + out.Int32(x.FieldD) + } } { - const prefix string = ",\"fieldE\":" - out.RawString(prefix) - out.Uint32(x.FieldE) + if x.FieldE != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldE\":" + out.RawString(prefix) + out.Uint32(x.FieldE) + } } { - const prefix string = ",\"fieldF\":" - out.RawString(prefix) - out.Int64(x.FieldF) + if x.FieldF != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldF\":" + out.RawString(prefix) + out.Int64(x.FieldF) + } } { - const prefix string = ",\"fieldG\":" - out.RawString(prefix) - out.Uint64(x.FieldG) + if x.FieldG != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldG\":" + out.RawString(prefix) + out.Uint64(x.FieldG) + } } { - const prefix string = ",\"fieldI\":" - out.RawString(prefix) - out.Uint64(x.FieldI) + if x.FieldI != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldI\":" + out.RawString(prefix) + out.Uint64(x.FieldI) + } } { - const prefix string = ",\"fieldJ\":" - out.RawString(prefix) - out.Float64(x.FieldJ) + if x.FieldJ != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldJ\":" + out.RawString(prefix) + out.Float64(x.FieldJ) + } } { - const prefix string = ",\"fieldK\":" - out.RawString(prefix) - out.Uint32(x.FieldK) + if x.FieldK != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldK\":" + out.RawString(prefix) + out.Uint32(x.FieldK) + } } { - const prefix string = ",\"fieldH\":" - out.RawString(prefix) - v := int32(x.FieldH) - if vv, ok := Primitives_SomeEnum_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) + if x.FieldH != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldH\":" + out.RawString(prefix) + v := int32(x.FieldH) + if vv, ok := Primitives_SomeEnum_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + } } } switch xx := x.FieldM.(type) { case *Primitives_FieldMa: { - const prefix string = ",\"fieldMa\":" - out.RawString(prefix) - out.Base64Bytes(xx.FieldMa) + if len(xx.FieldMa) != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldMa\":" + out.RawString(prefix) + out.Base64Bytes(xx.FieldMa) + } } case *Primitives_FieldMe: { - const prefix string = ",\"fieldMe\":" - out.RawString(prefix) - out.Uint32(xx.FieldMe) + if xx.FieldMe != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldMe\":" + out.RawString(prefix) + out.Uint32(xx.FieldMe) + } } case *Primitives_FieldAux: { - const prefix string = ",\"fieldAux\":" - out.RawString(prefix) - xx.FieldAux.MarshalEasyJSON(out) + if xx.FieldAux != nil { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldAux\":" + out.RawString(prefix) + xx.FieldAux.MarshalEasyJSON(out) + } } } out.RawByte('}') @@ -887,11 +994,19 @@ func (x *RepPrimitives_Aux) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"innerField\":" - out.RawString(prefix[1:]) - out.Uint32(x.InnerField) + if x.InnerField != 0 { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"innerField\":" + out.RawString(prefix) + out.Uint32(x.InnerField) + } } out.RawByte('}') } @@ -1169,102 +1284,159 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) { out.RawString("null") return } + first := true out.RawByte('{') { - const prefix string = ",\"fieldA\":" - out.RawString(prefix[1:]) - out.RawByte('[') - for i := range x.FieldA { - if i != 0 { + if len(x.FieldA) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.Base64Bytes(x.FieldA[i]) + const prefix string = "\"fieldA\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldA { + if i != 0 { + out.RawByte(',') + } + out.Base64Bytes(x.FieldA[i]) + } + out.RawByte(']') } - out.RawByte(']') } { - const prefix string = ",\"fieldB\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldB { - if i != 0 { + if len(x.FieldB) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.String(x.FieldB[i]) + const prefix string = "\"fieldB\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldB { + if i != 0 { + out.RawByte(',') + } + out.String(x.FieldB[i]) + } + out.RawByte(']') } - out.RawByte(']') } { - const prefix string = ",\"fieldC\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldC { - if i != 0 { + if len(x.FieldC) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.Int32(x.FieldC[i]) + const prefix string = "\"fieldC\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldC { + if i != 0 { + out.RawByte(',') + } + out.Int32(x.FieldC[i]) + } + out.RawByte(']') } - out.RawByte(']') } { - const prefix string = ",\"fieldD\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldD { - if i != 0 { + if len(x.FieldD) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.Uint32(x.FieldD[i]) + const prefix string = "\"fieldD\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldD { + if i != 0 { + out.RawByte(',') + } + out.Uint32(x.FieldD[i]) + } + out.RawByte(']') } - out.RawByte(']') } { - const prefix string = ",\"fieldE\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldE { - if i != 0 { + if len(x.FieldE) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.Int64(x.FieldE[i]) + const prefix string = "\"fieldE\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldE { + if i != 0 { + out.RawByte(',') + } + out.Int64(x.FieldE[i]) + } + out.RawByte(']') } - out.RawByte(']') } { - const prefix string = ",\"fieldF\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldF { - if i != 0 { + if len(x.FieldF) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.Uint64(x.FieldF[i]) + const prefix string = "\"fieldF\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldF { + if i != 0 { + out.RawByte(',') + } + out.Uint64(x.FieldF[i]) + } + out.RawByte(']') } - out.RawByte(']') } { - const prefix string = ",\"fieldFu\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldFu { - if i != 0 { + if len(x.FieldFu) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - out.Uint64(x.FieldFu[i]) + const prefix string = "\"fieldFu\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldFu { + if i != 0 { + out.RawByte(',') + } + out.Uint64(x.FieldFu[i]) + } + out.RawByte(']') } - out.RawByte(']') } { - const prefix string = ",\"fieldAux\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldAux { - if i != 0 { + if len(x.FieldAux) != 0 { + if !first { out.RawByte(',') + } else { + first = false } - x.FieldAux[i].MarshalEasyJSON(out) + const prefix string = "\"fieldAux\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldAux { + if i != 0 { + out.RawByte(',') + } + x.FieldAux[i].MarshalEasyJSON(out) + } + out.RawByte(']') } - out.RawByte(']') } out.RawByte('}') } diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go index 95a06d5..ec70155 100644 --- a/util/protogen/internalgengo/json.go +++ b/util/protogen/internalgengo/json.go @@ -147,8 +147,11 @@ func emitJSONMarshal(g *protogen.GeneratedFile, msg *protogen.Message) { g.P("func (x *", msg.GoIdent.GoName, ") MarshalEasyJSON(out *", jwriterPackage.Ident("Writer"), ") {") g.P(`if x == nil { out.RawString("null"); return }`) + if len(msg.Fields) != 0 { + g.P("first := true") + } g.P("out.RawByte('{')") - for i, f := range msg.Fields { + for _, f := range msg.Fields { if f.Oneof != nil { if f.Oneof.Fields[0] != f { continue @@ -157,29 +160,35 @@ func emitJSONMarshal(g *protogen.GeneratedFile, msg *protogen.Message) { g.P("switch xx := x.", f.Oneof.GoName, ".(type) {") for _, ff := range f.Oneof.Fields { g.P("case *", ff.GoIdent, ":") - emitJSONFieldWrite(g, ff, "xx", i == 0) + emitJSONFieldWrite(g, ff, "xx") } g.P("}") continue } - emitJSONFieldWrite(g, f, "x", i == 0) + emitJSONFieldWrite(g, f, "x") } g.P("out.RawByte('}')") g.P("}") } -func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name string, first bool) { +func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name string) { g.P("{") defer g.P("}") - g.P("const prefix string = ", `",\"`, fieldJSONName(f), `\":"`) - if first { - g.P("out.RawString(prefix[1:])") - } else { - g.P("out.RawString(prefix)") - } - selector := name + "." + f.GoName + + isNotDefault := notNil + if f.Desc.IsList() { + isNotDefault = notEmpty + } else if f.Desc.Kind() != protoreflect.MessageKind { + _, isNotDefault = easyprotoKindInfo(f.Desc.Kind()) + } + g.P("if ", isNotDefault(selector), "{") + defer g.P("}") + + g.P("if !first { out.RawByte(','); } else { first = false; }") + g.P("const prefix string = ", `"\"`, fieldJSONName(f), `\":"`) + g.P("out.RawString(prefix)") if f.Desc.IsList() { selector += "[i]" g.P("out.RawByte('[')") From d94b9c6d0d6030e551a58ae260d943290fd8e38e Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 1 Oct 2024 13:50:27 +0300 Subject: [PATCH 161/169] [#120] protogen: Unmarshal stringified integers from JSON Signed-off-by: Evgenii Stratonikov --- accounting/grpc/types_frostfs.pb.go | 21 +++- acl/grpc/types_frostfs.pb.go | 30 ++++- container/grpc/types_frostfs.pb.go | 11 +- netmap/grpc/types_frostfs.pb.go | 90 ++++++++++++-- object/grpc/service_frostfs.pb.go | 50 +++++++- object/grpc/types_frostfs.pb.go | 90 ++++++++++++-- refs/grpc/types_frostfs.pb.go | 20 +++- session/grpc/service_frostfs.pb.go | 11 +- session/grpc/types_frostfs.pb.go | 80 +++++++++++-- status/grpc/types_frostfs.pb.go | 20 +++- tombstone/grpc/types_frostfs.pb.go | 11 +- util/proto/test/custom/test_frostfs.pb.go | 140 +++++++++++++++++++--- util/protogen/internalgengo/json.go | 23 +++- 13 files changed, 536 insertions(+), 61 deletions(-) diff --git a/accounting/grpc/types_frostfs.pb.go b/accounting/grpc/types_frostfs.pb.go index 0ae770b..438cd03 100644 --- a/accounting/grpc/types_frostfs.pb.go +++ b/accounting/grpc/types_frostfs.pb.go @@ -11,6 +11,7 @@ import ( easyproto "github.com/VictoriaMetrics/easyproto" jlexer "github.com/mailru/easyjson/jlexer" jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" ) type Decimal struct { @@ -170,13 +171,29 @@ func (x *Decimal) UnmarshalEasyJSON(in *jlexer.Lexer) { case "value": { var f int64 - f = in.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 - f = in.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 } } diff --git a/acl/grpc/types_frostfs.pb.go b/acl/grpc/types_frostfs.pb.go index 57e1682..6ebaf63 100644 --- a/acl/grpc/types_frostfs.pb.go +++ b/acl/grpc/types_frostfs.pb.go @@ -1481,19 +1481,43 @@ func (x *BearerToken_Body_TokenLifetime) UnmarshalEasyJSON(in *jlexer.Lexer) { case "exp": { var f uint64 - f = in.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.Exp = f } case "nbf": { var f uint64 - f = in.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.Nbf = f } case "iat": { var f uint64 - f = in.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.Iat = f } } diff --git a/container/grpc/types_frostfs.pb.go b/container/grpc/types_frostfs.pb.go index 9db07ed..e5da35f 100644 --- a/container/grpc/types_frostfs.pb.go +++ b/container/grpc/types_frostfs.pb.go @@ -13,6 +13,7 @@ import ( easyproto "github.com/VictoriaMetrics/easyproto" jlexer "github.com/mailru/easyjson/jlexer" jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" ) type Container_Attribute struct { @@ -517,7 +518,15 @@ func (x *Container) UnmarshalEasyJSON(in *jlexer.Lexer) { case "basicACL": { var f uint32 - f = in.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": diff --git a/netmap/grpc/types_frostfs.pb.go b/netmap/grpc/types_frostfs.pb.go index d082910..24b7575 100644 --- a/netmap/grpc/types_frostfs.pb.go +++ b/netmap/grpc/types_frostfs.pb.go @@ -703,7 +703,15 @@ func (x *Selector) UnmarshalEasyJSON(in *jlexer.Lexer) { case "count": { var f uint32 - f = in.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.Count = f } case "clause": @@ -970,7 +978,15 @@ func (x *Replica) UnmarshalEasyJSON(in *jlexer.Lexer) { case "count": { var f uint32 - f = in.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.Count = f } case "selector": @@ -982,13 +998,29 @@ func (x *Replica) UnmarshalEasyJSON(in *jlexer.Lexer) { case "ecDataCount": { var f uint32 - f = in.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.EcDataCount = f } case "ecParityCount": { var f uint32 - f = in.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.EcParityCount = f } } @@ -1306,7 +1338,15 @@ func (x *PlacementPolicy) UnmarshalEasyJSON(in *jlexer.Lexer) { case "containerBackupFactor": { var f uint32 - f = in.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.ContainerBackupFactor = f } case "selectors": @@ -2094,7 +2134,15 @@ func (x *Netmap) UnmarshalEasyJSON(in *jlexer.Lexer) { case "epoch": { var f uint64 - f = in.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.Epoch = f } case "nodes": @@ -2677,19 +2725,43 @@ func (x *NetworkInfo) UnmarshalEasyJSON(in *jlexer.Lexer) { case "currentEpoch": { var f uint64 - f = in.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.CurrentEpoch = f } case "magicNumber": { var f uint64 - f = in.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.MagicNumber = f } case "msPerBlock": { var f int64 - f = in.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.MsPerBlock = f } case "networkConfig": diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go index 2434bd3..0130ee3 100644 --- a/object/grpc/service_frostfs.pb.go +++ b/object/grpc/service_frostfs.pb.go @@ -1508,7 +1508,15 @@ func (x *PutRequest_Body_Init) UnmarshalEasyJSON(in *jlexer.Lexer) { var list []uint32 in.Delim('[') for !in.IsDelim(']') { - f = in.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 list = append(list, f) in.WantComma() } @@ -4815,7 +4823,15 @@ func (x *SearchRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { case "version": { var f uint32 - f = in.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.Version = f } case "filters": @@ -5642,13 +5658,29 @@ func (x *Range) UnmarshalEasyJSON(in *jlexer.Lexer) { case "offset": { var f uint64 - f = in.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.Offset = f } case "length": { var f uint64 - f = in.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.Length = f } } @@ -7823,7 +7855,15 @@ func (x *PutSingleRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { var list []uint32 in.Delim('[') for !in.IsDelim(']') { - f = in.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 list = append(list, f) in.WantComma() } diff --git a/object/grpc/types_frostfs.pb.go b/object/grpc/types_frostfs.pb.go index 5b1eb2c..bc246cf 100644 --- a/object/grpc/types_frostfs.pb.go +++ b/object/grpc/types_frostfs.pb.go @@ -433,7 +433,15 @@ func (x *ShortHeader) UnmarshalEasyJSON(in *jlexer.Lexer) { case "creationEpoch": { var f uint64 - f = in.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.CreationEpoch = f } case "ownerID": @@ -468,7 +476,15 @@ func (x *ShortHeader) UnmarshalEasyJSON(in *jlexer.Lexer) { case "payloadLength": { var f uint64 - f = in.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.PayloadLength = f } case "payloadHash": @@ -1408,19 +1424,43 @@ func (x *Header_EC) UnmarshalEasyJSON(in *jlexer.Lexer) { case "index": { var f uint32 - f = in.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.Index = f } case "total": { var f uint32 - f = in.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.Total = f } case "headerLength": { var f uint32 - f = in.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.HeaderLength = f } case "header": @@ -2005,13 +2045,29 @@ func (x *Header) UnmarshalEasyJSON(in *jlexer.Lexer) { case "creationEpoch": { var f uint64 - f = in.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.CreationEpoch = f } case "payloadLength": { var f uint64 - f = in.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.PayloadLength = f } case "payloadHash": @@ -2777,13 +2833,29 @@ func (x *ECInfo_Chunk) UnmarshalEasyJSON(in *jlexer.Lexer) { case "index": { var f uint32 - f = in.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.Index = f } case "total": { var f uint32 - f = in.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.Total = f } } diff --git a/refs/grpc/types_frostfs.pb.go b/refs/grpc/types_frostfs.pb.go index 869620f..3ed647c 100644 --- a/refs/grpc/types_frostfs.pb.go +++ b/refs/grpc/types_frostfs.pb.go @@ -835,13 +835,29 @@ func (x *Version) UnmarshalEasyJSON(in *jlexer.Lexer) { case "major": { var f uint32 - f = in.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.Major = f } case "minor": { var f uint32 - f = in.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.Minor = f } } diff --git a/session/grpc/service_frostfs.pb.go b/session/grpc/service_frostfs.pb.go index a3f0111..71a6a41 100644 --- a/session/grpc/service_frostfs.pb.go +++ b/session/grpc/service_frostfs.pb.go @@ -12,6 +12,7 @@ import ( easyproto "github.com/VictoriaMetrics/easyproto" jlexer "github.com/mailru/easyjson/jlexer" jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" ) type CreateRequest_Body struct { @@ -181,7 +182,15 @@ func (x *CreateRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { case "expiration": { var f uint64 - f = in.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 } } diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go index 58807fe..1b6a664 100644 --- a/session/grpc/types_frostfs.pb.go +++ b/session/grpc/types_frostfs.pb.go @@ -935,19 +935,43 @@ func (x *SessionToken_Body_TokenLifetime) UnmarshalEasyJSON(in *jlexer.Lexer) { case "exp": { var f uint64 - f = in.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.Exp = f } case "nbf": { var f uint64 - f = in.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.Nbf = f } case "iat": { var f uint64 - f = in.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.Iat = f } } @@ -2083,13 +2107,29 @@ func (x *RequestMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) { case "epoch": { var f uint64 - f = in.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.Epoch = f } case "ttl": { var f uint32 - f = in.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.Ttl = f } case "xHeaders": @@ -2130,7 +2170,15 @@ func (x *RequestMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) { case "magicNumber": { var f uint64 - f = in.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.MagicNumber = f } } @@ -2456,13 +2504,29 @@ func (x *ResponseMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) { case "epoch": { var f uint64 - f = in.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.Epoch = f } case "ttl": { var f uint32 - f = in.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.Ttl = f } case "xHeaders": diff --git a/status/grpc/types_frostfs.pb.go b/status/grpc/types_frostfs.pb.go index 7581dbe..609fc03 100644 --- a/status/grpc/types_frostfs.pb.go +++ b/status/grpc/types_frostfs.pb.go @@ -425,7 +425,15 @@ func (x *Status_Detail) UnmarshalEasyJSON(in *jlexer.Lexer) { case "id": { var f uint32 - f = in.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.Id = f } case "value": @@ -645,7 +653,15 @@ func (x *Status) UnmarshalEasyJSON(in *jlexer.Lexer) { case "code": { var f uint32 - f = in.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.Code = f } case "message": diff --git a/tombstone/grpc/types_frostfs.pb.go b/tombstone/grpc/types_frostfs.pb.go index 79afdfc..0971045 100644 --- a/tombstone/grpc/types_frostfs.pb.go +++ b/tombstone/grpc/types_frostfs.pb.go @@ -12,6 +12,7 @@ import ( easyproto "github.com/VictoriaMetrics/easyproto" jlexer "github.com/mailru/easyjson/jlexer" jwriter "github.com/mailru/easyjson/jwriter" + strconv "strconv" ) type Tombstone struct { @@ -216,7 +217,15 @@ func (x *Tombstone) UnmarshalEasyJSON(in *jlexer.Lexer) { case "expirationEpoch": { var f uint64 - f = in.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.ExpirationEpoch = f } case "splitID": diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index 03f3ece..15e77af 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -175,7 +175,15 @@ func (x *Primitives_Aux) UnmarshalEasyJSON(in *jlexer.Lexer) { case "innerField": { var f uint32 - f = in.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.InnerField = f } } @@ -797,31 +805,71 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) { case "fieldD": { var f int32 - f = in.Int32() + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseInt(n, 10, 32) + if err != nil { + in.AddError(err) + return + } + pv := int32(v) + f = pv x.FieldD = f } case "fieldE": { var f uint32 - f = in.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.FieldE = f } case "fieldF": { var f int64 - f = in.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.FieldF = f } case "fieldG": { var f uint64 - f = in.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.FieldG = f } case "fieldI": { var f uint64 - f = in.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.FieldI = f } case "fieldJ": @@ -833,7 +881,15 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) { case "fieldK": { var f uint32 - f = in.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.FieldK = f } case "fieldH": @@ -871,7 +927,15 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) { x.FieldM = xx { var f uint32 - f = in.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 xx.FieldMe = f } case "fieldAux": @@ -1039,7 +1103,15 @@ func (x *RepPrimitives_Aux) UnmarshalEasyJSON(in *jlexer.Lexer) { case "innerField": { var f uint32 - f = in.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.InnerField = f } } @@ -1498,7 +1570,15 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) { var list []int32 in.Delim('[') for !in.IsDelim(']') { - f = in.Int32() + r := in.JsonNumber() + n := r.String() + v, err := strconv.ParseInt(n, 10, 32) + if err != nil { + in.AddError(err) + return + } + pv := int32(v) + f = pv list = append(list, f) in.WantComma() } @@ -1511,7 +1591,15 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) { var list []uint32 in.Delim('[') for !in.IsDelim(']') { - f = in.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 list = append(list, f) in.WantComma() } @@ -1524,7 +1612,15 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) { var list []int64 in.Delim('[') for !in.IsDelim(']') { - f = in.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 list = append(list, f) in.WantComma() } @@ -1537,7 +1633,15 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) { var list []uint64 in.Delim('[') for !in.IsDelim(']') { - f = in.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 list = append(list, f) in.WantComma() } @@ -1550,7 +1654,15 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) { var list []uint64 in.Delim('[') for !in.IsDelim(']') { - f = in.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 list = append(list, f) in.WantComma() } diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go index ec70155..4d7f4be 100644 --- a/util/protogen/internalgengo/json.go +++ b/util/protogen/internalgengo/json.go @@ -59,6 +59,17 @@ func emitJSONUnmarshal(g *protogen.GeneratedFile, msg *protogen.Message) { g.P("}") } +func emitJSONParseInteger(g *protogen.GeneratedFile, ident string, method string, bitSize int, typ string) { + g.P("r := in.JsonNumber()") + g.P("n := r.String()") + g.P("v, err := ", strconvPackage.Ident(method), "(n, 10, ", bitSize, ")") + g.P("if err != nil {") + g.P(" in.AddError(err)") + g.P(" return") + g.P("}") + g.P(ident, " := ", typ, "(v)") +} + func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string) { g.P("{") defer g.P("}") @@ -100,13 +111,17 @@ func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string }`) template = "%s = parsedValue" case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - template = "%s = in.Int32()" + emitJSONParseInteger(g, "pv", "ParseInt", 32, "int32") + template = "%s = pv" case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - template = "%s = in.Uint32()" + emitJSONParseInteger(g, "pv", "ParseUint", 32, "uint32") + template = "%s = pv" case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - template = "%s = in.Int64()" + emitJSONParseInteger(g, "pv", "ParseInt", 64, "int64") + template = "%s = pv" case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - template = "%s = in.Uint64()" + emitJSONParseInteger(g, "pv", "ParseUint", 64, "uint64") + template = "%s = pv" case protoreflect.FloatKind: template = "%s = in.Float32()" case protoreflect.DoubleKind: From b06dad731c711082abfb6f88a54a77ee7cc6d043 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 1 Oct 2024 13:50:43 +0300 Subject: [PATCH 162/169] [#120] protogen: Marshal 64-bit integers as strings Signed-off-by: Evgenii Stratonikov --- accounting/grpc/types_frostfs.pb.go | 4 +++- acl/grpc/types_frostfs.pb.go | 12 +++++++++--- netmap/grpc/types_frostfs.pb.go | 16 +++++++++++---- object/grpc/service_frostfs.pb.go | 8 ++++++-- object/grpc/types_frostfs.pb.go | 16 +++++++++++---- session/grpc/service_frostfs.pb.go | 4 +++- session/grpc/types_frostfs.pb.go | 24 +++++++++++++++++------ tombstone/grpc/types_frostfs.pb.go | 4 +++- util/proto/test/custom/test_frostfs.pb.go | 24 +++++++++++++++++------ util/protogen/internalgengo/json.go | 10 ++++++++-- 10 files changed, 92 insertions(+), 30 deletions(-) diff --git a/accounting/grpc/types_frostfs.pb.go b/accounting/grpc/types_frostfs.pb.go index 438cd03..8585583 100644 --- a/accounting/grpc/types_frostfs.pb.go +++ b/accounting/grpc/types_frostfs.pb.go @@ -125,7 +125,9 @@ func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"value\":" out.RawString(prefix) - out.Int64(x.Value) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.Value, 10) + out.RawByte('"') } } { diff --git a/acl/grpc/types_frostfs.pb.go b/acl/grpc/types_frostfs.pb.go index 6ebaf63..1ba6c53 100644 --- a/acl/grpc/types_frostfs.pb.go +++ b/acl/grpc/types_frostfs.pb.go @@ -1423,7 +1423,9 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"exp\":" out.RawString(prefix) - out.Uint64(x.Exp) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Exp, 10) + out.RawByte('"') } } { @@ -1435,7 +1437,9 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"nbf\":" out.RawString(prefix) - out.Uint64(x.Nbf) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10) + out.RawByte('"') } } { @@ -1447,7 +1451,9 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"iat\":" out.RawString(prefix) - out.Uint64(x.Iat) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10) + out.RawByte('"') } } out.RawByte('}') diff --git a/netmap/grpc/types_frostfs.pb.go b/netmap/grpc/types_frostfs.pb.go index 24b7575..a4b10f9 100644 --- a/netmap/grpc/types_frostfs.pb.go +++ b/netmap/grpc/types_frostfs.pb.go @@ -2081,7 +2081,9 @@ func (x *Netmap) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"epoch\":" out.RawString(prefix) - out.Uint64(x.Epoch) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10) + out.RawByte('"') } } { @@ -2655,7 +2657,9 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"currentEpoch\":" out.RawString(prefix) - out.Uint64(x.CurrentEpoch) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CurrentEpoch, 10) + out.RawByte('"') } } { @@ -2667,7 +2671,9 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"magicNumber\":" out.RawString(prefix) - out.Uint64(x.MagicNumber) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10) + out.RawByte('"') } } { @@ -2679,7 +2685,9 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"msPerBlock\":" out.RawString(prefix) - out.Int64(x.MsPerBlock) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.MsPerBlock, 10) + out.RawByte('"') } } { diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go index 0130ee3..f934f3b 100644 --- a/object/grpc/service_frostfs.pb.go +++ b/object/grpc/service_frostfs.pb.go @@ -5612,7 +5612,9 @@ func (x *Range) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"offset\":" out.RawString(prefix) - out.Uint64(x.Offset) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Offset, 10) + out.RawByte('"') } } { @@ -5624,7 +5626,9 @@ func (x *Range) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"length\":" out.RawString(prefix) - out.Uint64(x.Length) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Length, 10) + out.RawByte('"') } } out.RawByte('}') diff --git a/object/grpc/types_frostfs.pb.go b/object/grpc/types_frostfs.pb.go index bc246cf..0ee939a 100644 --- a/object/grpc/types_frostfs.pb.go +++ b/object/grpc/types_frostfs.pb.go @@ -327,7 +327,9 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"creationEpoch\":" out.RawString(prefix) - out.Uint64(x.CreationEpoch) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10) + out.RawByte('"') } } { @@ -368,7 +370,9 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"payloadLength\":" out.RawString(prefix) - out.Uint64(x.PayloadLength) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10) + out.RawByte('"') } } { @@ -1882,7 +1886,9 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"creationEpoch\":" out.RawString(prefix) - out.Uint64(x.CreationEpoch) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10) + out.RawByte('"') } } { @@ -1894,7 +1900,9 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"payloadLength\":" out.RawString(prefix) - out.Uint64(x.PayloadLength) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10) + out.RawByte('"') } } { diff --git a/session/grpc/service_frostfs.pb.go b/session/grpc/service_frostfs.pb.go index 71a6a41..c71325a 100644 --- a/session/grpc/service_frostfs.pb.go +++ b/session/grpc/service_frostfs.pb.go @@ -141,7 +141,9 @@ func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"expiration\":" out.RawString(prefix) - out.Uint64(x.Expiration) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Expiration, 10) + out.RawByte('"') } } out.RawByte('}') diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go index 1b6a664..e18c1ab 100644 --- a/session/grpc/types_frostfs.pb.go +++ b/session/grpc/types_frostfs.pb.go @@ -877,7 +877,9 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"exp\":" out.RawString(prefix) - out.Uint64(x.Exp) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Exp, 10) + out.RawByte('"') } } { @@ -889,7 +891,9 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"nbf\":" out.RawString(prefix) - out.Uint64(x.Nbf) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10) + out.RawByte('"') } } { @@ -901,7 +905,9 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"iat\":" out.RawString(prefix) - out.Uint64(x.Iat) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10) + out.RawByte('"') } } out.RawByte('}') @@ -1987,7 +1993,9 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"epoch\":" out.RawString(prefix) - out.Uint64(x.Epoch) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10) + out.RawByte('"') } } { @@ -2066,7 +2074,9 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"magicNumber\":" out.RawString(prefix) - out.Uint64(x.MagicNumber) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10) + out.RawByte('"') } } out.RawByte('}') @@ -2408,7 +2418,9 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"epoch\":" out.RawString(prefix) - out.Uint64(x.Epoch) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10) + out.RawByte('"') } } { diff --git a/tombstone/grpc/types_frostfs.pb.go b/tombstone/grpc/types_frostfs.pb.go index 0971045..e5b67d5 100644 --- a/tombstone/grpc/types_frostfs.pb.go +++ b/tombstone/grpc/types_frostfs.pb.go @@ -152,7 +152,9 @@ func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"expirationEpoch\":" out.RawString(prefix) - out.Uint64(x.ExpirationEpoch) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.ExpirationEpoch, 10) + out.RawByte('"') } } { diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index 15e77af..3804e46 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -647,7 +647,9 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"fieldF\":" out.RawString(prefix) - out.Int64(x.FieldF) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldF, 10) + out.RawByte('"') } } { @@ -659,7 +661,9 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"fieldG\":" out.RawString(prefix) - out.Uint64(x.FieldG) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldG, 10) + out.RawByte('"') } } { @@ -671,7 +675,9 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) { } const prefix string = "\"fieldI\":" out.RawString(prefix) - out.Uint64(x.FieldI) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldI, 10) + out.RawByte('"') } } { @@ -1448,7 +1454,9 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) { if i != 0 { out.RawByte(',') } - out.Int64(x.FieldE[i]) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldE[i], 10) + out.RawByte('"') } out.RawByte(']') } @@ -1467,7 +1475,9 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) { if i != 0 { out.RawByte(',') } - out.Uint64(x.FieldF[i]) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldF[i], 10) + out.RawByte('"') } out.RawByte(']') } @@ -1486,7 +1496,9 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) { if i != 0 { out.RawByte(',') } - out.Uint64(x.FieldFu[i]) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldFu[i], 10) + out.RawByte('"') } out.RawByte(']') } diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go index 4d7f4be..3267955 100644 --- a/util/protogen/internalgengo/json.go +++ b/util/protogen/internalgengo/json.go @@ -231,9 +231,15 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: template = "out.Uint32(%s)" case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - template = "out.Int64(%s)" + g.P("out.RawByte('\"')") + g.P("out.Buffer.Buf = ", strconvPackage.Ident("AppendInt"), "(out.Buffer.Buf, ", selector, ", 10)") + g.P("out.RawByte('\"')") + return case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - template = "out.Uint64(%s)" + g.P("out.RawByte('\"')") + g.P("out.Buffer.Buf = ", strconvPackage.Ident("AppendUint"), "(out.Buffer.Buf, ", selector, ", 10)") + g.P("out.RawByte('\"')") + return case protoreflect.FloatKind: template = "out.Float32(%s)" case protoreflect.DoubleKind: From d9a604fbc16fdcd988716a74cfd839eb3f83f50c Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 1 Oct 2024 13:54:32 +0300 Subject: [PATCH 163/169] [#120] proto/test: Unskip protojson compatibility test Signed-off-by: Evgenii Stratonikov --- util/proto/marshal_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index 98422fc..8b717be 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -77,7 +77,6 @@ func TestStableMarshalSingle(t *testing.T) { require.NoError(t, protojson.Unmarshal(r, &actual)) t.Run("protojson compatibility", func(t *testing.T) { - t.Skip() data, err := protojson.Marshal(&actual) require.NoError(t, err) require.JSONEq(t, string(data), string(r)) From 3e705a3cbe84752a263d6e7ba64c57a3dd091f5b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 2 Oct 2024 09:47:08 +0300 Subject: [PATCH 164/169] [#121] .golangci.yml: Replace exportloopref with copyloopvar Fix linter warning: ``` WARN The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar. ``` Signed-off-by: Evgenii Stratonikov --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index c6f4308..eacdf7b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -50,7 +50,7 @@ linters: - bidichk - durationcheck - exhaustive - - exportloopref + - copyloopvar - gofmt - goimports - misspell From 29c522d5d8a31721b32fa0932f2f4abba445ec77 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 7 Oct 2024 15:00:16 +0300 Subject: [PATCH 165/169] [#122] protogen: Always marshal empty fields This is how it was done previously: https://git.frostfs.info/TrueCloudLab/frostfs-api-go/src/commit/a0a9b765f3a56423b1c6f1fef1d1b413da0e03ef/rpc/message/encoding.go#L31 The tricky part is `[]byte` which is marshaled as `null` by easyjson helper, but as `""` by protojson. Signed-off-by: Evgenii Stratonikov --- accounting/grpc/service_frostfs.pb.go | 128 +- accounting/grpc/types_frostfs.pb.go | 36 +- acl/grpc/types_frostfs.pb.go | 536 +++--- ape/grpc/types_frostfs.pb.go | 60 +- apemanager/grpc/service_frostfs.pb.go | 418 ++--- container/grpc/service_frostfs.pb.go | 574 +++--- container/grpc/types_frostfs.pb.go | 144 +- lock/grpc/types_frostfs.pb.go | 30 +- netmap/grpc/service_frostfs.pb.go | 352 ++-- netmap/grpc/types_frostfs.pb.go | 756 ++++---- object/grpc/service_frostfs.pb.go | 1926 +++++++++------------ object/grpc/types_frostfs.pb.go | 892 +++++----- refs/grpc/types_frostfs.pb.go | 260 +-- session/grpc/service_frostfs.pb.go | 168 +- session/grpc/types_frostfs.pb.go | 762 ++++---- status/grpc/types_frostfs.pb.go | 96 +- tombstone/grpc/types_frostfs.pb.go | 68 +- util/proto/marshal_test.go | 44 +- util/proto/test/custom/test_frostfs.pb.go | 530 +++--- util/protogen/internalgengo/json.go | 24 +- 20 files changed, 3574 insertions(+), 4230 deletions(-) diff --git a/accounting/grpc/service_frostfs.pb.go b/accounting/grpc/service_frostfs.pb.go index 4f11303..9c8c946 100644 --- a/accounting/grpc/service_frostfs.pb.go +++ b/accounting/grpc/service_frostfs.pb.go @@ -101,16 +101,14 @@ func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.OwnerId != nil { - 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 = "\"ownerId\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) } out.RawByte('}') } @@ -306,40 +304,34 @@ func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -485,16 +477,14 @@ func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Balance != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"balance\":" - out.RawString(prefix) - x.Balance.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"balance\":" + out.RawString(prefix) + x.Balance.MarshalEasyJSON(out) } out.RawByte('}') } @@ -690,40 +680,34 @@ func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } diff --git a/accounting/grpc/types_frostfs.pb.go b/accounting/grpc/types_frostfs.pb.go index 8585583..b7e6b40 100644 --- a/accounting/grpc/types_frostfs.pb.go +++ b/accounting/grpc/types_frostfs.pb.go @@ -117,30 +117,26 @@ func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Value != 0 { - 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 = "\"value\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.Value, 10) + out.RawByte('"') } { - if x.Precision != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"precision\":" - out.RawString(prefix) - out.Uint32(x.Precision) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"precision\":" + out.RawString(prefix) + out.Uint32(x.Precision) } out.RawByte('}') } diff --git a/acl/grpc/types_frostfs.pb.go b/acl/grpc/types_frostfs.pb.go index 1ba6c53..e5a6f32 100644 --- a/acl/grpc/types_frostfs.pb.go +++ b/acl/grpc/types_frostfs.pb.go @@ -355,62 +355,54 @@ func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.HeaderType != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"headerType\":" - out.RawString(prefix) - v := int32(x.HeaderType) - if vv, ok := HeaderType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"headerType\":" + out.RawString(prefix) + v := int32(x.HeaderType) + if vv, ok := HeaderType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if x.MatchType != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"matchType\":" - out.RawString(prefix) - v := int32(x.MatchType) - if vv, ok := MatchType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"matchType\":" + out.RawString(prefix) + v := int32(x.MatchType) + if vv, ok := MatchType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if len(x.Key) != 0 { - 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 = "\"key\":" + out.RawString(prefix) + out.String(x.Key) } { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) } out.RawByte('}') } @@ -608,40 +600,40 @@ func (x *EACLRecord_Target) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Role != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"role\":" - out.RawString(prefix) - v := int32(x.Role) - if vv, ok := Role_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"role\":" + out.RawString(prefix) + v := int32(x.Role) + if vv, ok := Role_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if len(x.Keys) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"keys\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Keys { - if i != 0 { - out.RawByte(',') - } - out.Base64Bytes(x.Keys[i]) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"keys\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Keys { + if i != 0 { + out.RawByte(',') + } + if x.Keys[i] != nil { + out.Base64Bytes(x.Keys[i]) + } else { + out.String("") + } + } + out.RawByte(']') } out.RawByte('}') } @@ -870,76 +862,68 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Operation != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"operation\":" - out.RawString(prefix) - v := int32(x.Operation) - if vv, ok := Operation_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"operation\":" + out.RawString(prefix) + v := int32(x.Operation) + if vv, ok := Operation_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if x.Action != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"action\":" - out.RawString(prefix) - v := int32(x.Action) - if vv, ok := Action_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"action\":" + out.RawString(prefix) + v := int32(x.Action) + if vv, ok := Action_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if len(x.Filters) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"filters\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Filters { - if i != 0 { - out.RawByte(',') - } - x.Filters[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if len(x.Targets) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"targets\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Targets { - if i != 0 { - out.RawByte(',') - } - x.Targets[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"targets\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Targets { + if i != 0 { + out.RawByte(',') + } + x.Targets[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -1185,47 +1169,41 @@ func (x *EACLTable) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Version != nil { - 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 = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) } { - if x.ContainerId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerID\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) } { - if len(x.Records) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"records\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Records { - if i != 0 { - out.RawByte(',') - } - x.Records[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"records\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Records { + if i != 0 { + out.RawByte(',') + } + x.Records[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -1415,46 +1393,40 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Exp != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"exp\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Exp, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"exp\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Exp, 10) + out.RawByte('"') } { - if x.Nbf != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"nbf\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"nbf\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10) + out.RawByte('"') } { - if x.Iat != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"iat\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"iat\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10) + out.RawByte('"') } out.RawByte('}') } @@ -1647,35 +1619,31 @@ func (x *BearerToken_Body_APEOverride) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Target != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"target\":" - out.RawString(prefix) - x.Target.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) } { - if len(x.Chains) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"chains\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Chains { - if i != 0 { - out.RawByte(',') - } - x.Chains[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"chains\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Chains { + if i != 0 { + out.RawByte(',') + } + x.Chains[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -1910,64 +1878,54 @@ func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.EaclTable != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"eaclTable\":" - out.RawString(prefix) - x.EaclTable.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"eaclTable\":" + out.RawString(prefix) + x.EaclTable.MarshalEasyJSON(out) } { - if x.OwnerId != nil { - 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 = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) } { - if x.Lifetime != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"lifetime\":" - out.RawString(prefix) - x.Lifetime.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"lifetime\":" + out.RawString(prefix) + x.Lifetime.MarshalEasyJSON(out) } { - if x.AllowImpersonate { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"allowImpersonate\":" - out.RawString(prefix) - out.Bool(x.AllowImpersonate) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"allowImpersonate\":" + out.RawString(prefix) + out.Bool(x.AllowImpersonate) } { - if x.ApeOverride != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"apeOverride\":" - out.RawString(prefix) - x.ApeOverride.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"apeOverride\":" + out.RawString(prefix) + x.ApeOverride.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2149,28 +2107,24 @@ func (x *BearerToken) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.Signature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) } out.RawByte('}') } diff --git a/ape/grpc/types_frostfs.pb.go b/ape/grpc/types_frostfs.pb.go index 7967e13..cf9499f 100644 --- a/ape/grpc/types_frostfs.pb.go +++ b/ape/grpc/types_frostfs.pb.go @@ -158,33 +158,29 @@ func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Type != 0 { - 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 = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := TargetType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if len(x.Name) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"name\":" - out.RawString(prefix) - out.String(x.Name) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"name\":" + out.RawString(prefix) + out.String(x.Name) } out.RawByte('}') } @@ -358,15 +354,17 @@ func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) { switch xx := x.Kind.(type) { case *Chain_Raw: { - if len(xx.Raw) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"raw\":" - out.RawString(prefix) + 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("") } } } diff --git a/apemanager/grpc/service_frostfs.pb.go b/apemanager/grpc/service_frostfs.pb.go index 2a30850..7f3ed10 100644 --- a/apemanager/grpc/service_frostfs.pb.go +++ b/apemanager/grpc/service_frostfs.pb.go @@ -124,28 +124,24 @@ func (x *AddChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Target != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"target\":" - out.RawString(prefix) - x.Target.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) } { - if x.Chain != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"chain\":" - out.RawString(prefix) - x.Chain.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"chain\":" + out.RawString(prefix) + x.Chain.MarshalEasyJSON(out) } out.RawByte('}') } @@ -348,40 +344,34 @@ func (x *AddChainRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -524,15 +514,17 @@ func (x *AddChainResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.ChainId) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"chainId\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chainId\":" + out.RawString(prefix) + if x.ChainId != nil { out.Base64Bytes(x.ChainId) + } else { + out.String("") } } out.RawByte('}') @@ -728,40 +720,34 @@ func (x *AddChainResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -927,27 +913,27 @@ func (x *RemoveChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Target != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"target\":" - out.RawString(prefix) - x.Target.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) } { - if len(x.ChainId) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"chainId\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chainId\":" + out.RawString(prefix) + if x.ChainId != nil { out.Base64Bytes(x.ChainId) + } else { + out.String("") } } out.RawByte('}') @@ -1150,40 +1136,34 @@ func (x *RemoveChainRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1488,40 +1468,34 @@ func (x *RemoveChainResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1667,16 +1641,14 @@ func (x *ListChainsRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Target != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"target\":" - out.RawString(prefix) - x.Target.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1872,40 +1844,34 @@ func (x *ListChainsRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2054,23 +2020,21 @@ func (x *ListChainsResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Chains) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"chains\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Chains { - if i != 0 { - out.RawByte(',') - } - x.Chains[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"chains\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Chains { + if i != 0 { + out.RawByte(',') + } + x.Chains[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -2273,40 +2237,34 @@ func (x *ListChainsResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } diff --git a/container/grpc/service_frostfs.pb.go b/container/grpc/service_frostfs.pb.go index 4ccb595..cc05dde 100644 --- a/container/grpc/service_frostfs.pb.go +++ b/container/grpc/service_frostfs.pb.go @@ -124,28 +124,24 @@ func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Container != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"container\":" - out.RawString(prefix) - x.Container.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"container\":" + out.RawString(prefix) + x.Container.MarshalEasyJSON(out) } { - if x.Signature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) } out.RawByte('}') } @@ -348,40 +344,34 @@ func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -527,16 +517,14 @@ func (x *PutResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ContainerId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerId\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"containerId\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) } out.RawByte('}') } @@ -732,40 +720,34 @@ func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -934,28 +916,24 @@ func (x *DeleteRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ContainerId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerId\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"containerId\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) } { - if x.Signature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1158,40 +1136,34 @@ func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1496,40 +1468,34 @@ func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1675,16 +1641,14 @@ func (x *GetRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ContainerId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerId\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"containerId\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1880,40 +1844,34 @@ func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2105,40 +2063,34 @@ func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Container != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"container\":" - out.RawString(prefix) - x.Container.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"container\":" + out.RawString(prefix) + x.Container.MarshalEasyJSON(out) } { - if x.Signature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) } { - if x.SessionToken != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"sessionToken\":" - out.RawString(prefix) - x.SessionToken.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2348,40 +2300,34 @@ func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2527,16 +2473,14 @@ func (x *ListRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.OwnerId != nil { - 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 = "\"ownerId\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2732,40 +2676,34 @@ func (x *ListRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2914,23 +2852,21 @@ func (x *ListResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.ContainerIds) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerIds\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.ContainerIds { - if i != 0 { - out.RawByte(',') - } - x.ContainerIds[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"containerIds\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.ContainerIds { + if i != 0 { + out.RawByte(',') + } + x.ContainerIds[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -3133,40 +3069,34 @@ func (x *ListResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } diff --git a/container/grpc/types_frostfs.pb.go b/container/grpc/types_frostfs.pb.go index e5da35f..4ca23fa 100644 --- a/container/grpc/types_frostfs.pb.go +++ b/container/grpc/types_frostfs.pb.go @@ -119,28 +119,24 @@ func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Key) != 0 { - 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 = "\"key\":" + out.RawString(prefix) + out.String(x.Key) } { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) } out.RawByte('}') } @@ -389,83 +385,75 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Version != nil { - 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 = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) } { - if x.OwnerId != nil { - 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 = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) } { - if len(x.Nonce) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"nonce\":" - out.RawString(prefix) + 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 x.BasicAcl != 0 { - 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 = "\"basicACL\":" + out.RawString(prefix) + out.Uint32(x.BasicAcl) } { - if len(x.Attributes) != 0 { - 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 = "\"attributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Attributes { + if i != 0 { + out.RawByte(',') + } + x.Attributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if x.PlacementPolicy != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"placementPolicy\":" - out.RawString(prefix) - x.PlacementPolicy.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"placementPolicy\":" + out.RawString(prefix) + x.PlacementPolicy.MarshalEasyJSON(out) } out.RawByte('}') } diff --git a/lock/grpc/types_frostfs.pb.go b/lock/grpc/types_frostfs.pb.go index 33f22c5..004a01f 100644 --- a/lock/grpc/types_frostfs.pb.go +++ b/lock/grpc/types_frostfs.pb.go @@ -103,23 +103,21 @@ func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Members) != 0 { - 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(']') + 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('}') } diff --git a/netmap/grpc/service_frostfs.pb.go b/netmap/grpc/service_frostfs.pb.go index 4d53031..9ebbf98 100644 --- a/netmap/grpc/service_frostfs.pb.go +++ b/netmap/grpc/service_frostfs.pb.go @@ -260,40 +260,34 @@ func (x *LocalNodeInfoRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -462,28 +456,24 @@ func (x *LocalNodeInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Version != nil { - 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 = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) } { - if x.NodeInfo != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"nodeInfo\":" - out.RawString(prefix) - x.NodeInfo.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"nodeInfo\":" + out.RawString(prefix) + x.NodeInfo.MarshalEasyJSON(out) } out.RawByte('}') } @@ -686,40 +676,34 @@ func (x *LocalNodeInfoResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1024,40 +1008,34 @@ func (x *NetworkInfoRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1203,16 +1181,14 @@ func (x *NetworkInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.NetworkInfo != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"networkInfo\":" - out.RawString(prefix) - x.NetworkInfo.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"networkInfo\":" + out.RawString(prefix) + x.NetworkInfo.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1408,40 +1384,34 @@ func (x *NetworkInfoResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1746,40 +1716,34 @@ func (x *NetmapSnapshotRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1925,16 +1889,14 @@ func (x *NetmapSnapshotResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Netmap != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"netmap\":" - out.RawString(prefix) - x.Netmap.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"netmap\":" + out.RawString(prefix) + x.Netmap.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2130,40 +2092,34 @@ func (x *NetmapSnapshotResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } diff --git a/netmap/grpc/types_frostfs.pb.go b/netmap/grpc/types_frostfs.pb.go index a4b10f9..0328531 100644 --- a/netmap/grpc/types_frostfs.pb.go +++ b/netmap/grpc/types_frostfs.pb.go @@ -277,76 +277,66 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Name) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"name\":" - out.RawString(prefix) - out.String(x.Name) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"name\":" + out.RawString(prefix) + out.String(x.Name) + } + { + 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 = "\"op\":" + out.RawString(prefix) + v := int32(x.Op) + if vv, ok := Operation_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if len(x.Key) != 0 { - 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) } { - if x.Op != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"op\":" - out.RawString(prefix) - v := int32(x.Op) - if vv, ok := Operation_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false } - } - { - if len(x.Value) != 0 { - if !first { + const prefix string = "\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { out.RawByte(',') - } else { - first = false } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) - } - } - { - if len(x.Filters) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"filters\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Filters { - if i != 0 { - out.RawByte(',') - } - x.Filters[i].MarshalEasyJSON(out) - } - out.RawByte(']') + x.Filters[i].MarshalEasyJSON(out) } + out.RawByte(']') } out.RawByte('}') } @@ -602,69 +592,59 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Name) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"name\":" - out.RawString(prefix) - out.String(x.Name) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"name\":" + out.RawString(prefix) + out.String(x.Name) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"count\":" + out.RawString(prefix) + out.Uint32(x.Count) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"clause\":" + out.RawString(prefix) + v := int32(x.Clause) + if vv, ok := Clause_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if x.Count != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"count\":" - out.RawString(prefix) - out.Uint32(x.Count) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"attribute\":" + out.RawString(prefix) + out.String(x.Attribute) } { - if x.Clause != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"clause\":" - out.RawString(prefix) - v := int32(x.Clause) - if vv, ok := Clause_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } - } - } - { - if len(x.Attribute) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"attribute\":" - out.RawString(prefix) - out.String(x.Attribute) - } - } - { - if len(x.Filter) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"filter\":" - out.RawString(prefix) - out.String(x.Filter) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"filter\":" + out.RawString(prefix) + out.String(x.Filter) } out.RawByte('}') } @@ -900,52 +880,44 @@ func (x *Replica) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Count != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"count\":" - out.RawString(prefix) - out.Uint32(x.Count) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"count\":" + out.RawString(prefix) + out.Uint32(x.Count) } { - if len(x.Selector) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"selector\":" - out.RawString(prefix) - out.String(x.Selector) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"selector\":" + out.RawString(prefix) + out.String(x.Selector) } { - if x.EcDataCount != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ecDataCount\":" - out.RawString(prefix) - out.Uint32(x.EcDataCount) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"ecDataCount\":" + out.RawString(prefix) + out.Uint32(x.EcDataCount) } { - if x.EcParityCount != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ecParityCount\":" - out.RawString(prefix) - out.Uint32(x.EcParityCount) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"ecParityCount\":" + out.RawString(prefix) + out.Uint32(x.EcParityCount) } out.RawByte('}') } @@ -1213,85 +1185,75 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Replicas) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"replicas\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Replicas { - if i != 0 { - out.RawByte(',') - } - x.Replicas[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"replicas\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Replicas { + if i != 0 { + out.RawByte(',') + } + x.Replicas[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if x.ContainerBackupFactor != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerBackupFactor\":" - out.RawString(prefix) - out.Uint32(x.ContainerBackupFactor) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"containerBackupFactor\":" + out.RawString(prefix) + out.Uint32(x.ContainerBackupFactor) } { - if len(x.Selectors) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"selectors\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Selectors { - if i != 0 { - out.RawByte(',') - } - x.Selectors[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"selectors\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Selectors { + if i != 0 { + out.RawByte(',') + } + x.Selectors[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if len(x.Filters) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"filters\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Filters { - if i != 0 { - out.RawByte(',') - } - x.Filters[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if x.Unique { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"unique\":" - out.RawString(prefix) - out.Bool(x.Unique) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"unique\":" + out.RawString(prefix) + out.Bool(x.Unique) } out.RawByte('}') } @@ -1553,47 +1515,41 @@ func (x *NodeInfo_Attribute) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Key) != 0 { - 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 = "\"key\":" + out.RawString(prefix) + out.String(x.Key) } { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) } { - if len(x.Parents) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"parents\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Parents { - if i != 0 { - out.RawByte(',') - } - out.String(x.Parents[i]) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"parents\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Parents { + if i != 0 { + out.RawByte(',') + } + out.String(x.Parents[i]) + } + out.RawByte(']') } out.RawByte('}') } @@ -1806,70 +1762,66 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.PublicKey) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"publicKey\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"publicKey\":" + out.RawString(prefix) + if x.PublicKey != nil { out.Base64Bytes(x.PublicKey) + } else { + out.String("") } } { - if len(x.Addresses) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"addresses\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Addresses { - if i != 0 { - out.RawByte(',') - } - out.String(x.Addresses[i]) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"addresses\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Addresses { + if i != 0 { + out.RawByte(',') + } + out.String(x.Addresses[i]) + } + out.RawByte(']') } { - if len(x.Attributes) != 0 { - 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 = "\"attributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Attributes { + if i != 0 { + out.RawByte(',') + } + x.Attributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if x.State != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"state\":" - out.RawString(prefix) - v := int32(x.State) - if vv, ok := NodeInfo_State_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"state\":" + out.RawString(prefix) + v := int32(x.State) + if vv, ok := NodeInfo_State_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } out.RawByte('}') @@ -2073,37 +2025,33 @@ func (x *Netmap) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Epoch != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"epoch\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"epoch\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10) + out.RawByte('"') } { - if len(x.Nodes) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"nodes\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Nodes { - if i != 0 { - out.RawByte(',') - } - x.Nodes[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"nodes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Nodes { + if i != 0 { + out.RawByte(',') + } + x.Nodes[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -2273,27 +2221,31 @@ func (x *NetworkConfig_Parameter) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Key) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"key\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + if x.Key != nil { out.Base64Bytes(x.Key) + } else { + out.String("") } } { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + if x.Value != nil { out.Base64Bytes(x.Value) + } else { + out.String("") } } out.RawByte('}') @@ -2434,23 +2386,21 @@ func (x *NetworkConfig) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Parameters) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"parameters\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Parameters { - if i != 0 { - out.RawByte(',') - } - x.Parameters[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"parameters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Parameters { + if i != 0 { + out.RawByte(',') + } + x.Parameters[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -2649,58 +2599,50 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.CurrentEpoch != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"currentEpoch\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CurrentEpoch, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"currentEpoch\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CurrentEpoch, 10) + out.RawByte('"') } { - if x.MagicNumber != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"magicNumber\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"magicNumber\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10) + out.RawByte('"') } { - if x.MsPerBlock != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"msPerBlock\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.MsPerBlock, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"msPerBlock\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.MsPerBlock, 10) + out.RawByte('"') } { - if x.NetworkConfig != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"networkConfig\":" - out.RawString(prefix) - x.NetworkConfig.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"networkConfig\":" + out.RawString(prefix) + x.NetworkConfig.MarshalEasyJSON(out) } out.RawByte('}') } diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go index f934f3b..9ee5a3d 100644 --- a/object/grpc/service_frostfs.pb.go +++ b/object/grpc/service_frostfs.pb.go @@ -122,28 +122,24 @@ func (x *GetRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Address != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"address\":" - out.RawString(prefix) - x.Address.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) } { - if x.Raw { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"raw\":" - out.RawString(prefix) - out.Bool(x.Raw) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"raw\":" + out.RawString(prefix) + out.Bool(x.Raw) } out.RawByte('}') } @@ -345,40 +341,34 @@ func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -570,40 +560,34 @@ func (x *GetResponse_Body_Init) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ObjectId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objectId\":" - out.RawString(prefix) - x.ObjectId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"objectId\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) } { - if x.Signature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) } { - if x.Header != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"header\":" - out.RawString(prefix) - x.Header.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) } out.RawByte('}') } @@ -851,55 +835,51 @@ func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { switch xx := x.ObjectPart.(type) { case *GetResponse_Body_Init_: { - if xx.Init != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"init\":" - out.RawString(prefix) - xx.Init.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"init\":" + out.RawString(prefix) + xx.Init.MarshalEasyJSON(out) } case *GetResponse_Body_Chunk: { - if len(xx.Chunk) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"chunk\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chunk\":" + out.RawString(prefix) + if xx.Chunk != nil { out.Base64Bytes(xx.Chunk) + } else { + out.String("") } } case *GetResponse_Body_SplitInfo: { - if xx.SplitInfo != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"splitInfo\":" - out.RawString(prefix) - xx.SplitInfo.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"splitInfo\":" + out.RawString(prefix) + xx.SplitInfo.MarshalEasyJSON(out) } case *GetResponse_Body_EcInfo: { - if xx.EcInfo != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ecInfo\":" - out.RawString(prefix) - xx.EcInfo.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"ecInfo\":" + out.RawString(prefix) + xx.EcInfo.MarshalEasyJSON(out) } } out.RawByte('}') @@ -1152,40 +1132,34 @@ func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1399,59 +1373,51 @@ func (x *PutRequest_Body_Init) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ObjectId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objectId\":" - out.RawString(prefix) - x.ObjectId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"objectId\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) } { - if x.Signature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) } { - if x.Header != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"header\":" - out.RawString(prefix) - x.Header.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) } { - if len(x.CopiesNumber) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"copiesNumber\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.CopiesNumber { - if i != 0 { - out.RawByte(',') - } - out.Uint32(x.CopiesNumber[i]) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"copiesNumber\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.CopiesNumber { + if i != 0 { + out.RawByte(',') + } + out.Uint32(x.CopiesNumber[i]) + } + out.RawByte(']') } out.RawByte('}') } @@ -1666,28 +1632,28 @@ func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { switch xx := x.ObjectPart.(type) { case *PutRequest_Body_Init_: { - if xx.Init != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"init\":" - out.RawString(prefix) - xx.Init.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"init\":" + out.RawString(prefix) + xx.Init.MarshalEasyJSON(out) } case *PutRequest_Body_Chunk: { - if len(xx.Chunk) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"chunk\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chunk\":" + out.RawString(prefix) + if xx.Chunk != nil { out.Base64Bytes(xx.Chunk) + } else { + out.String("") } } } @@ -1911,40 +1877,34 @@ func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2090,16 +2050,14 @@ func (x *PutResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ObjectId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objectId\":" - out.RawString(prefix) - x.ObjectId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"objectId\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2295,40 +2253,34 @@ func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2474,16 +2426,14 @@ func (x *DeleteRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Address != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"address\":" - out.RawString(prefix) - x.Address.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2679,40 +2629,34 @@ func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2858,16 +2802,14 @@ func (x *DeleteResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Tombstone != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"tombstone\":" - out.RawString(prefix) - x.Tombstone.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"tombstone\":" + out.RawString(prefix) + x.Tombstone.MarshalEasyJSON(out) } out.RawByte('}') } @@ -3063,40 +3005,34 @@ func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -3282,40 +3218,34 @@ func (x *HeadRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Address != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"address\":" - out.RawString(prefix) - x.Address.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) } { - if x.MainOnly { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"mainOnly\":" - out.RawString(prefix) - out.Bool(x.MainOnly) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"mainOnly\":" + out.RawString(prefix) + out.Bool(x.MainOnly) } { - if x.Raw { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"raw\":" - out.RawString(prefix) - out.Bool(x.Raw) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"raw\":" + out.RawString(prefix) + out.Bool(x.Raw) } out.RawByte('}') } @@ -3523,40 +3453,34 @@ func (x *HeadRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -3725,28 +3649,24 @@ func (x *HeaderWithSignature) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Header != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"header\":" - out.RawString(prefix) - x.Header.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) } { - if x.Signature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) } out.RawByte('}') } @@ -3982,55 +3902,47 @@ func (x *HeadResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { switch xx := x.Head.(type) { case *HeadResponse_Body_Header: { - if xx.Header != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"header\":" - out.RawString(prefix) - xx.Header.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"header\":" + out.RawString(prefix) + xx.Header.MarshalEasyJSON(out) } case *HeadResponse_Body_ShortHeader: { - if xx.ShortHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"shortHeader\":" - out.RawString(prefix) - xx.ShortHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"shortHeader\":" + out.RawString(prefix) + xx.ShortHeader.MarshalEasyJSON(out) } case *HeadResponse_Body_SplitInfo: { - if xx.SplitInfo != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"splitInfo\":" - out.RawString(prefix) - xx.SplitInfo.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"splitInfo\":" + out.RawString(prefix) + xx.SplitInfo.MarshalEasyJSON(out) } case *HeadResponse_Body_EcInfo: { - if xx.EcInfo != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ecInfo\":" - out.RawString(prefix) - xx.EcInfo.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"ecInfo\":" + out.RawString(prefix) + xx.EcInfo.MarshalEasyJSON(out) } } out.RawByte('}') @@ -4284,40 +4196,34 @@ func (x *HeadResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -4500,45 +4406,39 @@ func (x *SearchRequest_Body_Filter) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.MatchType != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"matchType\":" - out.RawString(prefix) - v := int32(x.MatchType) - if vv, ok := MatchType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"matchType\":" + out.RawString(prefix) + v := int32(x.MatchType) + if vv, ok := MatchType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if len(x.Key) != 0 { - 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 = "\"key\":" + out.RawString(prefix) + out.String(x.Key) } { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) } out.RawByte('}') } @@ -4743,47 +4643,41 @@ func (x *SearchRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ContainerId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerId\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"containerId\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) } { - if x.Version != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"version\":" - out.RawString(prefix) - out.Uint32(x.Version) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"version\":" + out.RawString(prefix) + out.Uint32(x.Version) } { - if len(x.Filters) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"filters\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Filters { - if i != 0 { - out.RawByte(',') - } - x.Filters[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"filters\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Filters { + if i != 0 { + out.RawByte(',') + } + x.Filters[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -5007,40 +4901,34 @@ func (x *SearchRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -5189,23 +5077,21 @@ func (x *SearchResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.IdList) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"idList\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.IdList { - if i != 0 { - out.RawByte(',') - } - x.IdList[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"idList\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.IdList { + if i != 0 { + out.RawByte(',') + } + x.IdList[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -5408,40 +5294,34 @@ func (x *SearchResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -5604,32 +5484,28 @@ func (x *Range) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Offset != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"offset\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Offset, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"offset\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Offset, 10) + out.RawByte('"') } { - if x.Length != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"length\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Length, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"length\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Length, 10) + out.RawByte('"') } out.RawByte('}') } @@ -5825,40 +5701,34 @@ func (x *GetRangeRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Address != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"address\":" - out.RawString(prefix) - x.Address.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) } { - if x.Range != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"range\":" - out.RawString(prefix) - x.Range.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"range\":" + out.RawString(prefix) + x.Range.MarshalEasyJSON(out) } { - if x.Raw { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"raw\":" - out.RawString(prefix) - out.Bool(x.Raw) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"raw\":" + out.RawString(prefix) + out.Bool(x.Raw) } out.RawByte('}') } @@ -6067,40 +5937,34 @@ func (x *GetRangeRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -6321,42 +6185,40 @@ func (x *GetRangeResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { switch xx := x.RangePart.(type) { case *GetRangeResponse_Body_Chunk: { - if len(xx.Chunk) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"chunk\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chunk\":" + out.RawString(prefix) + if xx.Chunk != nil { out.Base64Bytes(xx.Chunk) + } else { + out.String("") } } case *GetRangeResponse_Body_SplitInfo: { - if xx.SplitInfo != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"splitInfo\":" - out.RawString(prefix) - xx.SplitInfo.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"splitInfo\":" + out.RawString(prefix) + xx.SplitInfo.MarshalEasyJSON(out) } case *GetRangeResponse_Body_EcInfo: { - if xx.EcInfo != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ecInfo\":" - out.RawString(prefix) - xx.EcInfo.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"ecInfo\":" + out.RawString(prefix) + xx.EcInfo.MarshalEasyJSON(out) } } out.RawByte('}') @@ -6594,40 +6456,34 @@ func (x *GetRangeResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -6839,63 +6695,59 @@ func (x *GetRangeHashRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Address != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"address\":" - out.RawString(prefix) - x.Address.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) } { - if len(x.Ranges) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ranges\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Ranges { - if i != 0 { - out.RawByte(',') - } - x.Ranges[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"ranges\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Ranges { + if i != 0 { + out.RawByte(',') + } + x.Ranges[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if len(x.Salt) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"salt\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"salt\":" + out.RawString(prefix) + if x.Salt != nil { out.Base64Bytes(x.Salt) + } else { + out.String("") } } { - if x.Type != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"type\":" - out.RawString(prefix) - v := int32(x.Type) - if vv, ok := grpc.ChecksumType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := grpc.ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } out.RawByte('}') @@ -7134,40 +6986,34 @@ func (x *GetRangeHashRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -7330,40 +7176,40 @@ func (x *GetRangeHashResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Type != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"type\":" - out.RawString(prefix) - v := int32(x.Type) - if vv, ok := grpc.ChecksumType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := grpc.ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if len(x.HashList) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"hashList\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.HashList { - if i != 0 { - out.RawByte(',') - } - out.Base64Bytes(x.HashList[i]) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"hashList\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.HashList { + if i != 0 { + out.RawByte(',') + } + if x.HashList[i] != nil { + out.Base64Bytes(x.HashList[i]) + } else { + out.String("") + } + } + out.RawByte(']') } out.RawByte('}') } @@ -7587,40 +7433,34 @@ func (x *GetRangeHashResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -7788,35 +7628,31 @@ func (x *PutSingleRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Object != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"object\":" - out.RawString(prefix) - x.Object.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"object\":" + out.RawString(prefix) + x.Object.MarshalEasyJSON(out) } { - if len(x.CopiesNumber) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"copiesNumber\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.CopiesNumber { - if i != 0 { - out.RawByte(',') - } - out.Uint32(x.CopiesNumber[i]) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"copiesNumber\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.CopiesNumber { + if i != 0 { + out.RawByte(',') + } + out.Uint32(x.CopiesNumber[i]) + } + out.RawByte(']') } out.RawByte('}') } @@ -8033,40 +7869,34 @@ func (x *PutSingleRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -8371,40 +8201,34 @@ func (x *PutSingleResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -8570,27 +8394,27 @@ func (x *PatchRequest_Body_Patch) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.SourceRange != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"sourceRange\":" - out.RawString(prefix) - x.SourceRange.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"sourceRange\":" + out.RawString(prefix) + x.SourceRange.MarshalEasyJSON(out) } { - if len(x.Chunk) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"chunk\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"chunk\":" + out.RawString(prefix) + if x.Chunk != nil { out.Base64Bytes(x.Chunk) + } else { + out.String("") } } out.RawByte('}') @@ -8798,59 +8622,51 @@ func (x *PatchRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Address != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"address\":" - out.RawString(prefix) - x.Address.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"address\":" + out.RawString(prefix) + x.Address.MarshalEasyJSON(out) } { - if len(x.NewAttributes) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"newAttributes\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.NewAttributes { - if i != 0 { - out.RawByte(',') - } - x.NewAttributes[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"newAttributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.NewAttributes { + if i != 0 { + out.RawByte(',') + } + x.NewAttributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if x.ReplaceAttributes { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"replaceAttributes\":" - out.RawString(prefix) - out.Bool(x.ReplaceAttributes) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"replaceAttributes\":" + out.RawString(prefix) + out.Bool(x.ReplaceAttributes) } { - if x.Patch != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"patch\":" - out.RawString(prefix) - x.Patch.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"patch\":" + out.RawString(prefix) + x.Patch.MarshalEasyJSON(out) } out.RawByte('}') } @@ -9073,40 +8889,34 @@ func (x *PatchRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -9252,16 +9062,14 @@ func (x *PatchResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ObjectId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objectId\":" - out.RawString(prefix) - x.ObjectId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"objectId\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) } out.RawByte('}') } @@ -9457,40 +9265,34 @@ func (x *PatchResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } diff --git a/object/grpc/types_frostfs.pb.go b/object/grpc/types_frostfs.pb.go index 0ee939a..e4a916f 100644 --- a/object/grpc/types_frostfs.pb.go +++ b/object/grpc/types_frostfs.pb.go @@ -307,97 +307,83 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Version != nil { - 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 = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"creationEpoch\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10) + 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 = "\"objectType\":" + out.RawString(prefix) + v := int32(x.ObjectType) + if vv, ok := ObjectType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if x.CreationEpoch != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"creationEpoch\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"payloadLength\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10) + out.RawByte('"') } { - if x.OwnerId != nil { - 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 = "\"payloadHash\":" + out.RawString(prefix) + x.PayloadHash.MarshalEasyJSON(out) } { - if x.ObjectType != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objectType\":" - out.RawString(prefix) - v := int32(x.ObjectType) - if vv, ok := ObjectType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } - } - } - { - if x.PayloadLength != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"payloadLength\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10) - out.RawByte('"') - } - } - { - if x.PayloadHash != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"payloadHash\":" - out.RawString(prefix) - x.PayloadHash.MarshalEasyJSON(out) - } - } - { - if x.HomomorphicHash != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"homomorphicHash\":" - out.RawString(prefix) - x.HomomorphicHash.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"homomorphicHash\":" + out.RawString(prefix) + x.HomomorphicHash.MarshalEasyJSON(out) } out.RawByte('}') } @@ -617,28 +603,24 @@ func (x *Header_Attribute) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Key) != 0 { - 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 = "\"key\":" + out.RawString(prefix) + out.String(x.Key) } { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) } out.RawByte('}') } @@ -890,82 +872,74 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Parent != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"parent\":" - out.RawString(prefix) - x.Parent.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"parent\":" + out.RawString(prefix) + x.Parent.MarshalEasyJSON(out) } { - if x.Previous != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"previous\":" - out.RawString(prefix) - x.Previous.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"previous\":" + out.RawString(prefix) + x.Previous.MarshalEasyJSON(out) } { - if x.ParentSignature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"parentSignature\":" - out.RawString(prefix) - x.ParentSignature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"parentSignature\":" + out.RawString(prefix) + x.ParentSignature.MarshalEasyJSON(out) } { - if x.ParentHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"parentHeader\":" - out.RawString(prefix) - x.ParentHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"parentHeader\":" + out.RawString(prefix) + x.ParentHeader.MarshalEasyJSON(out) } { - if len(x.Children) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"children\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Children { - if i != 0 { - out.RawByte(',') - } - x.Children[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"children\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Children { + if i != 0 { + out.RawByte(',') + } + x.Children[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if len(x.SplitId) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"splitID\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitID\":" + out.RawString(prefix) + if x.SplitId != nil { out.Base64Bytes(x.SplitId) + } else { + out.String("") } } out.RawByte('}') @@ -1288,107 +1262,99 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Parent != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"parent\":" - out.RawString(prefix) - x.Parent.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"parent\":" + out.RawString(prefix) + x.Parent.MarshalEasyJSON(out) } { - if x.Index != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"index\":" - out.RawString(prefix) - out.Uint32(x.Index) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"index\":" + out.RawString(prefix) + out.Uint32(x.Index) } { - if x.Total != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"total\":" - out.RawString(prefix) - out.Uint32(x.Total) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"total\":" + out.RawString(prefix) + out.Uint32(x.Total) } { - if x.HeaderLength != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"headerLength\":" - out.RawString(prefix) - out.Uint32(x.HeaderLength) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"headerLength\":" + out.RawString(prefix) + out.Uint32(x.HeaderLength) } { - if len(x.Header) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"header\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"header\":" + out.RawString(prefix) + if x.Header != nil { out.Base64Bytes(x.Header) + } else { + out.String("") } } { - if len(x.ParentSplitId) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"parentSplitID\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"parentSplitID\":" + out.RawString(prefix) + if x.ParentSplitId != nil { out.Base64Bytes(x.ParentSplitId) + } else { + out.String("") } } { - if x.ParentSplitParentId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"parentSplitParentID\":" - out.RawString(prefix) - x.ParentSplitParentId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"parentSplitParentID\":" + out.RawString(prefix) + x.ParentSplitParentId.MarshalEasyJSON(out) } { - if len(x.ParentAttributes) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"parentAttributes\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.ParentAttributes { - if i != 0 { - out.RawByte(',') - } - x.ParentAttributes[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"parentAttributes\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.ParentAttributes { + if i != 0 { + out.RawByte(',') + } + x.ParentAttributes[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -1842,164 +1808,140 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Version != nil { - 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 = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"containerID\":" + out.RawString(prefix) + x.ContainerId.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 = "\"creationEpoch\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10) + out.RawByte('"') + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"payloadLength\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10) + out.RawByte('"') + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"payloadHash\":" + out.RawString(prefix) + x.PayloadHash.MarshalEasyJSON(out) + } + { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"objectType\":" + out.RawString(prefix) + v := int32(x.ObjectType) + if vv, ok := ObjectType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if x.ContainerId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerID\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"homomorphicHash\":" + out.RawString(prefix) + x.HomomorphicHash.MarshalEasyJSON(out) } { - if x.OwnerId != nil { - 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 = "\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) } { - if x.CreationEpoch != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"creationEpoch\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10) - out.RawByte('"') + 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 x.PayloadLength != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"payloadLength\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"split\":" + out.RawString(prefix) + x.Split.MarshalEasyJSON(out) } { - if x.PayloadHash != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"payloadHash\":" - out.RawString(prefix) - x.PayloadHash.MarshalEasyJSON(out) - } - } - { - if x.ObjectType != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objectType\":" - out.RawString(prefix) - v := int32(x.ObjectType) - if vv, ok := ObjectType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } - } - } - { - if x.HomomorphicHash != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"homomorphicHash\":" - out.RawString(prefix) - x.HomomorphicHash.MarshalEasyJSON(out) - } - } - { - if x.SessionToken != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"sessionToken\":" - out.RawString(prefix) - x.SessionToken.MarshalEasyJSON(out) - } - } - { - if len(x.Attributes) != 0 { - 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 x.Split != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"split\":" - out.RawString(prefix) - x.Split.MarshalEasyJSON(out) - } - } - { - if x.Ec != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ec\":" - out.RawString(prefix) - x.Ec.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"ec\":" + out.RawString(prefix) + x.Ec.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2310,51 +2252,47 @@ func (x *Object) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ObjectId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objectID\":" - out.RawString(prefix) - x.ObjectId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"objectID\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) } { - if x.Signature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) } { - if x.Header != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"header\":" - out.RawString(prefix) - x.Header.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"header\":" + out.RawString(prefix) + x.Header.MarshalEasyJSON(out) } { - if len(x.Payload) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"payload\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"payload\":" + out.RawString(prefix) + if x.Payload != nil { out.Base64Bytes(x.Payload) + } else { + out.String("") } } out.RawByte('}') @@ -2550,40 +2488,38 @@ func (x *SplitInfo) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.SplitId) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"splitId\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitId\":" + out.RawString(prefix) + if x.SplitId != nil { out.Base64Bytes(x.SplitId) + } else { + out.String("") } } { - if x.LastPart != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"lastPart\":" - out.RawString(prefix) - x.LastPart.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"lastPart\":" + out.RawString(prefix) + x.LastPart.MarshalEasyJSON(out) } { - if x.Link != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"link\":" - out.RawString(prefix) - x.Link.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"link\":" + out.RawString(prefix) + x.Link.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2768,40 +2704,34 @@ func (x *ECInfo_Chunk) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Id != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"id\":" - out.RawString(prefix) - x.Id.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"id\":" + out.RawString(prefix) + x.Id.MarshalEasyJSON(out) } { - if x.Index != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"index\":" - out.RawString(prefix) - out.Uint32(x.Index) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"index\":" + out.RawString(prefix) + out.Uint32(x.Index) } { - if x.Total != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"total\":" - out.RawString(prefix) - out.Uint32(x.Total) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"total\":" + out.RawString(prefix) + out.Uint32(x.Total) } out.RawByte('}') } @@ -2964,23 +2894,21 @@ func (x *ECInfo) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Chunks) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"chunks\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Chunks { - if i != 0 { - out.RawByte(',') - } - x.Chunks[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"chunks\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Chunks { + if i != 0 { + out.RawByte(',') + } + x.Chunks[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } diff --git a/refs/grpc/types_frostfs.pb.go b/refs/grpc/types_frostfs.pb.go index 3ed647c..5a16f8e 100644 --- a/refs/grpc/types_frostfs.pb.go +++ b/refs/grpc/types_frostfs.pb.go @@ -193,28 +193,24 @@ func (x *Address) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ContainerId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerID\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) } { - if x.ObjectId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objectID\":" - out.RawString(prefix) - x.ObjectId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"objectID\":" + out.RawString(prefix) + x.ObjectId.MarshalEasyJSON(out) } out.RawByte('}') } @@ -350,15 +346,17 @@ func (x *ObjectID) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + if x.Value != nil { out.Base64Bytes(x.Value) + } else { + out.String("") } } out.RawByte('}') @@ -487,15 +485,17 @@ func (x *ContainerID) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + if x.Value != nil { out.Base64Bytes(x.Value) + } else { + out.String("") } } out.RawByte('}') @@ -624,15 +624,17 @@ func (x *OwnerID) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + if x.Value != nil { out.Base64Bytes(x.Value) + } else { + out.String("") } } out.RawByte('}') @@ -781,28 +783,24 @@ func (x *Version) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Major != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"major\":" - out.RawString(prefix) - out.Uint32(x.Major) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"major\":" + out.RawString(prefix) + out.Uint32(x.Major) } { - if x.Minor != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"minor\":" - out.RawString(prefix) - out.Uint32(x.Minor) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"minor\":" + out.RawString(prefix) + out.Uint32(x.Minor) } out.RawByte('}') } @@ -992,44 +990,46 @@ func (x *Signature) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Key) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"key\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + if x.Key != nil { out.Base64Bytes(x.Key) + } else { + out.String("") } } { - if len(x.Sign) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + if x.Sign != nil { out.Base64Bytes(x.Sign) + } else { + out.String("") } } { - if x.Scheme != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"scheme\":" - out.RawString(prefix) - v := int32(x.Scheme) - if vv, ok := SignatureScheme_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"scheme\":" + out.RawString(prefix) + v := int32(x.Scheme) + if vv, ok := SignatureScheme_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } out.RawByte('}') @@ -1206,27 +1206,31 @@ func (x *SignatureRFC6979) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Key) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"key\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"key\":" + out.RawString(prefix) + if x.Key != nil { out.Base64Bytes(x.Key) + } else { + out.String("") } } { - if len(x.Sign) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"signature\":" + out.RawString(prefix) + if x.Sign != nil { out.Base64Bytes(x.Sign) + } else { + out.String("") } } out.RawByte('}') @@ -1381,32 +1385,32 @@ func (x *Checksum) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Type != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"type\":" - out.RawString(prefix) - v := int32(x.Type) - if vv, ok := ChecksumType_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"type\":" + out.RawString(prefix) + v := int32(x.Type) + if vv, ok := ChecksumType_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if len(x.Sum) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"sum\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"sum\":" + out.RawString(prefix) + if x.Sum != nil { out.Base64Bytes(x.Sum) + } else { + out.String("") } } out.RawByte('}') diff --git a/session/grpc/service_frostfs.pb.go b/session/grpc/service_frostfs.pb.go index c71325a..6d3ea9f 100644 --- a/session/grpc/service_frostfs.pb.go +++ b/session/grpc/service_frostfs.pb.go @@ -121,30 +121,26 @@ func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.OwnerId != nil { - 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 = "\"ownerId\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) } { - if x.Expiration != 0 { - 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('"') + 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('}') } @@ -354,40 +350,34 @@ func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } @@ -550,27 +540,31 @@ func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Id) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"id\":" - out.RawString(prefix) + 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 len(x.SessionKey) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"sessionKey\":" - out.RawString(prefix) + 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('}') @@ -772,40 +766,34 @@ func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.MetaHeader != nil { - 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 = "\"metaHeader\":" + out.RawString(prefix) + x.MetaHeader.MarshalEasyJSON(out) } { - if x.VerifyHeader != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verifyHeader\":" - out.RawString(prefix) - x.VerifyHeader.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"verifyHeader\":" + out.RawString(prefix) + x.VerifyHeader.MarshalEasyJSON(out) } out.RawByte('}') } diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go index e18c1ab..e9f3b42 100644 --- a/session/grpc/types_frostfs.pb.go +++ b/session/grpc/types_frostfs.pb.go @@ -182,35 +182,31 @@ func (x *ObjectSessionContext_Target) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Container != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"container\":" - out.RawString(prefix) - x.Container.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"container\":" + out.RawString(prefix) + x.Container.MarshalEasyJSON(out) } { - if len(x.Objects) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"objects\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Objects { - if i != 0 { - out.RawByte(',') - } - x.Objects[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"objects\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Objects { + if i != 0 { + out.RawByte(',') + } + x.Objects[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } @@ -376,33 +372,29 @@ func (x *ObjectSessionContext) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Verb != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verb\":" - out.RawString(prefix) - v := int32(x.Verb) - if vv, ok := ObjectSessionContext_Verb_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verb\":" + out.RawString(prefix) + v := int32(x.Verb) + if vv, ok := ObjectSessionContext_Verb_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if x.Target != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"target\":" - out.RawString(prefix) - x.Target.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"target\":" + out.RawString(prefix) + x.Target.MarshalEasyJSON(out) } out.RawByte('}') } @@ -634,45 +626,39 @@ func (x *ContainerSessionContext) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Verb != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"verb\":" - out.RawString(prefix) - v := int32(x.Verb) - if vv, ok := ContainerSessionContext_Verb_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"verb\":" + out.RawString(prefix) + v := int32(x.Verb) + if vv, ok := ContainerSessionContext_Verb_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } { - if x.Wildcard { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"wildcard\":" - out.RawString(prefix) - out.Bool(x.Wildcard) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"wildcard\":" + out.RawString(prefix) + out.Bool(x.Wildcard) } { - if x.ContainerId != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"containerID\":" - out.RawString(prefix) - x.ContainerId.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"containerID\":" + out.RawString(prefix) + x.ContainerId.MarshalEasyJSON(out) } out.RawByte('}') } @@ -869,46 +855,40 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Exp != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"exp\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Exp, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"exp\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Exp, 10) + out.RawByte('"') } { - if x.Nbf != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"nbf\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"nbf\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10) + out.RawByte('"') } { - if x.Iat != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"iat\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"iat\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10) + out.RawByte('"') } out.RawByte('}') } @@ -1202,79 +1182,75 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Id) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"id\":" - out.RawString(prefix) + 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 x.OwnerId != nil { - 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 = "\"ownerID\":" + out.RawString(prefix) + x.OwnerId.MarshalEasyJSON(out) } { - if x.Lifetime != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"lifetime\":" - out.RawString(prefix) - x.Lifetime.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"lifetime\":" + out.RawString(prefix) + x.Lifetime.MarshalEasyJSON(out) } { - if len(x.SessionKey) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"sessionKey\":" - out.RawString(prefix) + 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("") } } switch xx := x.Context.(type) { case *SessionToken_Body_Object: { - if xx.Object != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"object\":" - out.RawString(prefix) - xx.Object.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"object\":" + out.RawString(prefix) + xx.Object.MarshalEasyJSON(out) } case *SessionToken_Body_Container: { - if xx.Container != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"container\":" - out.RawString(prefix) - xx.Container.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"container\":" + out.RawString(prefix) + xx.Container.MarshalEasyJSON(out) } } out.RawByte('}') @@ -1483,28 +1459,24 @@ func (x *SessionToken) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Body != nil { - 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 = "\"body\":" + out.RawString(prefix) + x.Body.MarshalEasyJSON(out) } { - if x.Signature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"signature\":" - out.RawString(prefix) - x.Signature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"signature\":" + out.RawString(prefix) + x.Signature.MarshalEasyJSON(out) } out.RawByte('}') } @@ -1660,28 +1632,24 @@ func (x *XHeader) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.Key) != 0 { - 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 = "\"key\":" + out.RawString(prefix) + out.String(x.Key) } { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) - out.String(x.Value) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"value\":" + out.RawString(prefix) + out.String(x.Value) } out.RawByte('}') } @@ -1973,111 +1941,95 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Version != nil { - 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 = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) } { - if x.Epoch != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"epoch\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"epoch\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10) + out.RawByte('"') } { - if x.Ttl != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ttl\":" - out.RawString(prefix) - out.Uint32(x.Ttl) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"ttl\":" + out.RawString(prefix) + out.Uint32(x.Ttl) } { - if len(x.XHeaders) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"xHeaders\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.XHeaders { - if i != 0 { - out.RawByte(',') - } - x.XHeaders[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"xHeaders\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.XHeaders { + if i != 0 { + out.RawByte(',') + } + x.XHeaders[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if x.SessionToken != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"sessionToken\":" - out.RawString(prefix) - x.SessionToken.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"sessionToken\":" + out.RawString(prefix) + x.SessionToken.MarshalEasyJSON(out) } { - if x.BearerToken != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"bearerToken\":" - out.RawString(prefix) - x.BearerToken.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"bearerToken\":" + out.RawString(prefix) + x.BearerToken.MarshalEasyJSON(out) } { - if x.Origin != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"origin\":" - out.RawString(prefix) - x.Origin.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) } { - if x.MagicNumber != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"magicNumber\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"magicNumber\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10) + out.RawByte('"') } out.RawByte('}') } @@ -2398,85 +2350,73 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Version != nil { - 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 = "\"version\":" + out.RawString(prefix) + x.Version.MarshalEasyJSON(out) } { - if x.Epoch != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"epoch\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"epoch\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10) + out.RawByte('"') } { - if x.Ttl != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"ttl\":" - out.RawString(prefix) - out.Uint32(x.Ttl) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"ttl\":" + out.RawString(prefix) + out.Uint32(x.Ttl) } { - if len(x.XHeaders) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"xHeaders\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.XHeaders { - if i != 0 { - out.RawByte(',') - } - x.XHeaders[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"xHeaders\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.XHeaders { + if i != 0 { + out.RawByte(',') + } + x.XHeaders[i].MarshalEasyJSON(out) + } + out.RawByte(']') } { - if x.Origin != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"origin\":" - out.RawString(prefix) - x.Origin.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) } { - if x.Status != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"status\":" - out.RawString(prefix) - x.Status.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"status\":" + out.RawString(prefix) + x.Status.MarshalEasyJSON(out) } out.RawByte('}') } @@ -2733,52 +2673,44 @@ func (x *RequestVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.BodySignature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"bodySignature\":" - out.RawString(prefix) - x.BodySignature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"bodySignature\":" + out.RawString(prefix) + x.BodySignature.MarshalEasyJSON(out) } { - if x.MetaSignature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaSignature\":" - out.RawString(prefix) - x.MetaSignature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"metaSignature\":" + out.RawString(prefix) + x.MetaSignature.MarshalEasyJSON(out) } { - if x.OriginSignature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"originSignature\":" - out.RawString(prefix) - x.OriginSignature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"originSignature\":" + out.RawString(prefix) + x.OriginSignature.MarshalEasyJSON(out) } { - if x.Origin != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"origin\":" - out.RawString(prefix) - x.Origin.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) } out.RawByte('}') } @@ -3000,52 +2932,44 @@ func (x *ResponseVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.BodySignature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"bodySignature\":" - out.RawString(prefix) - x.BodySignature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"bodySignature\":" + out.RawString(prefix) + x.BodySignature.MarshalEasyJSON(out) } { - if x.MetaSignature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"metaSignature\":" - out.RawString(prefix) - x.MetaSignature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"metaSignature\":" + out.RawString(prefix) + x.MetaSignature.MarshalEasyJSON(out) } { - if x.OriginSignature != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"originSignature\":" - out.RawString(prefix) - x.OriginSignature.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"originSignature\":" + out.RawString(prefix) + x.OriginSignature.MarshalEasyJSON(out) } { - if x.Origin != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"origin\":" - out.RawString(prefix) - x.Origin.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"origin\":" + out.RawString(prefix) + x.Origin.MarshalEasyJSON(out) } out.RawByte('}') } diff --git a/status/grpc/types_frostfs.pb.go b/status/grpc/types_frostfs.pb.go index 609fc03..1d8b477 100644 --- a/status/grpc/types_frostfs.pb.go +++ b/status/grpc/types_frostfs.pb.go @@ -371,27 +371,27 @@ func (x *Status_Detail) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Id != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"id\":" - out.RawString(prefix) - out.Uint32(x.Id) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"id\":" + out.RawString(prefix) + out.Uint32(x.Id) } { - if len(x.Value) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"value\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"value\":" + out.RawString(prefix) + if x.Value != nil { out.Base64Bytes(x.Value) + } else { + out.String("") } } out.RawByte('}') @@ -580,47 +580,41 @@ func (x *Status) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.Code != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"code\":" - out.RawString(prefix) - out.Uint32(x.Code) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"code\":" + out.RawString(prefix) + out.Uint32(x.Code) } { - if len(x.Message) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"message\":" - out.RawString(prefix) - out.String(x.Message) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"message\":" + out.RawString(prefix) + out.String(x.Message) } { - if len(x.Details) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"details\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.Details { - if i != 0 { - out.RawByte(',') - } - x.Details[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"details\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.Details { + if i != 0 { + out.RawByte(',') + } + x.Details[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } diff --git a/tombstone/grpc/types_frostfs.pb.go b/tombstone/grpc/types_frostfs.pb.go index e5b67d5..acb1836 100644 --- a/tombstone/grpc/types_frostfs.pb.go +++ b/tombstone/grpc/types_frostfs.pb.go @@ -144,49 +144,47 @@ func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.ExpirationEpoch != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"expirationEpoch\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.ExpirationEpoch, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"expirationEpoch\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.ExpirationEpoch, 10) + out.RawByte('"') } { - if len(x.SplitId) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"splitID\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"splitID\":" + out.RawString(prefix) + if x.SplitId != nil { out.Base64Bytes(x.SplitId) + } else { + out.String("") } } { - if len(x.Members) != 0 { - 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(']') + 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('}') } diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index 8b717be..5498cf9 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -26,11 +26,37 @@ func nonZero[T protoInt]() T { func TestStableMarshalSingle(t *testing.T) { t.Run("empty", func(t *testing.T) { - input := &generated.Primitives{} - require.Zero(t, input.StableSize()) + t.Run("proto", func(t *testing.T) { + input := &generated.Primitives{} + require.Zero(t, input.StableSize()) - r := input.MarshalProtobuf(nil) - require.Empty(t, r) + r := input.MarshalProtobuf(nil) + require.Empty(t, r) + }) + t.Run("json", func(t *testing.T) { + input := &generated.Primitives{} + r, err := input.MarshalJSON() + require.NoError(t, err) + require.NotEmpty(t, r) + + var actual test.Primitives + require.NoError(t, protojson.Unmarshal(r, &actual)) + + t.Run("protojson compatibility", func(t *testing.T) { + data, err := protojson.MarshalOptions{EmitUnpopulated: true}.Marshal(&actual) + require.NoError(t, err) + require.JSONEq(t, string(data), string(r)) + }) + + var actualFrostfs generated.Primitives + require.NoError(t, actualFrostfs.UnmarshalJSON(r)) + if len(actualFrostfs.FieldA) == 0 { + actualFrostfs.FieldA = nil + } + require.Equal(t, input, &actualFrostfs) + + primitivesEqual(t, input, &actual) + }) }) marshalCases := []struct { @@ -77,13 +103,16 @@ func TestStableMarshalSingle(t *testing.T) { require.NoError(t, protojson.Unmarshal(r, &actual)) t.Run("protojson compatibility", func(t *testing.T) { - data, err := protojson.Marshal(&actual) + data, err := protojson.MarshalOptions{EmitUnpopulated: true}.Marshal(&actual) require.NoError(t, err) require.JSONEq(t, string(data), string(r)) }) var actualFrostfs generated.Primitives require.NoError(t, actualFrostfs.UnmarshalJSON(r)) + if len(actualFrostfs.FieldA) == 0 { + actualFrostfs.FieldA = nil + } require.Equal(t, tc.input, &actualFrostfs) primitivesEqual(t, tc.input, &actual) @@ -94,7 +123,10 @@ func TestStableMarshalSingle(t *testing.T) { func primitivesEqual(t *testing.T, a *generated.Primitives, b *test.Primitives) { // Compare each field directly, because proto-generated code has private fields. - require.Equal(t, a.FieldA, b.FieldA) + require.Equal(t, len(a.FieldA), len(b.FieldA)) + if len(a.FieldA) != 0 { + require.Equal(t, a.FieldA, b.FieldA) + } require.Equal(t, a.FieldB, b.FieldB) require.Equal(t, a.FieldC, b.FieldC) require.Equal(t, a.FieldD, b.FieldD) diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index 3804e46..f979038 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -133,16 +133,14 @@ func (x *Primitives_Aux) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.InnerField != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"innerField\":" - out.RawString(prefix) - out.Uint32(x.InnerField) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"innerField\":" + out.RawString(prefix) + out.Uint32(x.InnerField) } out.RawByte('}') } @@ -579,187 +577,167 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.FieldA) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldA\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldA\":" + out.RawString(prefix) + if x.FieldA != nil { out.Base64Bytes(x.FieldA) + } else { + out.String("") } } { - if len(x.FieldB) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldB\":" - out.RawString(prefix) - out.String(x.FieldB) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldB\":" + out.RawString(prefix) + out.String(x.FieldB) } { - if x.FieldC { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldC\":" - out.RawString(prefix) - out.Bool(x.FieldC) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldC\":" + out.RawString(prefix) + out.Bool(x.FieldC) } { - if x.FieldD != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldD\":" - out.RawString(prefix) - out.Int32(x.FieldD) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldD\":" + out.RawString(prefix) + out.Int32(x.FieldD) } { - if x.FieldE != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldE\":" - out.RawString(prefix) - out.Uint32(x.FieldE) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldE\":" + out.RawString(prefix) + out.Uint32(x.FieldE) } { - if x.FieldF != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldF\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldF, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldF\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldF, 10) + out.RawByte('"') } { - if x.FieldG != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldG\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldG, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldG\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldG, 10) + out.RawByte('"') } { - if x.FieldI != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldI\":" - out.RawString(prefix) - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldI, 10) - out.RawByte('"') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldI\":" + out.RawString(prefix) + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldI, 10) + out.RawByte('"') } { - if x.FieldJ != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldJ\":" - out.RawString(prefix) - out.Float64(x.FieldJ) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldJ\":" + out.RawString(prefix) + out.Float64(x.FieldJ) } { - if x.FieldK != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldK\":" - out.RawString(prefix) - out.Uint32(x.FieldK) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldK\":" + out.RawString(prefix) + out.Uint32(x.FieldK) } { - if x.FieldH != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldH\":" - out.RawString(prefix) - v := int32(x.FieldH) - if vv, ok := Primitives_SomeEnum_name[v]; ok { - out.String(vv) - } else { - out.Int32(v) - } + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldH\":" + out.RawString(prefix) + v := int32(x.FieldH) + if vv, ok := Primitives_SomeEnum_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) } } switch xx := x.FieldM.(type) { case *Primitives_FieldMa: { - if len(xx.FieldMa) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldMa\":" - out.RawString(prefix) + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldMa\":" + out.RawString(prefix) + if xx.FieldMa != nil { out.Base64Bytes(xx.FieldMa) + } else { + out.String("") } } case *Primitives_FieldMe: { - if xx.FieldMe != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldMe\":" - out.RawString(prefix) - out.Uint32(xx.FieldMe) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldMe\":" + out.RawString(prefix) + out.Uint32(xx.FieldMe) } case *Primitives_FieldAux: { - if xx.FieldAux != nil { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldAux\":" - out.RawString(prefix) - xx.FieldAux.MarshalEasyJSON(out) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldAux\":" + out.RawString(prefix) + xx.FieldAux.MarshalEasyJSON(out) } } out.RawByte('}') @@ -1067,16 +1045,14 @@ func (x *RepPrimitives_Aux) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if x.InnerField != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"innerField\":" - out.RawString(prefix) - out.Uint32(x.InnerField) + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"innerField\":" + out.RawString(prefix) + out.Uint32(x.InnerField) } out.RawByte('}') } @@ -1365,162 +1341,150 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) { first := true out.RawByte('{') { - if len(x.FieldA) != 0 { - if !first { + if !first { + out.RawByte(',') + } else { + first = false + } + const prefix string = "\"fieldA\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldA { + if i != 0 { out.RawByte(',') - } else { - first = false } - const prefix string = "\"fieldA\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldA { - if i != 0 { - out.RawByte(',') - } + if x.FieldA[i] != nil { out.Base64Bytes(x.FieldA[i]) + } else { + out.String("") } - out.RawByte(']') } + out.RawByte(']') } { - if len(x.FieldB) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldB\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldB { - if i != 0 { - out.RawByte(',') - } - out.String(x.FieldB[i]) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldB\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldB { + if i != 0 { + out.RawByte(',') + } + out.String(x.FieldB[i]) + } + out.RawByte(']') } { - if len(x.FieldC) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldC\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldC { - if i != 0 { - out.RawByte(',') - } - out.Int32(x.FieldC[i]) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldC\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldC { + if i != 0 { + out.RawByte(',') + } + out.Int32(x.FieldC[i]) + } + out.RawByte(']') } { - if len(x.FieldD) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldD\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldD { - if i != 0 { - out.RawByte(',') - } - out.Uint32(x.FieldD[i]) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldD\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldD { + if i != 0 { + out.RawByte(',') + } + out.Uint32(x.FieldD[i]) + } + out.RawByte(']') } { - if len(x.FieldE) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldE\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldE { - if i != 0 { - out.RawByte(',') - } - out.RawByte('"') - out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldE[i], 10) - out.RawByte('"') - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldE\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldE { + if i != 0 { + out.RawByte(',') + } + out.RawByte('"') + out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldE[i], 10) + out.RawByte('"') + } + out.RawByte(']') } { - if len(x.FieldF) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldF\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldF { - if i != 0 { - out.RawByte(',') - } - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldF[i], 10) - out.RawByte('"') - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldF\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldF { + if i != 0 { + out.RawByte(',') + } + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldF[i], 10) + out.RawByte('"') + } + out.RawByte(']') } { - if len(x.FieldFu) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldFu\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldFu { - if i != 0 { - out.RawByte(',') - } - out.RawByte('"') - out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldFu[i], 10) - out.RawByte('"') - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldFu\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldFu { + if i != 0 { + out.RawByte(',') + } + out.RawByte('"') + out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldFu[i], 10) + out.RawByte('"') + } + out.RawByte(']') } { - if len(x.FieldAux) != 0 { - if !first { - out.RawByte(',') - } else { - first = false - } - const prefix string = "\"fieldAux\":" - out.RawString(prefix) - out.RawByte('[') - for i := range x.FieldAux { - if i != 0 { - out.RawByte(',') - } - x.FieldAux[i].MarshalEasyJSON(out) - } - out.RawByte(']') + if !first { + out.RawByte(',') + } else { + first = false } + const prefix string = "\"fieldAux\":" + out.RawString(prefix) + out.RawByte('[') + for i := range x.FieldAux { + if i != 0 { + out.RawByte(',') + } + x.FieldAux[i].MarshalEasyJSON(out) + } + out.RawByte(']') } out.RawByte('}') } diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go index 3267955..15facfd 100644 --- a/util/protogen/internalgengo/json.go +++ b/util/protogen/internalgengo/json.go @@ -192,14 +192,17 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin selector := name + "." + f.GoName - isNotDefault := notNil - if f.Desc.IsList() { - isNotDefault = notEmpty - } else if f.Desc.Kind() != protoreflect.MessageKind { - _, isNotDefault = easyprotoKindInfo(f.Desc.Kind()) - } - g.P("if ", isNotDefault(selector), "{") - defer g.P("}") + // This code is responsible for ignoring default values. + // We will restore it after having parametrized JSON marshaling. + // + // isNotDefault := notNil + // if f.Desc.IsList() { + // isNotDefault = notEmpty + // } else if f.Desc.Kind() != protoreflect.MessageKind { + // _, isNotDefault = easyprotoKindInfo(f.Desc.Kind()) + // } + // g.P("if ", isNotDefault(selector), "{") + // defer g.P("}") g.P("if !first { out.RawByte(','); } else { first = false; }") g.P("const prefix string = ", `"\"`, fieldJSONName(f), `\":"`) @@ -247,7 +250,10 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin case protoreflect.StringKind: template = "out.String(%s)" case protoreflect.BytesKind: - template = "out.Base64Bytes(%s)" + g.P("if ", selector, "!= nil {") + g.P("out.Base64Bytes(", selector, ")") + g.P("} else { out.String(\"\") }") + return case protoreflect.MessageKind: template = "%s.MarshalEasyJSON(out)" case protoreflect.GroupKind: From 29f215756383cf58cd1de326dd1c2961b06ea201 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 11 Oct 2024 10:17:42 +0300 Subject: [PATCH 166/169] [#123] protogen: Treat bytes field as non-nullable In protobuf 3.12 they have added an support for `optional` keyword, which has made it into the main branch in 3.15. https://github.com/protocolbuffers/protobuf/blob/main/docs/implementing_proto3_presence.md https://github.com/protocolbuffers/protobuf/blob/v3.12.0/docs/field_presence.md#presence-in-proto3-apis This means that without an explicit `optional` keyword field presence for scalars is not tracked, thus empty string in JSON should be unmarshaled to a nil byte slice. Relevant decoding code and tests from protojson: https://github.com/protocolbuffers/protobuf-go/blob/fb995f184a1719ec42b247a3771d1036d92adf67/internal/impl/message_reflect_field.go#L327 https://github.com/protocolbuffers/protobuf-go/blob/fb995f184a1719ec42b247a3771d1036d92adf67/encoding/protojson/decode_test.go#L134 https://github.com/protocolbuffers/protobuf-go/blob/fb995f184a1719ec42b247a3771d1036d92adf67/encoding/protojson/decode_test.go#L156 We do not support `optional` keyword and the generator will fail if it sees on. So only implement the default behaviour. Refs #122 Signed-off-by: Evgenii Stratonikov --- acl/grpc/types_frostfs.pb.go | 8 ++- ape/grpc/types_frostfs.pb.go | 8 ++- apemanager/grpc/service_frostfs.pb.go | 16 +++++- container/grpc/types_frostfs.pb.go | 8 ++- netmap/grpc/types_frostfs.pb.go | 24 +++++++-- object/grpc/service_frostfs.pb.go | 48 ++++++++++++++--- object/grpc/types_frostfs.pb.go | 40 ++++++++++++-- refs/grpc/types_frostfs.pb.go | 64 ++++++++++++++++++++--- session/grpc/service_frostfs.pb.go | 16 +++++- session/grpc/types_frostfs.pb.go | 16 +++++- status/grpc/types_frostfs.pb.go | 8 ++- tombstone/grpc/types_frostfs.pb.go | 8 ++- util/proto/marshal_test.go | 10 +--- util/proto/test/custom/test_frostfs.pb.go | 24 +++++++-- util/protogen/internalgengo/json.go | 12 ++++- 15 files changed, 264 insertions(+), 46 deletions(-) diff --git a/acl/grpc/types_frostfs.pb.go b/acl/grpc/types_frostfs.pb.go index e5a6f32..bc90cb7 100644 --- a/acl/grpc/types_frostfs.pb.go +++ b/acl/grpc/types_frostfs.pb.go @@ -691,7 +691,13 @@ func (x *EACLRecord_Target) UnmarshalEasyJSON(in *jlexer.Lexer) { var list [][]byte in.Delim('[') for !in.IsDelim(']') { - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } list = append(list, f) in.WantComma() } diff --git a/ape/grpc/types_frostfs.pb.go b/ape/grpc/types_frostfs.pb.go index cf9499f..1f2a1a5 100644 --- a/ape/grpc/types_frostfs.pb.go +++ b/ape/grpc/types_frostfs.pb.go @@ -401,7 +401,13 @@ func (x *Chain) UnmarshalEasyJSON(in *jlexer.Lexer) { x.Kind = xx { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } xx.Raw = f } } diff --git a/apemanager/grpc/service_frostfs.pb.go b/apemanager/grpc/service_frostfs.pb.go index 7f3ed10..b2633e1 100644 --- a/apemanager/grpc/service_frostfs.pb.go +++ b/apemanager/grpc/service_frostfs.pb.go @@ -558,7 +558,13 @@ func (x *AddChainResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { case "chainId": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.ChainId = f } } @@ -974,7 +980,13 @@ func (x *RemoveChainRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { case "chainId": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.ChainId = f } } diff --git a/container/grpc/types_frostfs.pb.go b/container/grpc/types_frostfs.pb.go index 4ca23fa..a4f0882 100644 --- a/container/grpc/types_frostfs.pb.go +++ b/container/grpc/types_frostfs.pb.go @@ -500,7 +500,13 @@ func (x *Container) UnmarshalEasyJSON(in *jlexer.Lexer) { case "nonce": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Nonce = f } case "basicACL": diff --git a/netmap/grpc/types_frostfs.pb.go b/netmap/grpc/types_frostfs.pb.go index 0328531..24003c6 100644 --- a/netmap/grpc/types_frostfs.pb.go +++ b/netmap/grpc/types_frostfs.pb.go @@ -1855,7 +1855,13 @@ func (x *NodeInfo) UnmarshalEasyJSON(in *jlexer.Lexer) { case "publicKey": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.PublicKey = f } case "addresses": @@ -2279,13 +2285,25 @@ func (x *NetworkConfig_Parameter) UnmarshalEasyJSON(in *jlexer.Lexer) { case "key": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Key = f } case "value": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Value = f } } diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go index 9ee5a3d..a55a41b 100644 --- a/object/grpc/service_frostfs.pb.go +++ b/object/grpc/service_frostfs.pb.go @@ -924,7 +924,13 @@ func (x *GetResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { x.ObjectPart = xx { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } xx.Chunk = f } case "splitInfo": @@ -1699,7 +1705,13 @@ func (x *PutRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { x.ObjectPart = xx { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } xx.Chunk = f } } @@ -6254,7 +6266,13 @@ func (x *GetRangeResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { x.RangePart = xx { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } xx.Chunk = f } case "splitInfo": @@ -6802,7 +6820,13 @@ func (x *GetRangeHashRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { case "salt": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Salt = f } case "type": @@ -7267,7 +7291,13 @@ func (x *GetRangeHashResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { var list [][]byte in.Delim('[') for !in.IsDelim(']') { - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } list = append(list, f) in.WantComma() } @@ -8455,7 +8485,13 @@ func (x *PatchRequest_Body_Patch) UnmarshalEasyJSON(in *jlexer.Lexer) { case "chunk": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Chunk = f } } diff --git a/object/grpc/types_frostfs.pb.go b/object/grpc/types_frostfs.pb.go index e4a916f..a6d4f01 100644 --- a/object/grpc/types_frostfs.pb.go +++ b/object/grpc/types_frostfs.pb.go @@ -1015,7 +1015,13 @@ func (x *Header_Split) UnmarshalEasyJSON(in *jlexer.Lexer) { case "splitID": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.SplitId = f } } @@ -1436,13 +1442,25 @@ func (x *Header_EC) UnmarshalEasyJSON(in *jlexer.Lexer) { case "header": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Header = f } case "parentSplitID": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.ParentSplitId = f } case "parentSplitParentID": @@ -2347,7 +2365,13 @@ func (x *Object) UnmarshalEasyJSON(in *jlexer.Lexer) { case "payload": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Payload = f } } @@ -2552,7 +2576,13 @@ func (x *SplitInfo) UnmarshalEasyJSON(in *jlexer.Lexer) { case "splitId": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.SplitId = f } case "lastPart": diff --git a/refs/grpc/types_frostfs.pb.go b/refs/grpc/types_frostfs.pb.go index 5a16f8e..f2a2663 100644 --- a/refs/grpc/types_frostfs.pb.go +++ b/refs/grpc/types_frostfs.pb.go @@ -390,7 +390,13 @@ func (x *ObjectID) UnmarshalEasyJSON(in *jlexer.Lexer) { case "value": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Value = f } } @@ -529,7 +535,13 @@ func (x *ContainerID) UnmarshalEasyJSON(in *jlexer.Lexer) { case "value": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Value = f } } @@ -668,7 +680,13 @@ func (x *OwnerID) UnmarshalEasyJSON(in *jlexer.Lexer) { case "value": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Value = f } } @@ -1063,13 +1081,25 @@ func (x *Signature) UnmarshalEasyJSON(in *jlexer.Lexer) { case "key": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Key = f } case "signature": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Sign = f } case "scheme": @@ -1264,13 +1294,25 @@ func (x *SignatureRFC6979) UnmarshalEasyJSON(in *jlexer.Lexer) { case "key": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Key = f } case "signature": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Sign = f } } @@ -1466,7 +1508,13 @@ func (x *Checksum) UnmarshalEasyJSON(in *jlexer.Lexer) { case "sum": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Sum = f } } diff --git a/session/grpc/service_frostfs.pb.go b/session/grpc/service_frostfs.pb.go index 6d3ea9f..26213b9 100644 --- a/session/grpc/service_frostfs.pb.go +++ b/session/grpc/service_frostfs.pb.go @@ -598,13 +598,25 @@ func (x *CreateResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { case "id": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Id = f } case "sessionKey": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.SessionKey = f } } diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go index e9f3b42..542a02b 100644 --- a/session/grpc/types_frostfs.pb.go +++ b/session/grpc/types_frostfs.pb.go @@ -1284,7 +1284,13 @@ func (x *SessionToken_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { case "id": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Id = f } case "ownerID": @@ -1304,7 +1310,13 @@ func (x *SessionToken_Body) UnmarshalEasyJSON(in *jlexer.Lexer) { case "sessionKey": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.SessionKey = f } case "object": diff --git a/status/grpc/types_frostfs.pb.go b/status/grpc/types_frostfs.pb.go index 1d8b477..6c62a0f 100644 --- a/status/grpc/types_frostfs.pb.go +++ b/status/grpc/types_frostfs.pb.go @@ -439,7 +439,13 @@ func (x *Status_Detail) UnmarshalEasyJSON(in *jlexer.Lexer) { case "value": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.Value = f } } diff --git a/tombstone/grpc/types_frostfs.pb.go b/tombstone/grpc/types_frostfs.pb.go index acb1836..e56832a 100644 --- a/tombstone/grpc/types_frostfs.pb.go +++ b/tombstone/grpc/types_frostfs.pb.go @@ -231,7 +231,13 @@ func (x *Tombstone) UnmarshalEasyJSON(in *jlexer.Lexer) { case "splitID": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.SplitId = f } case "members": diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index 5498cf9..29af711 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -50,9 +50,6 @@ func TestStableMarshalSingle(t *testing.T) { var actualFrostfs generated.Primitives require.NoError(t, actualFrostfs.UnmarshalJSON(r)) - if len(actualFrostfs.FieldA) == 0 { - actualFrostfs.FieldA = nil - } require.Equal(t, input, &actualFrostfs) primitivesEqual(t, input, &actual) @@ -110,9 +107,6 @@ func TestStableMarshalSingle(t *testing.T) { var actualFrostfs generated.Primitives require.NoError(t, actualFrostfs.UnmarshalJSON(r)) - if len(actualFrostfs.FieldA) == 0 { - actualFrostfs.FieldA = nil - } require.Equal(t, tc.input, &actualFrostfs) primitivesEqual(t, tc.input, &actual) @@ -124,9 +118,7 @@ func TestStableMarshalSingle(t *testing.T) { func primitivesEqual(t *testing.T, a *generated.Primitives, b *test.Primitives) { // Compare each field directly, because proto-generated code has private fields. require.Equal(t, len(a.FieldA), len(b.FieldA)) - if len(a.FieldA) != 0 { - require.Equal(t, a.FieldA, b.FieldA) - } + require.Equal(t, a.FieldA, b.FieldA) require.Equal(t, a.FieldB, b.FieldB) require.Equal(t, a.FieldC, b.FieldC) require.Equal(t, a.FieldD, b.FieldD) diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index f979038..5ef95a6 100644 --- a/util/proto/test/custom/test_frostfs.pb.go +++ b/util/proto/test/custom/test_frostfs.pb.go @@ -771,7 +771,13 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) { case "fieldA": { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } x.FieldA = f } case "fieldB": @@ -903,7 +909,13 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) { x.FieldM = xx { var f []byte - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } xx.FieldMa = f } case "fieldMe": @@ -1520,7 +1532,13 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) { var list [][]byte in.Delim('[') for !in.IsDelim(']') { - f = in.Bytes() + { + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + f = tmp + } list = append(list, f) in.WantComma() } diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go index 15facfd..55c9cd3 100644 --- a/util/protogen/internalgengo/json.go +++ b/util/protogen/internalgengo/json.go @@ -129,7 +129,17 @@ func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string case protoreflect.StringKind: template = "%s = in.String()" case protoreflect.BytesKind: - template = "%s = in.Bytes()" + // Since some time ago proto3 support optional keyword, thus the presence is not tracked by default: + // https://github.com/protocolbuffers/protobuf-go/blob/fb995f184a1719ec42b247a3771d1036d92adf67/internal/impl/message_reflect_field.go#L327 + // We do not explicitly support `optional` keyword, protoc will fail on such fileds. + // Thus, treat empty string as `[]byte(nil)`. + template = `{ + tmp := in.Bytes() + if len(tmp) == 0 { + tmp = nil + } + %s = tmp + }` case protoreflect.MessageKind: if f.Desc.IsList() { g.P("f = ", fieldType(g, f)[2:], "{}") From f0fc40e116d13869bb8a21761749d7666137e15b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 11 Oct 2024 10:28:55 +0300 Subject: [PATCH 167/169] [#123] Resolve funlen linter issue Signed-off-by: Evgenii Stratonikov --- util/protogen/internalgengo/json.go | 34 ++++++++++++++++------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go index 55c9cd3..20730a6 100644 --- a/util/protogen/internalgengo/json.go +++ b/util/protogen/internalgengo/json.go @@ -70,6 +70,24 @@ func emitJSONParseInteger(g *protogen.GeneratedFile, ident string, method string g.P(ident, " := ", typ, "(v)") } +func emitJSONReadEnum(g *protogen.GeneratedFile, name string, enumType string) { + g.P(`switch v := in.Interface().(type) { + case string: + if vv, ok := `+enumType+`_value[v]; ok { + `+name+` = `+enumType+`(vv) + break + } + vv, err := `, strconvPackage.Ident("ParseInt"), `(v, 10, 32) + if err != nil { + in.AddError(err) + return + } + `+name+` = `+enumType+`(vv) + case float64: + `+name+` = `+enumType+`(v) + }`) +} + func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string) { g.P("{") defer g.P("}") @@ -94,21 +112,7 @@ func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string enumType := fieldType(g, f).String() g.P("var parsedValue " + enumType) - g.P(`switch v := in.Interface().(type) { - case string: - if vv, ok := `+enumType+`_value[v]; ok { - parsedValue = `+enumType+`(vv) - break - } - vv, err := `, strconvPackage.Ident("ParseInt"), `(v, 10, 32) - if err != nil { - in.AddError(err) - return - } - parsedValue = `+enumType+`(vv) - case float64: - parsedValue = `+enumType+`(v) - }`) + emitJSONReadEnum(g, "parsedValue", enumType) template = "%s = parsedValue" case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: emitJSONParseInteger(g, "pv", "ParseInt", 32, "int32") From 2bdee4c9e6d9d6d1b9a85f11b3943d966c9e5569 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Wed, 6 Nov 2024 13:37:41 +0300 Subject: [PATCH 168/169] [#126] Stop using obsolete .github directory This commit is a part of multi-repo cleanup effort: https://git.frostfs.info/TrueCloudLab/frostfs-infra/issues/136 Signed-off-by: Vitaliy Potyarkin --- .../ISSUE_TEMPLATE/bug_report.md | 0 .../ISSUE_TEMPLATE/config.yml | 0 .../ISSUE_TEMPLATE/feature_request.md | 0 .forgejo/logo.svg | 70 +++++++++++++++++++ .github/CODEOWNERS | 1 - CODEOWNERS | 1 + CONTRIBUTING.md | 5 +- README.md | 2 +- docs/release-instruction.md | 8 +-- 9 files changed, 79 insertions(+), 8 deletions(-) rename {.github => .forgejo}/ISSUE_TEMPLATE/bug_report.md (100%) rename {.github => .forgejo}/ISSUE_TEMPLATE/config.yml (100%) rename {.github => .forgejo}/ISSUE_TEMPLATE/feature_request.md (100%) create mode 100644 .forgejo/logo.svg delete mode 100644 .github/CODEOWNERS create mode 100644 CODEOWNERS diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.forgejo/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.md rename to .forgejo/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.forgejo/ISSUE_TEMPLATE/config.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/config.yml rename to .forgejo/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.forgejo/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from .github/ISSUE_TEMPLATE/feature_request.md rename to .forgejo/ISSUE_TEMPLATE/feature_request.md diff --git a/.forgejo/logo.svg b/.forgejo/logo.svg new file mode 100644 index 0000000..148c359 --- /dev/null +++ b/.forgejo/logo.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index b3c6cfa..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @TrueCloudLab/storage-core @TrueCloudLab/storage-services @TrueCloudLab/committers diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..276d26f --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +.* @TrueCloudLab/storage-core @TrueCloudLab/storage-services @TrueCloudLab/committers diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dd360b5..eb8061d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,8 @@ Start by forking the `frostfs-api-go` repository, make changes in a branch and t send a pull request. We encourage pull requests to discuss code changes. Here are the steps in details: -### Set up your GitHub Repository +### Set up your repository + Fork [FrostFS node upstream](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/fork) source repository to your own personal repository. Copy the URL of your fork (you will need it for the `git clone` command below). @@ -86,7 +87,7 @@ $ git push origin feature/123-something_awesome ``` ### Create a Pull Request -Pull requests can be created via GitHub. Refer to [this +Pull requests can be created via git.frostfs.info. Refer to [this document](https://help.github.com/articles/creating-a-pull-request/) for detailed steps on how to create a pull request. After a Pull Request gets peer reviewed and approved, it will be merged. diff --git a/README.md b/README.md index a6e7b6f..4ea5d8a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

-FrostFS +FrostFS

Low-level Golang API for FrostFS diff --git a/docs/release-instruction.md b/docs/release-instruction.md index 4134f1c..d9b4e90 100644 --- a/docs/release-instruction.md +++ b/docs/release-instruction.md @@ -35,11 +35,11 @@ Tag a release (must be signed) and push it: $ git tag -s vX.Y.Z[-rc.N] && git push origin vX.Y.Z[-rc.N] ``` -## Make a Github release +## Make a proper release -Using Github's web interface create a new release based on just created tag +Using git.frostfs.info web interface create a new release based on just created tag with the same changes from changelog and publish it. -## Close github milestone +## Close milestone -Close corresponding vX.Y.Z github milestone. +Close corresponding vX.Y.Z milestone. From 557267a07beb045d8848b0be3d96ace72d6b70ce Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Tue, 10 Dec 2024 12:37:53 +0300 Subject: [PATCH 169/169] [#126] Refine CODEOWNERS settings Signed-off-by: Vitaliy Potyarkin --- CODEOWNERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 276d26f..b428c89 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1,2 @@ -.* @TrueCloudLab/storage-core @TrueCloudLab/storage-services @TrueCloudLab/committers +.* @TrueCloudLab/storage-core-committers @TrueCloudLab/storage-core-developers @TrueCloudLab/storage-services-committers @TrueCloudLab/storage-services-developers +.forgejo/.* @potyarkin